체인 결합 화살표 선에 일부 라벨을 추가하고 싶습니다.
스타일을 레이블과 결합하기 위해 어떤 명령을 추가할 수 있습니까?
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta,chains}
\begin{document}
\begin{tikzpicture}[
node distance=1.5cm,
arrow/.style={->, >=Stealth, thick},
every on chain/.append style={draw,join,rounded corners,minimum width=2cm, minimum height=1cm, align=center},
every join/.style={arrow},
start chain=C1 going right,
]
\def\nodes{
A/A2B,
B/B2C,
C/C2A%
}
\foreach \name/\label [count=\i] in \nodes {
\typeout{debugme \label}
\node[on chain,join] (N\i) {\name};
}
\end{tikzpicture}
\end{document}
답변1
js bibra의 답변에서 chain-end
및chain-begin
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
chains,
%positioning,
% scopes,
quotes,}
\begin{document}
\begin{tikzpicture}[
node distance=1.5cm,
arrow/.style={->, >=Stealth, thick},
every on chain/.append style={draw,join,rounded corners,minimum width=2cm, minimum height=1cm, align=center},
every join/.style={arrow},
start chain=going right,
]
\def\nodes{
A/,
B/A2B,
C/B2C%
}
\foreach \name/\label [count=\i] in \nodes {
% \node[on chain,join=by {->,"\label"}] (N\i) {\name};
\node[on chain,join=by {"\label"}] (N\i) {\name};
}
\draw [arrow] (chain-end.south) -- ++(0,-1.) -| (chain-begin.south) node[above,pos=0.25]{C2A};
\end{tikzpicture}
\end{document}
답변2
마지막 노드가 빈 상자로 나타나기 때문에 부분적인 답변입니다. 삭제 방법을 찾을 수 없습니다. 아마도 베테랑 중 일부가 도움을 줄 것입니다.
산출
MWE
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,chains,positioning,scopes,quotes}
\begin{document}
\begin{tikzpicture}[
node distance=1.5cm,
arrow/.style={->, >=Stealth, thick},
every on chain/.append style={draw,join,rounded corners,minimum width=2cm, minimum height=1cm, align=center},
every join/.style={arrow},
start chain=C1 going right,
]
\def\nodes{
A/,
B/A2B,
C/B2C,
/C2A%
}
\foreach \name/\label [count=\i] in \nodes {
\node[on chain,join=by {->,"\label"}] (N\i) {\name};
}
\end{tikzpicture}
\end{document}