答案1
我可以重现你的问题:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\begin{align}
\begin{tikzcd}
\{0\}\arrow{r}{a}&A_1\arrow{r}{f_1}&A_2\arrow{r}{f_2}&\text{...}\arrow{r}{f_{k-1}}&A_k\arrow{r}{f_k}&...
\end{tikzcd}
\end{align}
\end{document}
但是,在此示例上运行 LaTeX 会产生 26 条错误消息!
- 切勿
align
用于单个方程 - 如果您嵌套
tikzcd
在align
环境中(很少需要),请使用ampersand replacement
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\begin{equation}
\begin{tikzcd}
\{0\}\arrow[r,"a"] &
A_1\arrow[r,"f_1"] &
A_2\arrow[r,"f_2"] &
\dotsb
\arrow[r,"f_{k-1}"] &
A_k\arrow[r,"f_k"] &
\dotsb
\end{tikzcd}
\end{equation}
\begin{align}
&\begin{tikzcd}[ampersand replacement=\&]
\{0\}\arrow[r,"a"] \&
A_1\arrow[r,"f_1"] \&
A_2\arrow[r,"f_2"] \&
\dotsb
\arrow[r,"f_{k-1}"] \&
A_k\arrow[r,"f_k"] \&
\dotsb
\end{tikzcd}
\\
&\begin{tikzcd}[ampersand replacement=\&]
\{0\}\arrow[r,"a"] \&
A_1\arrow[r,"f_1"] \&
A_2\arrow[r,"f_2"] \&
\dotsb
\arrow[r,"f_{k-1}"] \&
A_k\arrow[r,"f_k"] \&
\dotsb
\end{tikzcd}
\end{align}
\end{document}
注意\dotsb
箭头的首选语法。