我正在画一些图表,我想写下一些 2 单元格。我不确定如何以好的方式写下来。这是我对 xy 所做的:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish,shorthands=off]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[all]{xy}
\begin{document}
\begin{displaymath}
\begin{xy}
(0,0) *+{\mathcal{E}} = "e1",
(15,0) *+{\mathcal{E}} = "e2",
(30,0) *+{\mathcal{S}} = "s1",
(7.5,-10) *+{\mathcal{F}} = "f1",
(40,10) *+{\mathcal{E}} = "e3",
(70,0) *+{\mathcal{S}} = "s2",
(50,15) *+{\mathcal{F}} = "f2",
(65,10) *+{\mathcal{E}} = "e4",
(80,20) *+{\mathcal{F}} = "f3",
\POS "e1" \ar^{1_{\mathcal{E}}} "e2",
\POS "e1" \ar_{g^*} "f1",
\POS "f1" \ar_{g_*} "e2",
\POS "e2" \ar^{p_*} "s1",
\POS "f1" \ar@/_/_{f_*} "s1",
\POS "s1" \ar^{p^!} "e3",
\POS "e3" \ar_{p_*} "s2",
\POS "s1" \ar@/_/_{1_{\mathcal{S}}} "s2",
\POS "e3" \ar^{g^*} "f2",
\POS "f2" \ar^{g_*} "e4",
\POS "e4" \ar_{p_*} "s2",
\POS "f2" \ar@/^25pt/^{f_*} "s2",
\POS "f2" \ar@/^/^{1_{\mathcal{F}}} "f3",
\POS "s2" \ar@/_/_{f^!} "f3",
\POS "e2" \ar@/^10pt/^{1_{\mathcal{E}}} "e3",
%names of natural transformations
\POS (7.5,-2) \ar@{=>}_{\nu} (7.5,-6),
\POS (42,6) \ar@{=>}_{\varepsilon} (45,1),
\POS (57,11) \ar@{=>}_{(p_*\nu)^{-1}} (55,7),
\POS (73,16) \ar@{=>}^{\overline{\eta}} (73,10),
\POS (27,6) \ar@{=>}_{\eta} (29,2),
\end{xy}
\end{displaymath}
\end{document}
得到下图
如您所见,我已经“手动”绘制了 2 单元格。所以我想知道是否有更好的方法来绘制 xy 中的“复杂”图表,或者最好使用 tikz-cd 之类的东西。
提前致谢
答案1
我不知道什么是 2 单元图,但用 制作这样的图并不困难tikz-cd
。它确实使用矩阵来定位节点,但这对您的图来说不是问题。
大多数双线箭头都绘制在命名节点/边标签之间。唯一的例外是右上角的垂直箭头。它相对于其左侧的边标签(带有 的边标签f_{*}
)放置,使用库中的语法calc
。
\documentclass[border=5mm]{standalone}
\usepackage{tikz-cd}
\usepackage{amssymb}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzcd}[
execute at end picture={
\draw [/tikz/commutative diagrams/double line,-Implies] ($(f1)+(5mm,5mm)$) --node[right]{$\bar{\eta}$} ($(f1)+(5mm,-5mm)$);
}
]
&&&&&&&[-5mm]&[-5mm]
\mathcal{F} \\[-15pt]
% second row
&&&&&
\mathcal{E}
\arrow[rrru,bend left=5,"1_{\mathcal{F}}"]
\arrow[rd,"g_{*}"name=g1]
\arrow[rrdd,bend left=45,"f_{*}"name=f1]
&&& \\
%third row
&&&&
|[alias=e1]|\mathcal{E}
\arrow[ur,"g^{*}"]
\arrow[drrr,"p_{*}"{swap,name=p1}]
&&
\mathcal{E}
\arrow[dr,"p_{*}"swap]
&& \\
% fourth row
\mathcal{E}
\arrow[rr,"1_{\mathcal{E}}"name=1e]
\arrow[dr,"g_{*}"swap]
&&
\mathcal{E}
\arrow[rru,bend left=15,"1_{\mathcal{E}}"name=1e2]
\arrow[r,"p_{*}"]
&
|[alias=s1]|\mathcal{S}
\arrow[ur,"p^{!}"]
\arrow[rrrr,bend right=5,"1_{\mathcal{S}}"name=1s]
&&&&
\mathcal{S}
\arrow[ruuu,bend right=10,"f_1"swap]
& \\
% fifth row
&
|[alias=f2]|\mathcal{F}
\arrow[ur,"g_{*}"swap]
\arrow[urr,bend right=15,"f_{*}"swap]
&&&&&&&
% other arrows
\arrow[Rightarrow,from=g1, to=p1,shorten >=3mm,shorten <=3mm,"(p_{*}\nu)^{-1}"swap]
\arrow[Rightarrow,from=1e, to=f2,shorten >=1mm,shorten <=2mm,"\nu"swap]
\arrow[Rightarrow,from=1e2, to=s1,shorten >=0mm,shorten <=2mm,"\eta"swap]
\arrow[Rightarrow,from=e1, to=1s,shorten >=1mm,shorten <=2mm,"\eta"swap]
\end{tikzcd}
\end{document}