
Estoy intentando convertir un diagrama de PNG a TikZ en LaTeX. Quiero tener dos flechas que apunten a un círculo para que apunten horizontalmente y apunten al borde del círculo. Casi lo consigo usando una .west
coordenada, pero no se alinea del todo:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
[engine/.style={circle,minimum size=6cm,draw=black,font=\large
}, block/.style={
rectangle,minimum size=10cm,draw=black,dashed,font=\large
}, point/.style={
circle,inner sep=0pt,minimum size=0pt,fill=none
}
]
% Draw the rectangle containing the block diagram
\node (block) [block] at (0,0) {};
% Put a label at the top of the box
\node (blockname) [point] at (0, 4.5) {\large Module};
% A circle representing the engine
\node (engine) [engine] at (1,-1) {Engine};
% Inputs representing the network ports
\node (input1) [point] at (-6,-3) {};
\path (input1) edge [->] node [below] {Network A} (input1-|engine.west);
\node (input2) [point] at (-6,-0.5) {};
\path (input2) edge [->] node [above] {Network B} (input2-|engine.west);
% Output
\node (output) [point] at (-6,3) {};
\node (outputup) [point] at (1,3) {};
\path (outputup) edge [->,dashed]
node [above] {Management}
node [below] {Output}
(output);
\path (outputup) edge [->,dashed] (engine);
\end{tikzpicture}
\end{document}
Esto es lo que tengo:
Respuesta1
Creo que puedes usar "caminos que se cruzan", que se describen en el manual de TikZ p34 y 35 (http://www.texample.net/media/pgf/builds/pgfmanualCVS2012-11-04.pdf).
EDITAR
Perdón por mi primer comentario, debido a la falta de tiempo... Este es un ejemplo completo con su código que muestra cómo lograrlo:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, intersections}
\begin{document}
\begin{tikzpicture}
[engine/.style={circle,minimum size=6cm,draw=black,font=\large
}, block/.style={
rectangle,minimum size=10cm,draw=black,dashed,font=\large
}, point/.style={
circle,inner sep=0pt,minimum size=0pt,fill=none
}
]
% Draw the rectangle containing the block diagram
\node (block) [block] at (0,0) {};
% Put a label at the top of the box
\node (blockname) [point] at (0, 4.5) {\large Module};
% A circle representing the engine
\node (engine) [name path=engine, engine] at (1,-1) {Engine};
% Inputs representing the network ports
\node (input1) [point] at (-6,-3) {};
\path [name path=refline] (-6,-3) -- (6,-3);
\node (intersect) [name intersections={of=engine and refline, by=x}] at (intersection-1) {};
\path (input1) edge [->] node [below] {Network A} (input1-|intersect);
\node (input2) [point] at (-6,-0.5) {};
\path (input2) edge [->] node [above] {Network B} (input2-|engine.west);
% Output
\node (output) [point] at (-6,3) {};
\node (outputup) [point] at (1,3) {};
\path (outputup) edge [->,dashed]
node [above] {Management}
node [below] {Output}
(output);
\path (outputup) edge [->,dashed] (engine);
Para lograrlo, creé un nodo que representa la línea que quieres crear, luego otro nodo que representa la primera intersección entre el círculo y la línea y terminé vinculando la línea con este último nodo. Para hacer eso, también necesita usar la biblioteca de intersecciones, cargada por: \usetikzlibrary{intersections}
.
Resultado :
Espero que pueda ayudar.