astoff / tikz-cd

Commutative diagrams with TikZ
46 stars 3 forks source link

Incompatibility with polyglossia #7

Closed Friedrich2 closed 5 years ago

Friedrich2 commented 5 years ago

During typesetting some Algebra solutions, I found an incompatibility of tikz-cd and polyglossia.

I am using XeLaTeX with an up-to-date MikTeX installation. The MWE attached demonstrates the problem: Comment out the two lines concerning polyglossia and the diagram is typeset correctly. Let it be and an error occurs (leading to the arrow label not being set):

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ifluatex.sty")
("C:\Program Files\MiKTeX 2.9\tex/generic/ifxetex\ifxetex.sty"))
("C:\Program Files\MiKTeX 2.9\tex/latex/polyglossia\gloss-german.ldf"
("C:\Program Files\MiKTeX 2.9\tex/latex/polyglossia\babelsh.def")) (MWE.aux)
ABD: EveryShipout initializing macros
! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

? 
[MWE.zip](https://github.com/astoff/tikz-cd/files/3458405/MWE.zip)

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

? s
OK, entering \scrollmode...
! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Package xcolor Error: Undefined color `"\phi "'.

See the xcolor package documentation for explanation.
Type  H <return>  for immediate help
...
l.7 I think the culprit is a tikzcd arrow in cell 1-1.
\errmessage ...currentrow -\tikzcd@currentcolumn }

l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Missing \endcsname inserted.
<to be read again> 
                   \phi 
l.9 \end{tikzcd}

! Argument of \@secondoffive has an extra }.
<inserted text> 
                \par 
l.9 \end{tikzcd}

Runaway argument?
! Paragraph ended before \@secondoffive was complete.
<to be read again> 
                   \par 
l.9 \end{tikzcd}

! Package xcolor Error: Undefined color `"\phi "'.

See the xcolor package documentation for explanation.
Type  H <return>  for immediate help
...
l.7 I think the culprit is a tikzcd arrow in cell 1-1.
\errmessage ...currentrow -\tikzcd@currentcolumn }

l.9 \end{tikzcd}

[1] (MWE.aux) )
(see the transcript file for additional information)
Output written on MWE.pdf (1 page).
SyncTeX written on MWE.synctex.gz.
Transcript written on MWE.log.

Greetings from Greifswald

PJ

astoff commented 5 years ago

This looks similar to the usual incompatibility with the babel package. What happens if you add \usetikzlibrary{babel} before loading polyglossia (but after loading tikz)?

Friedrich2 commented 5 years ago

Ouch -- A classical RTFM error. Together with disabling smart quoting (in Format menu of MikTeX), the problem was solved by embedding the proposed library.