我正在使用包\usepackage{tikz-cd}
。请注意,此代码运行良好:
\documentclass{amsart}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
& D \arrow[d,"f"] \arrow[dl, dashrightarrow, "F"'] \\
M \arrow[r,"\phi"] & N
\end{tikzcd}
\end{document}
但我正在另一个项目中工作,也使用\documentclass{amsart}
相同的包。但当我将相同的代码放在两者之间时,tikzcd
出现了编译错误,它显示:
Argument of \language@active@arg" has an extra }.
<inserted text>
\par
l.309 \end{tikzcd}
但我正在编写已在其他项目上运行的相同代码……
编辑:我添加了语法\usetikzlibrary{babel}
,然后又切换了语法。我写了这个例子(这个应该可以,因为它来自 LaTeX 教程tikzcd
):
\begin{tikzcd}
A \arrow{d} \arrow{r}[near start]{\phi}[near end]{\psi}
& B \arrow[red]{d}{\xi} \\
C \arrow[red]{r}[blue]{\eta}
& D
\end{tikzcd}
现在出现了新的错误:
Package tikz-cd Error: Diagrams cannot be nested.
See the tikz-cd package documentation for explanation.
Type H <return> for immediate help
...
l.304 I think the culprit is a tikzcd arrow in cell 1-1.
\errmessage ...currentrow -\tikzcd@currentcolumn }
答案1
这在我的 TeX Live 2015 上编译得很好
\documentclass{amsart}
\usepackage[danish]{babel}
\usepackage{tikz-cd}
\usetikzlibrary{babel}
\begin{document}
\begin{tikzcd}
& D \arrow[d,"f"] \arrow[dl, dashrightarrow, "F"'] \\
M \arrow[r,"\phi"] & N
\end{tikzcd}
\begin{tikzcd}
A \arrow{d} \arrow{r}[near start]{\phi}[near end]{\psi}
& B \arrow[red]{d}{\xi} \\
C \arrow[red]{r}[blue]{\eta}
& D
\end{tikzcd}
\end{document}