De
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{shapes,arrows,positioning}
\begin{document}
\tikzstyle{block} = [draw, rectangle, minimum height=3em, minimum width=6em]
\tikzstyle{line} = [->, dashed]
\begin{tikzpicture}[auto, node distance=3.5cm,>=latex']
\node [block] (A) {A};
\node [block,right of=A] (B) {B};
\node [block,right of=B] (C) {loooooooooooooooong C};
\node [block,right of=C] (D) {D};
\draw [line] (A) -- (B);
\draw [line] (B) -- (C);
\draw [line] (C) -- (D);
\end{tikzpicture}
\end{document}
me sale esta figura
¿Cómo puedo establecer la distancia entre los bordes de los nodos en lugar de sus centros?
En la figura la distancia entre B
y loooooooooooooooong C
es más corta que la distancia entre A
y B
.
Respuesta1
Tienes que usar right = of
(que es la sintaxis de positioning
biblioteca) en lugar de right of =
.
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{shapes,arrows,positioning}
\begin{document}
\tikzstyle{block} = [draw, rectangle, minimum height=3em, minimum width=6em]
\tikzstyle{line} = [->, dashed]
\begin{tikzpicture}[auto, node distance=3.5cm,>=latex']
\node [block] (A) {A};
\node [block,right = of A] (B) {B};
\node [block,right = of B] (C) {loooooooooooooooong C};
\node [block,right = of C] (D) {D};
\draw [line] (A) -- (B);
\draw [line] (B) -- (C);
\draw [line] (C) -- (D);
\end{tikzpicture}
\end{document}