当箭头上有标签时,不会呈现“tikz-cd”图

当箭头上有标签时,不会呈现“tikz-cd”图

这是我第一次使用它tikz-cd,试图创建一个相当简单的交换图。这是我尝试渲染的图表的第一部分:

\begin{tikzcd}
    R \arrow[r, "T_R"] & T_R\left(R\right) \arrow[r, "G", dashed] & T_S\left(S\right) & S \arrow[l, "T_S"']
\end{tikzcd}

不幸的是,当我将标签添加到箭头(引号中的内容)时,图表无法呈现。我只是得到了一堆错误,首先是

pdflatex.exe> ! Argument of \language@active@arg" has an extra }.
pdflatex.exe> <inserted text> 
pdflatex.exe>                 \par 
pdflatex.exe> l.527             \end{tikzcd}
pdflatex.exe>                      
pdflatex.exe> Runaway argument?
pdflatex.exe> ! Paragraph ended before \language@active@arg" was complete.
pdflatex.exe> <to be read again> 
pdflatex.exe>                    \par 
pdflatex.exe> l.527             \end{tikzcd}

然后重复

pdflatex.exe> ! Missing \endcsname inserted.
pdflatex.exe> <to be read again> 
pdflatex.exe>                    \@@par 
pdflatex.exe> l.527             \end{tikzcd}

很多次。没有箭头标签也可以正常工作,但我肯定需要那些。我在这里做错了什么?

如果你需要的话,这些是我目前使用的软件包:

\documentclass[a4paper, 12pt, titlepage, twoside]{article} %TODO: Remove draft

% LOADING PACKAGES
\usepackage[utf8]{inputenc} %Encoding
\usepackage[ngerman]{babel} %language
\usepackage{csquotes} %Needed by babael/biblate}
\usepackage{microtype}
\usepackage[backend=biber, safeinputenc, backref=true, hyperref=auto, style=alphabetic]{biblatex}% bibliography
\usepackage{enumitem} %Easier enumeration item labelling
%\usepackage{cmap}
\usepackage{mathtools} %Better colon-equal alignment
\usepackage{amsmath} %Math tools
\usepackage{amsthm, thmtools} %Theorem tools
\usepackage{chngcntr} %Automatically reset equation numbering in new sections
\usepackage{amssymb} %special symbols
\usepackage{interval} %Nicer and simpler intervals
\usepackage{braket} %nice left & right <.,.> brackets and sets
\usepackage[pdftex, colorlinks=true, urlcolor=blue]{hyperref} %Linking
\usepackage{graphicx} %Images
%\usepackage{wrapfig}
\usepackage{geometry} %Lines
%\usepackage{setspace} 
\usepackage{multicol} %Title page multicolumn
\usepackage{titling} %Titling
\usepackage{xcolor} %Coloring (may be removed once colored text is removed) TODO
\usepackage{tikz-cd} %Kommutative Diagramme

答案1

我确认没有 的问题\usetikzlibrary{babel},并通过添加 解决了该问题\usetikzlibrary{babel},这使得quotes库与 共存\usepackage[ngerman]{babel}(在本例中)。您正在加载的某些软件包不需要显式加载,因为它们无论如何都会被加载。

\documentclass[a4paper, 12pt, titlepage, twoside]{article} %TODO: Remove draft

% LOADING PACKAGES
\usepackage[utf8]{inputenc} %Encoding
\usepackage[ngerman]{babel} %language
\usepackage{csquotes} %Needed by babael/biblate}
\usepackage{microtype}
\usepackage[backend=biber, safeinputenc, backref=true, hyperref=auto, style=alphabetic]{biblatex}% bibliography
\usepackage{enumitem} %Easier enumeration item labelling
%\usepackage{cmap}
\usepackage{mathtools} %Better colon-equal alignment
\usepackage{amsmath} %Math tools
\usepackage{amsthm, thmtools} %Theorem tools
\usepackage{chngcntr} %Automatically reset equation numbering in new sections
\usepackage{amssymb} %special symbols
\usepackage{interval} %Nicer and simpler intervals
\usepackage{braket} %nice left & right <.,.> brackets and sets
\usepackage[pdftex, colorlinks=true, urlcolor=blue]{hyperref} %Linking
% \usepackage{graphicx} %Images gets loaded by tikz, which gets loaded by tikz-cd
%\usepackage{wrapfig}
\usepackage{geometry} %Lines
%\usepackage{setspace} 
\usepackage{multicol} %Title page multicolumn
\usepackage{titling} %Titling
% \usepackage{xcolor} %Coloring (may be removed once colored text is removed) TODO
% ^^^ also gets loaded by tikz
\usepackage{tikz-cd} %Kommutative Diagramme
\usetikzlibrary{babel}% added
\begin{document}
\begin{tikzcd}
    R \arrow[r, "T_R"] & T_R\left(R\right) \arrow[r, "G", dashed] & T_S\left(S\right) & S \arrow[l, "T_S"']
\end{tikzcd}
\end{document}

在此处输入图片描述

相关内容