無法從 xy-pic 參考中取得 2 單元的範例以進行工作

無法從 xy-pic 參考中取得 2 單元的範例以進行工作

我正在嘗試從 xypic 參考手冊中重新建立範例 2 (http://mirrors.ctan.org/macros/generic/diagrams/xypic/doc/xyrefer.pdf第43頁)

\diagram
A\ruppertwocell^f{\alpha}
\rlowertwocell_h{\beta}
\rto_(.35)g & B\\
\enddiagram

在此輸入影像描述

我的第一個範例以以下方式工作,靈感來自自然變換箭頭

\documentclass{article}
\usepackage[all,cmtip,2cell]{xy}
\UseTwocells
\xyoption{2cell}
\begin{document}
$$
\xymatrix@C+2pc{
A \rtwocell<6>^{f}_{g}{\;\;\;\alpha} & B}
$$

\end{document}

但光貼第二個例子就給了我

! Undefined control sequence.
l.15 \diagram

並將 \diagram 更改為 \xymatrix@C+2pc{... 如上所述,給我:

...
(/usr/share/texlive/texmf-dist/tex/generic/xypic/xy2cell.tex
 Xy-pic option: Two-cell feature v.3.7 not reloaded) (./test2cells.aux)
<xymatrix 2x1 20> <xymatrix
! Undefined control sequence.
<argument> ...atall@ \everyentry@ A\ruppertwocell 
                                                  ^f{\alpha } \rlowertwocell...
l.19 \rto_(.35)g & B}
                     $$

讓它在 xy-pic 中工作的正確方法是什麼?我真的應該使用圖表包嗎?

答案1

文件說(就在第二張圖的上方:“漏洞:本文檔仍然使用版本 2 樣式的命令,如附錄 B 所述。

若要使用版本 2 指令\diagram,請包含\xyoption{v2}或提供套件選項v2。要使用半電池,請使用\UseAllTwoCells而不是僅\UseTwocells。並且請不要$$在 LaTeX 中使用。

\documentclass{article}
\usepackage[all,v2,cmtip,2cell]{xy}
\UseAllTwocells
\begin{document}

\[
\xymatrix@C+2pc{
A \rtwocell<6>^{f}_{g}{\;\;\;\alpha} & B}
\]

\diagram
A\ruppertwocell^f{\alpha}
\rlowertwocell_h{\beta}
\rto_(.35)g & B\\
\enddiagram

\end{document}

如果沒有 v2,第二張圖可以表示為

\xymatrix@C+2pc{
A\ruppertwocell^f{\alpha}
\rlowertwocell_h{\beta}
\ar[r]_(.35)g & B}

相關內容