I was trying to make a commutative diagram using something like \arrow[r, "A"]
at some point, and I kept getting weird errors. I finally found out that I got no errors if I removed "dutch" from \usepackage[dutch, english]
. Alternatively, I can get it to work by enclosing the tikzcd environment with \shorthandoff{"}...\shorthandon{"}
. Apparently, something in "dutch" clashes with the use of " in \arrow[r, "A"]
. Two questions.
What is exactly the clash here? What is "predefined" or whatever in the dutch option in babel that does not like the use of "" in the arrow command?
Is there a nicer solution to this problem? The only thing I can think of is to redefine the tikzcd environment to be something like
\shorthandoff{"}\begin{tikzcd}...\end{tikzcd}\shorthandon{"}
This is really just wrapping the earlier inelegant solution in a large blanket, so I'm not a fan.
Loading tikzlibrary{babel} solves the issue if one does not wrap the tikzcd in an align environment (and there is not a good reason to do this). I'm still curious what exactly align messes up here, though.
After all, a MWE. I do something like this.
\documentclass{report}
\usepackage[a4paper]{geometry}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dutch, english]{babel}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{cd}
\usetikzlibrary{babel}
\begin{document}
\begin{align*}
\begin{tikzcd}[ampersand replacement = \&]
A \arrow[r, "A"] \& B
\end{tikzcd}
\end{align*}
\end{document}
\usepackage[dutch]{babel}
probably makes"
an active character. Did you try\usetikzlibrary{babel}
?\documentclass{article} \usepackage[dutch]{babel} \usepackage{tikz-cd} \usetikzlibrary{babel} \begin{document} \begin{tikzcd} A \arrow[rd] \arrow[r, "\phi"] & B \\ & C \end{tikzcd} \end{document}
. But since @BPasternak did not post a minimal working example, it is basically impossible to help without a crystal ball.