我想在 Latex 中获取上面的图表,但我不知道如何编辑它。任何帮助都将不胜感激。我以以下方式发布我的努力。
\documentclass{article}
\usepackage[all]{xy}
\begin{document}
\[
\[email protected]{
&& \binom{\alpha_2}{0} \ar[dr] && \ar[l] \binom{\alpha_2}{1} \ar[dr] &&
\ar[l] \binom{\alpha_2}{2} \\
& \ar@{.>}[ur]\binom{\alpha_1}{0} && \ar[l] \binom{\alpha_1}{1} \ar[ur]
&& \ar[l] \binom{\alpha_1}{2} \ar@{.>}[ur] \\
}
\]
\end{document}
答案1
由于xy
包对您来说不是强制性的,我建议使用 的解决方案tikz matrix
。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{matrix}
\tikzset{%
mypoint/.style={circle, fill=black},
middlearrow/.style={% this code is from https://tex.stackexchange.com/a/39283/101651
decoration={markings,
mark= at position 0.5 with {\arrow[scale=2]{#1}} ,
},
postaction={decorate}
}
}
\begin{document}
\begin{tikzpicture}
\matrix[column sep=2.5em, row sep=8ex, inner sep=0pt, minimum width=4pt] {%
%first row
\node (startrow1) {}; &&
\node[mypoint, label={[above,yshift=2pt]$\beta_{1}$}] (B1) {}; &&
\node[mypoint, label={[above,yshift=2pt]$\beta_{2}$}] (B2) {}; &&
\node[mypoint, label={[above,yshift=2pt]$\beta_{3}$}] (B3) {}; &&
\node[text width=3em, align=center] (endrow1) {$\beta$};
\\
%second row
\node (startrow2) {}; &
\node[mypoint, label={[below,yshift=-8pt]$\alpha_{1}$}] (A1) {}; &&
\node[mypoint, label={[below,yshift=-8pt]$\alpha_{2}$}] (A2) {}; &&
\node[mypoint, label={[below,yshift=-8pt]$\alpha_{3}$}] (A3) {}; &&&
\node[text width=3em, align=center] (endrow2) {$\alpha$};
\\
};
\draw[dashed] (startrow1) -- (B1)
(B3) -- (endrow1)
(startrow2) -- (A1)
(A3) -- (endrow2);
\draw[middlearrow={<}] (B1) -- (B2);
\draw[middlearrow={<}] (B2) -- (B3);
\draw[middlearrow={<}] (A1) -- (A2);
\draw[middlearrow={<}] (A2) -- (A3);
\draw[middlearrow={>}, dashed] (A1) -- (B1);
\draw[middlearrow={>}] (B1) -- (A2);
\draw[middlearrow={>}] (A2) -- (B2);
\draw[middlearrow={>}] (B2) -- (A3);
\draw[middlearrow={>}, dashed] (A3) -- (B3);
\end{tikzpicture}
\end{document}
答案2
另一个关于使用tikz
包的主张...使用\usetikzlibrary{arrows.meta, decorations.markings, positioning}
:
documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, decorations.markings, positioning}
\begin{document}
\begin{tikzpicture}[
node distance = 22mm and 11mm,
dot/.style = {circle, fill=black, inner sep=0pt, minimum size=2mm,
node contents={}},
ma/.style = {decoration={% middle arrows
markings,
mark= at position 0.5 with {\arrow{Straight Barb[length=3pt]}} ,
},
},
every edge/.append style = {ma, postaction={decorate}, semithick}
]
% from botom to top
% star coordinate
\coordinate (a);
% nodes (ziga-zag
\node (a1) [dot, label=below:$\alpha_1$, right=of a];
\node (b1) [dot, label=$\beta_{1}$, above right=of a1];
\node (a2) [dot, label=below:$\alpha_{2}$,below right=of b1];
\node (b2) [dot, label=$\beta_{2}$, above right=of a2];
\node (a3) [dot, label=below:$\alpha_{3}$,below right=of b2];
\node (b3) [dot, label=$\beta_{3}$, above right=of a3];
% end coordinates
\coordinate (b) at (a |- b1);
% end coordinates
\coordinate[right=of b3,label=right:$\beta$] (bb);
\coordinate[right=of b3 |- a3,label=right:$\alpha$] (aa);
% continuation dashed lines
\draw[dashed] (a) -- (a1) (a3) -- (aa)
(b) -- (b1) (b3) -- (bb);
% arrows
\draw[ma,dashed] (a1) edge (b1) (a3) edge (b3);
%
\draw (b1) edge (a2) (a2) edge (b2) (b2) edge (a3)
(a3) edge (a2) (a2) edge (a1)
(b3) edge (b2) (b2) edge (b1);
\end{tikzpicture}
\end{document}