I want to draw a function using pkz-fct and to save the picture with a "savebox" here is a minimal example :
\documentclass[a4paper,10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{tkz-fct}
\usepackage{graphicx}
\usepackage[frenchb]{babel}
\begin{document}
Test :
\newsavebox{\imgA}
\savebox{\imgA}{\begin{tikzpicture}
\tkzInit[xmin=-1.,xmax=3.,ymin=-3, ymax=1.5]
\tkzSetUpPoint[shape=circle, size = 3, color=black, fill=lightgray]
\tkzGrid[sub]
\tkzAxeXY
% \tkzFct[line width=1pt, color=blue, domain=-2:4]{(-2.)*(x-1.)**2-1.} % not working with Babel
\tkzFct[line width=1pt, color=blue]{(-2.)*(x-1.)**2-1.} % working with Babel
\tkzText[draw,fill = brown!20](2,1){$\Delta<0$}
\end{tikzpicture}}
\usebox{\imgA}
\end{document}
I don't know where exactly the problem is, but the document doesn't compile if i use simultaneously babel + (domain in tkzFct) inside a savebox environment.
Can anybody help ? (the error is the same when using a tabular environment instead of savebox)
Thanks in advance.
Here is part of log :
! Argument of \pgfkeys@code has an extra }.
<inserted text>
\par
l.28 \end{tikzpicture}}
Runaway argument?
\tkz@bb ]function{((-2.)*(x-1.)**2-1.)/\tkz@init@ystep };\end {scope}\ETC.
! Paragraph ended before \pgfkeys@code was complete.
<to be read again>
\par
l.28 \end{tikzpicture}}
! Extra }, or forgotten \endgroup.
<recently read> }
l.28 \end{tikzpicture}}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing } inserted.
<inserted text>
}
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing } inserted.
<inserted text>
}
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.30 \end{document}
! Missing } inserted.
<inserted text>
}
l.30 \end{document}
[1{/home/test/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux) )
(\end occurred when \ifcsname on line 28 was incomplete)
(\end occurred when \ifx on line 28 was incomplete)
(\end occurred when \ifx on line 28 was incomplete)
(see the transcript file for additional information){/home/test/texlive/2014/
texmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.enc}</home/test/texlive/2014/
texmf-dist/fonts/type1/public/cm-super/sfrm1000.pfb>
Output written on test.pdf (1 page, 11207 bytes).
Transcript written on test.log.
[french]{babel}makes:active. There are different solutions to this problem. One is to use\usetikzlibrary{babel}, the other is to put\shorthandoff{:;!?}insidetikzpicture. You can search for "babel+tikz+problem". – Kpym Jun 27 '15 at 13:24