1

I am using tikz-cd for the first time, trying to create a rather simple commutative diagram. This is the first part of the diagram I am trying to get to render:

\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}

Unfortunately, as soon as I add the labels to the arrows (the things in quotes), the diagram is not rendered. I just get a bunch of errors, starting with

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}

and then repeating

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

a bunch of times. It works fine without arrow labels, but I definitely need those. What am I doing wrong here?

In case you might need it, these are the packages I currently use:

\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
  • 2
    Try adding \usetikzlibrary{babel} after \usepackage{tikz-cd} and check if the problems disappear.
    – user194703
    Apr 25, 2020 at 21:44

1 Answer 1

2

I confirm the problem without \usetikzlibrary{babel}, and it is solved by adding \usetikzlibrary{babel}, which makes the quotes library coexist with \usepackage[ngerman]{babel} (in this case). Some of the packages you are loading you do not need to load explicitly because they get loaded anyway.

\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}

enter image description here

1
  • Thanks, this solved the issue. I already suspected this to be the cause but didn't find any hints about that in the tikz-cddocumentation.
    – Strupp1
    Apr 26, 2020 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .