2

I'm trying to make a commutative diagram while using the spanish babel package but I'm encountering some problems.

I've made two MWE; one that doesn't work and one that does:

\documentclass{article}

\usepackage[spanish]{babel}
\usepackage{tikz-cd}

\begin{document}
   \begin{tikzcd}
   G \arrow[d, "\varepsilon"', two heads] \arrow[r, "\varphi"] & H \\
   G/N \arrow[ru, "\varphi"', dashed]                          &  
   \end{tikzcd}
\end{document}

and

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}
   \begin{tikzcd}
   G \arrow[d, "\varepsilon"', two heads] \arrow[r, "\varphi"] & H \\
   G/N \arrow[ru, "\varphi"', dashed]                          &  
   \end{tikzcd}
\end{document}

The former fails to work while the latter works just fine. The only difference being the spanish babel package. I really need to use both the package and the tikz-cd environment. Is there a way of doing so?

Here is a picture of the desired output (which is the result of the second piece of code). I want this while having the spanish babel package loaded.

commutative diagram

Edit: I just noticed that if I remove the names of the arrows (\varepsilon and \varphi) then it compiles just fine (I want to have those though).

0

2 Answers 2

4

Spanish babel makes " into an active character which kills \arrow[d, "\varepsilon"', two heads]

As this is quite common there is a tikz library to fix is, just add

\usetikzlibrary{babel}

after loading tikz-cd and the example compiles again

1

First, daleif's answer is the right way to do this. Then, this is a case in which the alternative syntax in the tikz-cd manual could be useful:

\documentclass{article}

\usepackage[spanish]{babel}
\usepackage{tikz-cd}

\begin{document}
   \begin{tikzcd}
   G\arrow[two heads]{d}[swap]{\varepsilon}\arrow{r}{\varphi} & H\\
   G/N\arrow[dashed]{ru}[swap]{\varphi}
   \end{tikzcd}
\end{document}

Produces:

enter image description here

as expected

You must log in to answer this question.

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