1

I am trying to create some diagrams using tikz-cd, but I get several errors the moment I add any label to the arrows. To be precise, this works fine:

\[
\begin{tikzcd}
G \arrow[r] \arrow[d] & G \cdot x \arrow[d] \\
G \arrow[r]                   & G \cdot x
\end{tikzcd}
\]

While this gives errors:

\[
\begin{tikzcd}
G \arrow[r, "a"] \arrow[d] & G \cdot x \arrow[d] \\
G \arrow[r]                   & G \cdot x
\end{tikzcd}
\]

The errors I get are the following

Incomplete \iffalse; all text was ignored after line 621. [\include{chapter1}]
Improper \prevdepth. [\include{chapter1}]
Missing \endcsname inserted. [\include{chapter1}]
You can't use `\relax' after \the. [\include{chapter1}]
Improper \prevdepth. [\clearemptydoublepage]
TeX capacity exceeded, sorry [input stack size=5000]. [\clearemptydoublepage]

I am using the babel package with the spanish language, which has given me problems with tikzcd before, but that does not seem to be the problem.

  • 1
    Please prepare a complete minimal working example (MWE) that allows others to reproduce the error message you get and that supposts the claim "babel package with the spanish language [...] that does not seem to be the problem." – leandriis Aug 08 '20 at 09:28
  • If I try to compile your code using \documentclass{article} \usepackage{tikz-cd} \usepackage[spanish]{babel} \usetikzlibrary{babel} \begin{document} \[ \begin{tikzcd} G \arrow[r, "a"] \arrow[d] & G \cdot x \arrow[d] \\ G \arrow[r] & G \cdot x \end{tikzcd} \] \end{document} I get the same error message as you. Commenting out the \usepackage[spanish]{babel} line results in no error messages. – leandriis Aug 08 '20 at 09:29
  • 1
    To make your code compilable using the spanish babel option, add \usetikzlibrary{babel} as in \documentclass{article} \usepackage{tikz-cd} \usepackage[spanish]{babel} \usetikzlibrary{babel} \begin{document} \[ \begin{tikzcd} G \arrow[r, "a"] \arrow[d] & G \cdot x \arrow[d] \\ G \arrow[r] & G \cdot x \end{tikzcd} \] \end{document}. – leandriis Aug 08 '20 at 09:29
  • Commenting out the babel package didn't seem to work, that is why I said that the error was not related. However, the \usetikzlibrary{babel} has solved the problem, thank you very much :) – Eduardo de Lorenzo Aug 08 '20 at 09:33
  • @leandriis most of the time people thinks that error is not babel-related because even if you comment the babel line, you have to remove the .aux file to eliminate the error. Using the babel TikZ library works most of the times, but in this age of UTF8 my options is using shorthands=off in the babel invocation and be happy... more or less. – Rmano Aug 08 '20 at 10:40
  • Related: https://tex.stackexchange.com/questions/314884/babel-active-chars-ifthenelse-and-tikz – Rmano Aug 08 '20 at 10:42
  • To the OP: take into account these two issues, that I think are still not fixed: https://github.com/jbezos/babel-spanish/issues/7 and https://github.com/jbezos/babel-spanish/issues/6, so the best way to use babel en Spanish is \usepackage[english, spanish, es-noshorthands, shorthands=off]{babel} (@leandriis if you are interested... ;-) ) – Rmano Aug 08 '20 at 10:45
  • 5
    I’m voting to close this question because it has been solve with the comments. – Sebastiano Sep 20 '20 at 19:25

0 Answers0