I would like to declare functions in tikz for multiple uses of the same function within the code.
Sadly, it seems that the tikz "declare function" is not compatible with the french option in babel. Indeed, the following code (that I simplifed on purpose) runs fine :
\documentclass[english]{article}
\usepackage{babel}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\tikzset{declare function={Carre(\t)=\t*\t;}}
\draw plot [domain=-1:1] (\x,{Carre(\x)});
\end{tikzpicture}
\end{document}
But when I replace
\documentclass[english]{article}
with
\documentclass[english,french]{article}
compilation generates an error. This is what the log file says :
Missing character: There is no = in font nullfont! Missing character: There is no @ in font nullfont! Missing character: There is no @ in font nullfont!
Runaway argument? -1:1] (\x ,{Carre(\x )}); \end {tikzpicture} \end {document} ! Paragraph ended before \pgfmath@local@@functions was complete. \par l.18
I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best.
Before posting this, I updated all packages without success.
Any help welcome!