2

I can't make tkz-fct to produce the drawing of function. I have the impression it is caused by a recent update i made with tlmgr.

Gnuplot is working fine and I compile using --enable-write18.

Here is a mwe (this is just the test from the tkz-fct doc).

\documentclass{scrartcl}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-fct}
\begin{document}
\begin{tikzpicture}[scale=1.25]
\tkzActivOff
\tkzInit[xmin=-5,xmax=5,ymax=2]
\tkzGrid
\tkzAxeXY
\tkzFct[color=red]{2*x**2/(x**2+1)}
\tkzActivOn
\end{tikzpicture}
\end{document}

And here is the log I get

(c:/texlive/2019/texmf-dist/tex/latex/jknapltx/ursfs.fd
File: ursfs.fd 1998/03/24 rsfs font definition file (jk)
) ( FP-EVAL ( FP-UPN
! Undefined control sequence.
<argument> \@xa 

l.11 \tkzFct[color=red]{2*x**2/(x**2+1)}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! I don't know how to \FP@upn[].
\erroraction ... don't know how to \string #1[#2]}

l.11 \tkzFct[color=red]{2*x**2/(x**2+1)}

This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

! FP error: UPN stack is empty!.
\FP@errmessage #1->\errmessage {FP error: #1!}

l.11 \tkzFct[color=red]{2*x**2/(x**2+1)}

(That was another \errmessage.)

) ) ( FP-EVAL ( FP-UPN
! Undefined control sequence.
<argument> \@xb 

l.11 \tkzFct[color=red]{2*x**2/(x**2+1)}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! I don't know how to \FP@upn[].
\erroraction ... don't know how to \string #1[#2]}

l.11 \tkzFct[color=red]{2*x**2/(x**2+1)}

(That was another \errmessage.)

! FP error: UPN stack is empty!.
\FP@errmessage #1->\errmessage {FP error: #1!}

l.11 \tkzFct[color=red]{2*x**2/(x**2+1)}

(That was another \errmessage.)

) ) ( FP-DIV ) ( FP-DIV ) [1

{c:/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux) ) 
Here is how much of TeX's memory you used:
 28903 strings out of 492162
 603961 string characters out of 6129063
 752124 words of memory out of 5000000
 32871 multiletter control sequences out of 15000+600000
 535571 words of font info for 36 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 82i,7n,99p,10139b,861s stack positions out of 5000i,500n,10000p,200000b,80000s
<
c:/texlive/2019/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb><c:/texliv
e/2019/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><c:/texlive/2019/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb>
Output written on test.pdf (1 page, 25654 bytes).
PDF statistics:
 23 PDF objects out of 1000 (max. 8388607)
 16 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 13 words of extra memory for PDF output out of 10000 (max. 10000000)
  • Honestly, I found that TikZ is more convernient to draw graph of functions than tkz-fct. In this case, one may try \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw[gray!50] (-5,0) grid (5,2); \draw[->] (-5.5,0)--(5.5,0) node[below]{$x$}; \draw[->] (0,0)--(0,2.5) node[left]{$y$}; \draw[red,smooth] plot[domain=-5:5] (\x,{2*\x*\x/(1+\x*\x)}); \foreach \i in {-5,...,5} \path (\i,0) node[below]{$\i$}; \end{tikzpicture} \end{document} – Black Mild Feb 2 at 18:22
  • An update of tkz-fct is ready but I've been asked to provide the source of my documentation. I have to provide an update of the tkz-doc class for this source to compile. I will put the file on my site in a few minutes. altermundus.fr/includes/fichiers.php – Alain Matthes Feb 2 at 18:25
  • 1
    @BlackMild tkzf-fct uses TikZ and gnuplot. It's only to avoid a lot of code repetition when you have a lot of functions to trace. The package is more specialized – Alain Matthes Feb 2 at 18:52
  • @AlainMatthes Thanks for your information. I got your point now! – Black Mild Feb 2 at 19:28
9

yes you are right. The new version of tkz-base is incompatible with the version of tkz-fct.sty. There was a small problem uploading the new file on CTAN. You will have to wait a while before you can find the package on CTAN. Currently you will find the file v1.2 here

I think \tkzActivOff is no longer necessary with the latest version of TikZ.

\documentclass{standalone}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-fct}
\begin{document}
\begin{tikzpicture}[scale=1.25]
%\tkzActivOff
\tkzInit[xmin=-5,xmax=5,ymax=2]
\tkzGrid
\tkzAxeXY
\tkzFct[color=red]{2*x**2/(x**2+1)}
%\tkzActivOn
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.