我正在练习 LaTex 技能,以完成图解代数的输出。我一开始表现不错,很快就掌握了tikz-cd
软件包。我写完了一个相当长的构造,想编译它(我使用的是 Texmaker)。代码如下:
\documentclass[a4paper]{report}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{amssymb}
\usepackage{amsxtra}
\usepackage{amscd}
\usepackage{amsopn}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fullpage}
\usepackage{slashed}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{mathdots}
\usepackage{mathrsfs}
\usepackage{tikz-cd}
\begin{document}
\setlength{\parindent}{0cm}
\[
\begin{tikzcd}
0 \arrow[r] & \mathcal{C}^{\infty , 0} \arrow[r, "\mathrm{grad}"] & \Lambda^{1,0} \arrow[r, "\mathrm{iot}"] & \Lambda^{1,-1} \arrow[r, "-\mathrm{div}"] & \mathcal{C}^{\infty , -3} \arrow[r] & 0 \\
0 \arrow[r] & \Lambda^{1,2} \arrow[u, "X(\xi, \cdot)"] \arrow[r, "CK"] & \Sigma^{2,2} \arrow[u, "i(\xi; \cdot)"] \arrow[r, "\frac{1}{2}H"] & \Sigma^{2,-1} \arrow[u, "\xi \lrcorner \cdot"] \arrow[r, "-\mathrm{Div}"] & \Lambda^{1,-3} arrow[u, "\xi \lrcorner \cdot"] \arrow[r] & 0 \\
0 \arrow[r] & \mathcal{C}^{\infty,0} \arrow[u, "\xi \otimes \cdot"] \arrow[r, "\mathrm{grad}"] & \Lambda^{1,0} \arrow[u, "\tau(\xi \otimes \cdot)"] \arrow[r, "\mathrm{iot}"] & \Lambda^{1,-1} \arrow[u, "BY(\xi ; \cdot)"] \arrow[r, "-\mathrm{div}"] & \mathcal{C}^{\infty, -3} \arrow[u, "j(\xi, \cdot)"] \arrow[r] & 0
\end{tikzcd}
\]
\end{document}
当我尝试编译代码时,出现以下错误:
! Missing \endcsname inserted.<to be read again>\cdot\end{tikzcd}
我真的很绝望。我仔细检查了代码中的错误,在不同的论坛上寻找答案,但都是徒劳。有人能帮我吗?我提前感谢你们(好心的陌生人)。
答案1
\
您之前忘了一个arrow
,有时忘记用和包围,
以{
防止}
tikz 解释,
。以下是更正后的代码,因此可以编译:
\documentclass[a4paper]{report}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{amssymb}
\usepackage{amsxtra}
\usepackage{amscd}
\usepackage{amsopn}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fullpage}
\usepackage{slashed}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{mathdots}
\usepackage{mathrsfs}
\usepackage{tikz-cd}
\begin{document}
\setlength{\parindent}{0cm}
\[
\begin{tikzcd}
0 \arrow[r] & \mathcal{C}^{\infty , 0} \arrow[r, "\mathrm{grad}"] & \Lambda^{1,0} \arrow[r, "\mathrm{iot}"] & \Lambda^{1,-1} \arrow[r, "-\mathrm{div}"] & \mathcal{C}^{\infty , -3} \arrow[r] & 0 \\
0 \arrow[r] & \Lambda^{1,2} \arrow[u, "X(\xi{,} \cdot)"] \arrow[r, "CK"] & \Sigma^{2,2} \arrow[u, "i(\xi; \cdot)"] \arrow[r, "\frac{1}{2}H"] & \Sigma^{2,-1} \arrow[u, "\xi \lrcorner \cdot"] \arrow[r, "-\mathrm{Div}"] & \Lambda^{1,-3} \arrow[u, "\xi \lrcorner \cdot"] \arrow[r] & 0 \\
0 \arrow[r] & \mathcal{C}^{\infty,0} \arrow[u, "\xi \otimes \cdot"] \arrow[r, "\mathrm{grad}"] & \Lambda^{1,0} \arrow[u, "\tau(\xi \otimes \cdot)"] \arrow[r, "\mathrm{iot}"] & \Lambda^{1,-1} \arrow[u, "BY(\xi ; \cdot)"] \arrow[r, "-\mathrm{div}"] & \mathcal{C}^{\infty, -3} \arrow[u, "j(\xi{,} \cdot)"] \arrow[r] & 0
\end{tikzcd}
\]
\end{document}