1

I'm running into troubles when mixing Babel French and tikz-qtree. Here is a minimal non-working example :

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{tikz,tikz-qtree}
\usetikzlibrary{arrows,arrows.meta}

\begin{document}

    \begin{tikzpicture}
    \Tree [.CP [.NP \node(wh){what}; ]
    [.C$'$ [.I did ]
    [.\node[draw]{IP};
    [.NP [.Det the ] [.N cat ] ]
    [.VP [.V sit ]
    [.PP [.P on ]
    [.\node[draw]{NP};
    [.NP [.Det a ] [.N book ] ]
    [.PP [.P about ] [.NP \node(t){$t$}; ] ] ] ] ] ] ] ]
    \draw[semithick,->] (t)..controls +(south west:5) and +(south:5)..(wh);
    \end{tikzpicture}

\end{document}

The error is :

Runaway argument?
(wh){what}; ] [.C$'$ [.I did ] [.\node [draw]{IP}; [.NP [.Det the ] [\ETC.
! Paragraph ended before \@@@@litlabel was complete.
<to be read again> 
                   \par 
l.22 

Removing the Babel declaration, or switching the french option to german, allow the code to compile. Spanish also causes troubles, with a different error :

! Argument of \language@active@arg> has an extra }.
<inserted text> 
                \par 
l.20    \draw[semithick,->]
                          (t)..controls +(south west:5) and +(south:5)..(wh);

I've read this question, related to trouble between TikZ/tikzmark and Babel/French and tried to apply the proposed patch, with no success (but I had no more success with the code given in this thread that caused troubles : may be I'm doing things the wrong way...).

Could someone help ? Thanks a lot in advance.

1st edit : I've just realized that this question offers a solution. Putting \shorthandoff{;} at the start of the tikzpicture environment allows the document to compile. It's quite strange as the question is quite old now (almost 4 years) and I've recently updated my TeXlive distribution to the 2016 version (it was yesterday ! so it is supposed to be up to date !).

natsirt
  • 635
  • Add also \usetikzlibrary{babel} – egreg Nov 06 '16 at 21:03
  • Thanks. I wasn't aware of the existence of such a TikZ library. And it's the 1st occurence where I need it ! TikZ is definetely too enormous to be quickly mastered... – natsirt Nov 06 '16 at 21:09
  • Don't worry! The site is here just for solving problems! This one had already appeared, but it's not easy to search for such an issue. – egreg Nov 06 '16 at 21:19

0 Answers0