Thêm mũi tên giữa các dòng
Oct 18 2020
Tôi đang sử dụng mã này để vẽ sơ đồ:
\begin{tikzpicture}
\draw (1,1) rectangle (11,7);
\draw (1.5,6) node{\textbf{X}$^{+}$} .. controls (8,6) and (6,3) .. (10,3) node{\textbf{X}$^{+}$};
\draw (1.5,4) node{\textbf{X}$^{+}$} .. controls (6,4) and (8.5,7) .. (10,6.5) node{\textbf{X}$^{+}$};
\draw (1.5,2) node{\textbf{X}$^{+}$} .. controls (10,2) and (10,1.5) .. (10,1.5) node{\textbf{X}$^{+}$};
\draw (10,5.5) node{\textbf{X}$^{-}$} .. controls (6,5) and (11,4) .. (10,4) node{\textbf{X}$^{+}$};
\draw (1.5,-0.3) node{$\tau$} .. controls (3,0) and (11,-0.6) .. (10,-0.3) node{$\tau^{'}$};
\draw (12,7) node{$D_A\phi=0$};
\draw (12,-0.3) node{$\wedge^{+}$};
\end{tikzpicture}
Tôi muốn vẽ các mũi tên chỉ từ trái sang phải ở giữa mỗi dòng. Ai đó có thể vui lòng giúp đỡ? Cảm ơn.
Trả lời
3 Alenanno Oct 18 2020 at 17:12
Một cách là sử dụng đồ trang trí qua decorations.markingsthư viện.
Đầu ra
Mã
\documentclass[tikz, margin=10pt]{standalone}
\usetikzlibrary{decorations.markings, arrows.meta}
\tikzset{
direc/.style={%
postaction={decorate,
decoration={%
markings,
mark=at position 0.5 with{%
\arrow{Straight Barb[scale=1.5]}
},
}
}
}
}
\begin{document}
\begin{tikzpicture}
\draw (1,1) rectangle (11,7);
\draw[direc] (1.5,6) node{\textbf{X}$^{+}$} .. controls (8,6) and (6,3) .. (10,3) node{\textbf{X}$^{+}$};
\draw[direc] (1.5,4) node{\textbf{X}$^{+}$} .. controls (6,4) and (8.5,7) .. (10,6.5) node{\textbf{X}$^{+}$};
\draw[direc] (1.5,2) node{\textbf{X}$^{+}$} .. controls (10,2) and (10,1.5) .. (10,1.5) node{\textbf{X}$^{+}$};
\draw[direc] (10,5.5) node{\textbf{X}$^{-}$} .. controls (6,5) and (11,4) .. (10,4) node{\textbf{X}$^{+}$};
\draw[direc] (1.5,-0.3) node{$\tau$} .. controls (3,0) and (11,-0.6) .. (10,-0.3) node{$\tau^{'}$};
\draw (12,7) node{$D_A\phi=0$};
\draw (12,-0.3) node{$\wedge^{+}$};
\end{tikzpicture}
\end{document}