答案1
使用tikz-cd
包中您可以使用移位(例如,,shift right
可能shift left
具有用于微调位置的值)来轻松排版交换图中的这种多箭头集。
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
X\ar[r,"f"] & Y\ar[r,shift left,"g_{1}"]\ar[r,shift right,"g_{2}",swap] & Z
\end{tikzcd}
\begin{tikzcd}
X\ar[r,"f"] & Y\ar[r,shift left=1ex,"g_{1}"]\ar[r,shift right=0.4ex,"g_{2}",swap] & Z
\end{tikzcd}
\end{document}
答案2
解决方案pstricks
,psmatrix
环境如下:
\documentclass{article}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}
\begin{document}
\[ \psset{arrows=->, arrowinset=0.15 , linewidth=0.6pt, labelsep=1.5pt, nodesep=3pt, colsep=1.2cm, shortput=nab}
\everypsbox{\scriptstyle}
\begin{psmatrix}
X & Y & Z
%%%
\ncline{1,1}{1,2}^{f}\ncline[offset=2pt]{1,2}{1,3}^{g_1}\ncline[offset =-2pt]{1,2}{1,3}_{g_2}
\end{psmatrix} \]
\end{document}