我已经编码了下图xypic
:
\xymatrix{
& B \ar[rr] \ar'[d][dd]^(.45)\simeq && B\cup_A C \ar@{.>}[dd]^-\simeq \\
A \ar@{>->}[ru] \ar[rr] \ar[dd]_-\simeq && C \ar@{>->}[ru] \ar[dd]^(.68)\simeq & \\
& B' \ar'[r][rr] && B'\cup_{A'}C' \\ A' \ar@{>->}[ru] \ar[rr] && C' \ar@{>->}[ru] &
}
它的渲染效果如下:
如果你像许多人(包括我自己)一样,潜意识里痴迷于对称性,你就会注意到,原本应该平行的对角箭头实际上并不平行。这是顶点长度不同的副作用。
有没有可以自动修复这个问题的命令,比如优先考虑并行性而不是将箭头尖端/末端置于对象最中心的位置?如果没有,我该如何手动修复这个特定的图表?
答案1
借助calc
包装,制作一个宽度为 的盒子,B
并l
对齐左侧并将其放入B\cup_A C
其中。对 执行相同操作B'\cup_{A'}C'
。这里这两个量向右突出,但我希望这样没问题。
\documentclass{article}
\usepackage{xypic,calc}
\begin{document}
\[
\xymatrix{
& B \ar[rr] \ar'[d][dd]^(.45)\simeq && \makebox[\widthof{$B$}][l]{$B\cup_A C$} \ar@{.>}[dd]^-\simeq \\
A \ar@{>->}[ru] \ar[rr] \ar[dd]_-\simeq && C \ar@{>->}[ru] \ar[dd]^(.68)\simeq & \\
& B' \ar'[r][rr] && \makebox[\widthof{$B$}][l]{$B'\cup_{A'}C'$} \\ A' \ar@{>->}[ru] \ar[rr] && C' \ar@{>->}[ru] &
}
\]
\end{document}
答案2
类似图片用于tikz-cd
交换图。此代码由马查要有点耐心。
\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,353); %set diagram left start at 0, and has height of 353
\draw [dash pattern={on 0.84pt off 2.51pt}] (238.33,33) -- (238.33,98) ;
\draw [shift={(238.33,98)}, rotate = 270] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (212.67,154.5) -- (230,123.17) ;
\draw [shift={(230,123.17)}, rotate = 478.95] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (151.33,110.5) -- (226,109.83) ;
\draw [shift={(226,109.83)}, rotate = 539.49] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (206,59.67) -- (224,40.5) ;
\draw [shift={(224,40.5)}, rotate = 493.2] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (203.33,80.33) -- (204,152.5) ;
\draw [shift={(204,152.5)}, rotate = 269.47] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (86.96,71) node {$A$};
\draw (132.82,21) node {$C$};
\draw (86.96,171) node {$A'$};
\draw (262,21) node {$B\cup_A C$};
\draw (215.84,72) node {$B$};
\draw (132.82,111) node {$B'$};
\draw (262,111.67) node {$B'\cup_{A'}C'$};
\draw (212.51,170) node {$C'$};
\draw (74,122.67) node [align=left] {$\simeq$};
\draw (191.33,123.33) node [align=left] {$\simeq$};
\draw (252.67,56.33) node [align=left] {$\simeq$};
\draw (121.33,57.67) node [align=left] {$\simeq$};
\draw (147.18,21) -- (227.37,21) ;
\draw [shift={(227.37,21)}, rotate = 180] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (101.32,55.34) -- (118.45,36.67) ;
\draw [shift={(118.45,36.67)}, rotate = 492.53] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (101.32,71.11) -- (202.66,71.9) ;
\draw [shift={(202.66,71.9)}, rotate = 180.44] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (86.96,86.74) -- (86.96,155.26) ;
\draw [shift={(86.96,155.26)}, rotate = 270] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (101.55,170.88) -- (199.1,170.11) ;
\draw [shift={(199.1,170.11)}, rotate = 539.54] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (98.99,155.26) -- (120.79,126.74) ;
\draw [shift={(120.79,126.74)}, rotate = 487.39] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\draw (132.82,36.74) -- (132.82,65.51)(132.82,73.51) -- (132.82,95.26) ;
\draw [shift={(132.82,95.26)}, rotate = 270] [color=black] (0,0) .. controls (3.31,-0.3) and (6.95,-1.4) .. (10.93,-3.29)(0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
\end{tikzpicture}
\end{document}