以下是我使用的代码:
\documentclass{article}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage{mathtools, amssymb}
\usepackage{pst-node, auto-pst-pdf}
\[
\begin{tikzcd}[sep=large]
M \rar \dar["\mathrm{Pinch}" ' ] \arrow[dr, dashed, "\beta_1 + \beta_2 + \beta_3 = 0", sloped] & * \rar \dar & \Sigma M \dar \rar & \Sigma M \dar \\%
M \vee M \vee M \rar[swap, "{(\beta_1 , \beta_2 , \beta_3)}" ] & N \rar & N' \rar & \Sigma M \vee \Sigma M \vee \Sigma M \rar[swap, "{(\beta_1 , \beta_2 , \beta_3)}" ] & N \rar & N' \rar & \Sigma M \vee \Sigma M \vee \Sigma M
\end{tikzcd}
\]
但是这段代码给出了下图:
那么,我想知道如何使这个交换图有 16 个矩形并且占用不超过半页的空间?
我还想将每个第三个向下箭头的颜色涂成绿色
任何帮助都将不胜感激!
答案1
对于tikz-cd
,只有前几个节点(因为其他节点的内容未知):
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[sep=large]
M \rar \dar["\mathrm{Pinch}" ' ]
\drar[dashed, "\beta_1 + \beta_2 + \beta_3 = 0", sloped]
& * \rar \dar
\arrow[dd, phantom, ""{coordinate, name=U}]
& \Sigma M \rar \dar
& \Sigma M \dar
\arrow[ddlll, dashed,
to path={ -- ([xshift=5em]\tikztostart.east)
|- ([yshift=-3em]U) [near end]\tikztonodes
-| ([xshift=-2em]\tikztotarget.west)
-- (\tikztotarget)}] \\
M \vee M \vee M \rar[swap, "{(\beta_1,\beta_2,\beta_3)}" ]
\arrow[d, phantom, ""{coordinate, name=V}]
& N \rar
& N' \rar
& \Sigma M\vee \Sigma M\vee \Sigma M
\arrow[ddlll, "{(\beta_1,\beta_2,\beta_3)}" ',
to path={ -- ([xshift=1em]\tikztostart.east)
|- (V) [near end]\tikztonodes
-| ([xshift=-3em]\tikztotarget.west)
-- (\tikztotarget)}] \\
* \rar \dar
& * \rar \dar
& * \rar[dashed] \dar
& ~ \\
N \rar
& N' \rar
& \Sigma M\vee \Sigma M\vee \Sigma M \rar[dashed]
& ~
\end{tikzcd}
\]
\end{document}
答案2
不是答案,只是评论太长了。这显示了如何将独立类与 pdflatex 一起使用。
\documentclass{standalone}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage{mathtools, amssymb}
% \usepackage{pst-node, auto-pst-pdf}% ???
\begin{document}
\begin{tikzcd}[sep=large]
M \rar \dar["\mathrm{Pinch}" ' ] \arrow[dr, dashed, "\beta_1 + \beta_2 + \beta_3 = 0", sloped] & * \rar \dar & \Sigma M \dar \rar & \Sigma M \dar \\%
M \vee M \vee M \rar[swap, "{(\beta_1 , \beta_2 , \beta_3)}" ] & N \rar & N' \rar & \Sigma M \vee \Sigma M \vee \Sigma M \rar[swap, "{(\beta_1 , \beta_2 , \beta_3)}" ] & N \rar & N' \rar & \Sigma M \vee \Sigma M \vee \Sigma M
\end{tikzcd}
\end{document}
这是如何使用普通的 tikzpicture 生成相同的图表(或多或少)。
\documentclass{standalone}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools, amssymb}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows.meta,calc}
\begin{document}
\begin{tikzpicture}
\matrix (A) [matrix of math nodes, row sep=2cm, column sep={3cm,between origins}]{
M & * & \Sigma M & \Sigma M \\
M \vee M \vee M & N & N' & \Sigma M \vee \Sigma M \vee \Sigma M \\
N & N' & \Sigma M \vee \Sigma M \vee \Sigma M \\
};
\draw[->] (A-1-1) -- (A-1-2);
\draw[->] (A-1-2) -- (A-1-3);
\draw[->] (A-1-3) -- (A-1-4);
\draw[->] (A-1-1) -- (A-2-1) node[midway,left] {Pinch};
\draw[->] (A-1-2) -- (A-2-2);
\draw[->] (A-1-3) -- (A-2-3);
\draw[->] (A-1-4) -- (A-2-4);
\draw[dashed,->] (A-1-1) -- (A-2-2) node[midway,above,sloped] {$\beta_1 + \beta_2 + \beta_3 = 0$};
\draw[->] (A-2-1) -- (A-2-2) node[midway,below] {$(\beta_1 , \beta_2 , \beta_3)$};
\draw[->] (A-2-2) -- (A-2-3);
\draw[->] (A-2-3) -- (A-2-4);
\draw[thick,green,->] (A-2-4) |- ($(A-2-4)!0.5!(A-3-1)$)% midway
node[below, black]{$(\beta_1 , \beta_2 , \beta_3)$}
-| (A-3-1);
\draw[->] (A-3-1) -- (A-3-2);
\draw[->] (A-3-2) -- (A-3-3);
\end{tikzpicture}
\end{document}