我想使用 tikzcd 绘制一个好看的 Auslander-Reiten 箭筒,但我的条目变得相当大,这有点破坏了格式。有没有(简单的)方法可以让 AR 箭筒看起来好看?我想实现“方格”大小都相同。或者为了达到相同的效果,“行”和“列”中的箭头是平行的。
到目前为止,我已经能够很好地使用 smallmatrix,但对于箭筒来说,由于箭筒在一个方向上非常大,而在另一个方向上非常小,因此格式并不是很完美。
我的版本如下:
正如您所见,它非常平行但并不完美。
代码显示如下:
\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amscd,amssymb,amsfonts,amsthm,mathrsfs}
\usepackage{tikz-cd}
\usepackage{mathtools,thmtools}
\usepackage{quiver}
\begin{document}
\[\begin{tikzcd}[ampersand replacement=\&,column sep = small]
\&\& {\begin{smallmatrix} && 3 & 4 & 5& \end{smallmatrix}} \\
\& {\ \begin{smallmatrix} 1& 2 & 3 & 4 & 5 \end{smallmatrix}} \&\& { \begin{smallmatrix} & & 3 & 4 & 5 & 6 \end{smallmatrix}} \\
{\begin{smallmatrix} &2 & 3 & 4 & 5 & \end{smallmatrix}} \&\& { \begin{smallmatrix} 1 & 2&3 & 4& 5 & 6\end{smallmatrix}} \&\& {\begin{smallmatrix} & & 3 & 4 & & \end{smallmatrix}} \\
\& { \begin{smallmatrix} &2&3 & 4& 5 & 6\end{smallmatrix}} \&\& {\begin{smallmatrix} 1& 2 & 3 & 4 & \end{smallmatrix}} \&\& {\begin{smallmatrix} &&3&&& \end{smallmatrix}} \\
\&\& {\begin{smallmatrix} 2 & 3 & 4 & & \end{smallmatrix}} \&\& { \begin{smallmatrix} 1 & 2 & 3 & & &\end{smallmatrix}} \\
\&\&\& {\begin{smallmatrix} & 2& 3& & & &\end{smallmatrix}}
\arrow[from=2-2, to=3-3]
\arrow[from=3-3, to=4-4]
\arrow[from=4-4, to=5-5]
\arrow[from=6-4, to=5-5]
\arrow[from=5-3, to=4-4]
\arrow[from=5-3, to=6-4]
\arrow[dotted, from=5-5, to=5-3]
\arrow[from=4-2, to=3-3]
\arrow[from=4-2, to=5-3]
\arrow[from=3-1, to=2-2]
\arrow[from=3-1, to=4-2]
\arrow[dotted, from=3-3, to=3-1]
\arrow[from=5-5, to=4-6]
\arrow[dotted, from=4-6, to=4-4]
\arrow[from=4-4, to=3-5]
\arrow[from=3-5, to=4-6]
\arrow[dotted, from=3-5, to=3-3]
\arrow[from=3-3, to=2-4]
\arrow[from=2-4, to=3-5]
\arrow[dotted, from=2-4, to=2-2]
\arrow[from=2-2, to=1-3]
\arrow[from=1-3, to=2-4]
\arrow[dotted, from=4-4, to=4-2]
\end{tikzcd}\]
\end{document}
答案1
而不是column sep = small
使用column sep = {11mm,between origins}
(或者sep = {11mm,between origins}
如果您也想要行)。请确保在第一行添加正确的列数:
\&\& {\begin{smallmatrix} && 3 & 4 & 5& \end{smallmatrix}} \&\&\&\\
此外,如果您不使用,代码会更简单smallmatrix
。
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[\begin{tikzcd}[column sep={11mm,between origins}, font=\scriptsize]
&& 3\ 4\ 5 &&&\\
& 1\ 2\ 3\ 4\ 5 && 3\ 4\ 5\ 6 \\
2\ 3\ 4\ 5 && 1\ 2\ 3\ 4\ 5\ 6 && 3\ 4 \\
& 2\ 3\ 4\ 5\ 6 && 1\ 2\ 3\ 4 && 3 \\
&& 2\ 3\ 4 && 1\ 2\ 3\\
&&& 2\ 3
\arrow[from=2-2, to=3-3]
\arrow[from=3-3, to=4-4]
\arrow[from=4-4, to=5-5]
\arrow[from=6-4, to=5-5]
\arrow[from=5-3, to=4-4]
\arrow[from=5-3, to=6-4]
\arrow[dotted, from=5-5, to=5-3]
\arrow[from=4-2, to=3-3]
\arrow[from=4-2, to=5-3]
\arrow[from=3-1, to=2-2]
\arrow[from=3-1, to=4-2]
\arrow[dotted, from=3-3, to=3-1]
\arrow[from=5-5, to=4-6]
\arrow[dotted, from=4-6, to=4-4]
\arrow[from=4-4, to=3-5]
\arrow[from=3-5, to=4-6]
\arrow[dotted, from=3-5, to=3-3]
\arrow[from=3-3, to=2-4]
\arrow[from=2-4, to=3-5]
\arrow[dotted, from=2-4, to=2-2]
\arrow[from=2-2, to=1-3]
\arrow[from=1-3, to=2-4]
\arrow[dotted, from=4-4, to=4-2]
\end{tikzcd}\]
\end{document}
答案2
快速而肮脏的破解:使用 a\makebox
来确保所有条目具有相同的宽度(我添加了一些数字以使错位更加明显)
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amscd,amssymb,amsfonts,amsthm,mathrsfs}
\usepackage{tikz-cd}
\usepackage{mathtools,thmtools}
\usepackage{quiver}
\begin{document}
\begin{tikzcd}[ampersand replacement=\&,column sep = small,row sep=1.2cm]
\&\& {\makebox[1.1cm]{$\begin{smallmatrix} && 3 & 4 & 5& \end{smallmatrix}$}} \\
\& {\makebox[1.1cm]{$\begin{smallmatrix} 1& 2 & 3 & 4 & 5 \end{smallmatrix}$}} \&
\& {\makebox[1.1cm]{$\begin{smallmatrix} & & 3 & 4 & 5 & 6 & 9 & 9 & 9 & 9 \end{smallmatrix}$}} \\
{\makebox[1.1cm]{$\begin{smallmatrix} &2 & 3 & 4 & 5 & \end{smallmatrix}$}} \&
\& {\makebox[1.1cm]{$\begin{smallmatrix} 1 & 2&3 & 4& 5 & 6\end{smallmatrix}$}} \&
\& {\makebox[1.1cm]{$\begin{smallmatrix} & & 3 & 4 & & \end{smallmatrix}$}} \\
\& {\makebox[1.1cm]{$\begin{smallmatrix} &2&3 & 4& 5 & 6\end{smallmatrix}$}} \&
\& {\makebox[1.1cm]{$\begin{smallmatrix} 1& 2 & 3 & 4 & \end{smallmatrix}$}} \&
\& {\makebox[1.1cm]{$\begin{smallmatrix} &&3&&& \end{smallmatrix}$}} \\
\&
\& {\makebox[1.1cm]{$\begin{smallmatrix} 2 & 3 & 4 & & \end{smallmatrix}$}} \&
\& {\makebox[1.1cm]{$\begin{smallmatrix} 1 & 2 & 3 & & &\end{smallmatrix}$}} \\
\&\&
\& {\makebox[1.1cm]{$\begin{smallmatrix} & 2& 3& & & &\end{smallmatrix}$}}
\arrow[from=2-2, to=3-3]
\arrow[from=3-3, to=4-4]
\arrow[from=4-4, to=5-5]
\arrow[from=6-4, to=5-5]
\arrow[from=5-3, to=4-4]
\arrow[from=5-3, to=6-4]
\arrow[dotted, from=5-5, to=5-3]
\arrow[from=4-2, to=3-3]
\arrow[from=4-2, to=5-3]
\arrow[from=3-1, to=2-2]
\arrow[from=3-1, to=4-2]
\arrow[dotted, from=3-3, to=3-1]
\arrow[from=5-5, to=4-6]
\arrow[dotted, from=4-6, to=4-4]
\arrow[from=4-4, to=3-5]
\arrow[from=3-5, to=4-6]
\arrow[dotted, from=3-5, to=3-3]
\arrow[from=3-3, to=2-4]
\arrow[from=2-4, to=3-5]
\arrow[dotted, from=2-4, to=2-2]
\arrow[from=2-2, to=1-3]
\arrow[from=1-3, to=2-4]
\arrow[dotted, from=4-4, to=4-2]
\end{tikzcd}
\begin{tikzcd}[ampersand replacement=\&,column sep = small,row sep=1.2cm]
\&\& {\begin{smallmatrix} && 3 & 4 & 5& \end{smallmatrix}} \\
\& {\ \begin{smallmatrix} 1& 2 & 3 & 4 & 5 \end{smallmatrix}} \&\& { \begin{smallmatrix} & & 3 & 4 & 5 & 6 & 9 & 9 & 9 & 9 \end{smallmatrix}} \\
{\begin{smallmatrix} &2 & 3 & 4 & 5 & \end{smallmatrix}} \&\& { \begin{smallmatrix} 1 & 2&3 & 4& 5 & 6\end{smallmatrix}} \&\& {\begin{smallmatrix} & & 3 & 4 & & \end{smallmatrix}} \\
\& { \begin{smallmatrix} &2&3 & 4& 5 & 6\end{smallmatrix}} \&\& {\begin{smallmatrix} 1& 2 & 3 & 4 & \end{smallmatrix}} \&\& {\begin{smallmatrix} &&3&&& \end{smallmatrix}} \\
\&\& {\begin{smallmatrix} 2 & 3 & 4 & & \end{smallmatrix}} \&\& { \begin{smallmatrix} 1 & 2 & 3 & & &\end{smallmatrix}} \\
\&\&\& {\begin{smallmatrix} & 2& 3& & & &\end{smallmatrix}}
\arrow[from=2-2, to=3-3]
\arrow[from=3-3, to=4-4]
\arrow[from=4-4, to=5-5]
\arrow[from=6-4, to=5-5]
\arrow[from=5-3, to=4-4]
\arrow[from=5-3, to=6-4]
\arrow[dotted, from=5-5, to=5-3]
\arrow[from=4-2, to=3-3]
\arrow[from=4-2, to=5-3]
\arrow[from=3-1, to=2-2]
\arrow[from=3-1, to=4-2]
\arrow[dotted, from=3-3, to=3-1]
\arrow[from=5-5, to=4-6]
\arrow[dotted, from=4-6, to=4-4]
\arrow[from=4-4, to=3-5]
\arrow[from=3-5, to=4-6]
\arrow[dotted, from=3-5, to=3-3]
\arrow[from=3-3, to=2-4]
\arrow[from=2-4, to=3-5]
\arrow[dotted, from=2-4, to=2-2]
\arrow[from=2-2, to=1-3]
\arrow[from=1-3, to=2-4]
\arrow[dotted, from=4-4, to=4-2]
\end{tikzcd}
\end{document}
(左边是新代码的结果,右边是旧代码的结果)