から
\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}
この数字は分かります
ノードの中心ではなく境界間の距離を設定するにはどうすればよいですか?
図では、B
との間の距離は、と のloooooooooooooooong C
間の距離よりも短くなっています。A
B
答え1
の代わりにright = of
(ライブラリの構文)を使用する必要があります。positioning
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}