我希望\vdots
此链中的 到两个箭头的距离相同。我知道我可以手动移动节点以使其看起来正确,但一定有更好的解决方案。怎么做?
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[start chain=going below,every join/.style={->}]
\node [on chain, join] {A};
\node [on chain, join] {$\vdots$};
\node [on chain, join] {B};
\end{tikzpicture}
\end{document}
答案1
\vdots
是为矩阵设计的。您可以使用不在顶部添加空间的修改版本:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains}
\makeatletter
\DeclareRobustCommand{\rvdots}{%
\vbox{
\baselineskip4\p@\lineskiplimit\z@
\kern-\p@
\hbox{.}\hbox{.}\hbox{.}
}}
\makeatother
\begin{document}
\begin{tikzpicture}[start chain=going below,every join/.style={->}]
\node [on chain, join] {A};
\node [on chain, join] {\rvdots};
\node [on chain, join] {B};
\end{tikzpicture}
\end{document}
答案2
尝试旋转\cdots
。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[start chain=going below,every join/.style={->}]
\node [on chain, join] {A};
\node [on chain, join] {\rotatebox{90}{$\cdots$}};
\node [on chain, join] {B};
\end{tikzpicture}
\end{document}