\begin{tikzpicture}[scale=1.5]
\node (A) at (0,0) {$0$};
\node (B) at (1,0) {$H^0(G,P)$};
\node (C) at (2,0) {$H^0(G,M)$};
\node (D) at (3,0) {$H^0(G,N)$};
\node (E) at (1,-1) {$H^1(G,P)$};
\node (F) at (2,-1) {$H^1(G,M)$};
\node (G) at (3,-1) {$H^1(G,N)$};
\path[->,font=\scriptsize,>=angle 90]
(A) edge node[above]{} (B)
(B) edge node[above]{$\phi$} (C)
(C) edge node[above]{$\psi$} (D)
(D) edge node[above]{} (E)
(E) edge node[above]{} (F)
(F) edge node[above]{} (G);
\end{tikzpicture}
所以我得到了这个,我想尝试绘制一个“漂亮的”连接同态,我会尽力描述:它从第一行最后一个元素的末尾开始,到第二行第一个元素的开头结束。
也许在 tikzcd 中做这件事更好,但我也不知道该怎么做。
答案1
仅限 TikZ
代码
\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,quotes}
\begin{document}
\begin{tikzpicture}[scale=2]
\matrix(m)[matrix of math nodes,column sep=15pt,row sep=15pt]{
0 & H^0(G,P) & H^0(G,M) & H^0(G,N) \\
& H^1(G,P) & H^1(G,M) & H^1(G,N) \\
};
\draw[->,font=\scriptsize,every node/.style={above},rounded corners]
(m-1-1) edge (m-1-2)
(m-1-2) edge["$\phi$"] (m-1-3)
(m-1-3) edge["$\psi$"] (m-1-4)
(m-1-4.east) --+(5pt,0)|-+(0,-7.5pt)-|([xshift=-5pt]m-2-2.west)--(m-2-2.west)
(m-2-2) edge (m-2-3)
(m-2-3) edge (m-2-4)
;
\end{tikzpicture}
\end{document}
输出
答案2
这是tikz-cd
小菜一碟:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[scale=1.5]
0 \arrow{r} &
H^0(G,P) \arrow{r}{\phi} &
H^0(G,M) \arrow{r}{\psi} &
H^0(G,N) \arrow{dll} \\
&
H^1(G,P) \arrow{r} &
H^1(G,M) \arrow{r} &
H^1(G,N)
\end{tikzcd}
\end{document}
通过修改第 11 页末尾的文档中的示例,我们可以得到一个弯曲的箭头:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
0 \arrow{r} &
H^0(G,P) \arrow{r}{\phi} &
H^0(G,M) \arrow{r}{\psi} \arrow[phantom, ""{coordinate, name=Z}]{d} &
H^0(G,N)
\arrow[
rounded corners,
to path={
-- ([xshift=2ex]\tikztostart.east)
|- (Z) [near end]\tikztonodes
-| ([xshift=-2ex]\tikztotarget.west)
-- (\tikztotarget)
}
]{dll} \\
&
H^1(G,P) \arrow{r} &
H^1(G,M) \arrow{r} &
H^1(G,N)
\end{tikzcd}
\end{document}