[OS X TeX] TKZplot2d for tikz/pgf problem.

Alain Matthes alain.matthes at mac.com
Mon May 14 16:19:25 CEST 2007


Le 14 mai 07 à 09:32, Frank STENGEL a écrit :

>
> I looked at tkz-plot2d.sty and found your problem stems from the  
> fact that the 1/exp(1) is not evaluated, but used as if it were a  
> floating point number. If I replace line 162 of tkz-plot2d.sty  
> (inside \tkz at fctpt's definition) by
>
> \FPeval\x{#2}%
>
> then everything works fine. One should look if some of the other  
> \FPset shouldn't be changed to \FPeval

1) with \FPeval\x{#2}%

here :

\newcommand*{\tkzfctpt}[1][]{\tkz at fctpt[#1]}%

\def\tkz at fctpt[#1](#2,#3)#4{
\setkeys[TKZ]{tkzpt}{#1}%
%\FPeval{\@x}{#2}
\FPeval\x{#2}<------------ eval
\FPeval\y{#3}
\tkz at pt[#1](\x,\y){#4}
}

and here

\newcommand*{\tkztg}[1][]{\tkz at tg[#1]}%
\def\tkz at tg[#1]#2(#3){
\setkeys[TKZ]{tan}{#1}%
\FPmul{\krx}{\cmdTKZ at tan@kr}{\xunit}
\FPmul{\kry}{\cmdTKZ at tan@kr}{\yunit}
\FPmul{\klx}{\cmdTKZ at tan@kl}{\xunit}
\FPmul{\kly}{\cmdTKZ at tan@kl}{\yunit}
\FPeval\x{#3}%<------------ eval

\FPeval\y{#2}
\tkzpt[noname](\x,\y){tkz at A}
\FPeval\xx{#3}%<------------ eval

and with this example

\begin{tikzpicture}[scale=2,line width=0.8pt]
  \tkzinit[xmin=-3,xmax=4,ymin=-4,ymax=2]
  \tikzstyle{tangstyle}=[-]
  \tkzgrid(-3,-4)(4,2)
  \tkzx \tkzy
  \tkzfct[lw=1.2pt](-2.15..3.2){(-x*x)+2*x}
  \tkzfctpt(2,\tkzfcta){B}
  \tkzfctpt[type=$\bullet$](0,\tkzfcta){O}
  \tkzfctpt[type=$\bullet$]((-1),\tkzfcta){A}%<-- !!!
  \tkzfctpt[type=$\bullet$](2,\tkzfcta){C}
  \tkzfctpt[type=$\bullet$](1,\tkzfcta){B}
  \tkzfctpt[type=$\bullet$](3,\tkzfcta){D}
  \tkztg[kl=.5,kr=.5]\tkzfcta(0)
  \tkztg[kl=0]{\tkzfcta}({(-1)})%<------------- !!!
  \tkztg\tkzfcta(2)
  \tkztg[kr=0]\tkzfcta(3)
  \tkztg\tkzfcta(1)
  \rep
\end{tikzpicture}

You need to make this
\tkzfctpt[type=$\bullet$]((-1),\tkzfcta){A}

because -1 give an error (-1) is necessary

idem here

\tkztg[kl=0]{\tkzfcta}({(-1)})%

{(-1)}) I don't like this hack

2) in the doc you need to know that sizept is not any more one option
  of tkzinit

and xstep and ystep  are not any more options of tkzgrid with the  
option sub
, xstep and ystep are the values defined in tkzinit.


Greetings Alain



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list