summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-06-14 23:12:09 +0000
committerKarl Berry <karl@freefriends.org>2008-06-14 23:12:09 +0000
commit1b839cac605520b4304daee2b100f17d559d70fd (patch)
tree69387c208249272ddf9b844ebb69407b0c26d905 /Master/texmf-dist/tex
parent9730d4afc5aab909a3458657d73cba817cf1e3da (diff)
pst-func update (14jun08)
git-svn-id: svn://tug.org/texlive/trunk@8736 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/pst-func/pst-func.tex73
1 files changed, 66 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
index 04f571e2014..b1a9af308f5 100644
--- a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
+++ b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
@@ -1,3 +1,4 @@
+%% $Id: pst-func.tex 16 2008-03-02 16:51:07Z herbert $
%%
%% This is file `pst-func.tex',
%%
@@ -28,8 +29,8 @@
% interface to the `xkeyval' package
\pst@addfams{pst-func}
-\def\fileversion{0.52}
-\def\filedate{2008/03/21}
+\def\fileversion{0.55}
+\def\filedate{2008/06/12}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -311,16 +312,18 @@
}
%
\define@key[psset]{pst-func}{PSfont}{\def\psk@PSfont{/#1 }}
-\define@key[psset]{pst-func}{valuewidth}{\def\psk@valuewidth{#1 }}
-\define@key[psset]{pst-func}{fontscale}{\def\psk@fontscale{#1 }}
-\psset[pst-func]{PSfont=Times-Roman,fontscale=10,valuewidth=10}
+\define@key[psset]{pst-func}{valuewidth}{\pst@getint{#1}\psk@valuewidth }
+\define@key[psset]{pst-func}{fontscale}{\pst@checknum{#1}\psk@fontscale }
+\define@key[psset]{pst-func}{decimals}{\pst@getint{#1}\psk@decimals }
+\psset[pst-func]{PSfont=Times-Roman,fontscale=10,valuewidth=10,decimals=-1}
%
\def\psPrintValue{\pst@object{psPrintValue}}
\def\psPrintValue@i#1{%
\begin@SpecialObj
\addto@pscode{
gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
- #1 \psk@valuewidth string cvs 0 0 moveto show grestore
+ #1 \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if
+ \psk@valuewidth string cvs 0 0 moveto show grestore
}%
\end@SpecialObj%
}
@@ -743,6 +746,7 @@
\ignorespaces%
}
\def\tx@BezierShowPoints{ tx@Dict begin /Points ED BezierShowPoints end }
+\def\tx@BezierCurve{ tx@FuncDict begin BezierCurve Points end }
\def\pst@BezierType{2 } % the default
%
\def\psBezier#1{% % allowed order is 1 ... 9
@@ -758,11 +762,66 @@
\addto@pscode{%
\psk@plotpoints % step for Bezier T=0,0+epsilon,0+i*epsilon,...,1
\pst@BezierType % type of the Bezier curve 2,3,4,...
- tx@FuncDict begin BezierCurve Points end
+ \tx@BezierCurve
\ifshowpoints \tx@BezierShowPoints \else pop \fi
}%
\end@OpenObj}
%
+\def\tx@Bernstein{ tx@FuncDict begin Bernstein end }
+\define@boolkey[psset]{pst-func}[Pst@]{envelope}[true]{}
+\psset[pst-func]{envelope=false}
+%
+\def\psBernstein{\pst@object{psBernstein}}% \psBernstein[options](t1,t2)(i,n)
+\def\psBernstein@i(#1,#2){%
+ \@ifnextchar({\psBernstein@ii(#1,#2)}{\psBernstein@ii(0,1)(#1,#2)}}
+%
+\def\psBernstein@ii(#1,#2)(#3,#4){% (tStart,tEnd)(i,n)
+ \addbefore@par{plotpoints=200}%
+ \begin@OpenObj
+ \addto@pscode{%
+ /ScreenCoor { \tx@ScreenCoor } def
+ #1\space #2\space
+ 1.0 \psk@plotpoints\space div % step=1/plotpoints
+ #3\space #4\space
+% on stack we have tStart tEnd epsilon i n
+ \ifPst@envelope true \else false \fi
+ \tx@Bernstein
+ }%
+ \end@OpenObj}
+%
+\def\psThomae{\pst@object{psThomae}}
+\def\psThomae@i(#1,#2)#3{%
+ \addbefore@par{dotsize=1pt}
+ \begin@ClosedObj
+ \addto@pscode{
+ 1 1 #3 {
+ dup
+ /ipSave ED % save loop value
+ /ip ED % dito
+ 1 1 #3 {
+ dup
+ /iqSave ED % sabve loop value
+ /iq ED % dito
+ {
+ iq 0 le { exit } if
+ ip iq mod
+ /ip iq def
+ /iq ED
+ } loop
+ ip 1 eq {
+ /xVal ipSave iqSave div def
+ xVal #1 ge { xVal #2 le {
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ \pst@usecolor\pslinecolor xVal 1 iqSave div \tx@ScreenCoor
+ 2 copy moveto Dot } if } if
+ } if
+ } for
+ } for
+ }%
+ \end@ClosedObj%
+}
+%
%
\catcode`\@=\PstAtCode\relax
%