您能帮我编辑图表中的箭头吗?请考虑以下内容MWE
:
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-cd}
\usepackage{mathdots}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,row sep=2em,column sep=2em,minimum width=2em]
{
(0,0)&(0,1)&(0,2)&(0,3)&\dots&&(0,q) \\
(1,0)&(1,1)&(1,2)&\dots&&(1,1-q)\\
(2,0)&(2,1)&\dots&&\iddots\\
(3,0)&\dots \\
\vdots&(q-1,1)\\(q,0)\\};
\path[-stealth]
(m-1-1) edge (m-2-1)
(m-2-1) edge (m-1-2)
(m-1-2) edge (m-3-1)
(m-3-1) edge (m-2-2)
(m-2-2) edge (m-1-3)
(m-1-3) edge (m-4-1)
(m-4-1) edge (m-3-2)
(m-3-2)edge (m-2-3)
(m-2-3)edge (m-1-4)
(m-6-1) edge (m-5-2)
(m-5-2) edge (m-3-5)
(m-3-5) edge (m-2-6)
(m-2-6) edge (m-1-7)
;
\end{tikzpicture}
\end{document}
请注意线条没有对齐。
答案1
再多一行和tikzcd
,箭头就会平行。
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{mathdots}
\begin{document}
\begin{tikzcd}[sep={4.5em,between origins}]
(0,0) \arrow[d] & (0,1) \arrow[ddl] & (0,2) \arrow[dddll] & (0,3) & \dots & \dots & (0,q) \\
(1,0) \arrow[ur] & (1,1) \arrow[ur] & (1,2) \arrow[ur] & \dots & & (1,1-q) \arrow[ur] \\
(2,0) \arrow[ur] & (2,1) \arrow[ur] & \dots & & \iddots \arrow[ur] \\
(3,0) \arrow[ur] & \dots \\
\vdots \\
\vdots & (q-1,1) \arrow[uuurrr] \\
(q,0) \arrow[ur]
\end{tikzcd}
\end{document}