diff options
author | Karl Berry <karl@freefriends.org> | 2012-01-05 00:05:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-01-05 00:05:06 +0000 |
commit | 91d0ccfc5f09a20c00421ac832f11f8eab0e7d9e (patch) | |
tree | 65d5c17f1cc494011ad6aecdd3cf333851d0e2e1 /Master/texmf-dist/tex/generic | |
parent | 8ba3db84d0f54ff7d4a5de04d6e63b69131df760 (diff) |
new pstricks package pst-tools 0.01 (4jan12)
git-svn-id: svn://tug.org/texlive/trunk@25024 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex b/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex new file mode 100644 index 00000000000..a6e4cad0e72 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex @@ -0,0 +1,111 @@ +%% $Id: pst-tools.tex 599 2011-11-03 19:38:28Z herbert $ +%% +%% This is file `pst-tools.tex', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-tools.tex' +%% +%% Herbert Voss <hvoss@tug.org> +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `pst-tools' is a PSTricks package for helper functions +%% +%% +\csname PSTtoolsLoaded\endcsname +\let\PSTtoolsLoaded\endinput + +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey.tex \fi +% +\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax +% interface to the `xkeyval' package +\pst@addfams{pst-tools} +% +\def\fileversion{0.1} +\def\filedate{2012/01/01} +\message{`PST-tools' v\fileversion, \filedate\space (hv)} +% +\define@boolkey[psset]{pst-tools}[Pst@]{dot}[true]{} +\define@key[psset]{pst-tools}{xShift}[0]{\def\psk@xShift{#1}} +\define@key[psset]{pst-tools}{PSfont}[Times-Roman]{\def\psk@PSfont{/#1 }} +\define@key[psset]{pst-tools}{valuewidth}[10]{\pst@getint{#1}\psk@valuewidth } +\define@key[psset]{pst-tools}{fontscale}[10]{\pst@checknum{#1}\psk@fontscale } +\define@key[psset]{pst-tools}{decimals}[-1]{\pst@getint{#1}\psk@decimals } +\psset[pst-tools]{PSfont=Times-Roman,fontscale=10,valuewidth=10,decimals=-1,xShift=0,dot} +% +\def\psPrintValue{\pst@object{psPrintValue}} +\def\psPrintValue@i#1{\expandafter\psPrintValue@ii#1,,\@nil} +\def\psPrintValue@ii#1,#2,#3\@nil{% #1,#2 only for algebraic code + \begin@SpecialObj + \addto@pscode{ + gsave \psk@PSfont findfont \psk@fontscale scalefont setfont + \ifPst@algebraic + /x #1 def + /Func (#2) tx@AlgToPs begin AlgToPs end cvx def + Func + \else #1 \fi + \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if + \psk@valuewidth string cvs %/Output exch def % save output + \ifPst@dot dot2comma \fi % do we have to change dot to comma + \psk@xShift\space 0 moveto %Output + show grestore + }% + \end@SpecialObj% +} + +\define@boolkey[psset]{pst-tools}[Pst@]{round}[true]{}% +\define@boolkey[psset]{pst-tools}[Pst@]{science}[true]{% + \ifPst@science\def\psk@Scin{true }\else\def\psk@Scin{false }\fi} +\psset[pst-tools]{science=false,round=false} +\def\psPrintValueNew{\pst@object{psPrintValueNew}} +\def\psPrintValueNew@i#1{\expandafter\psPrintValueNew@ii#1,,\@nil} +\def\psPrintValueNew@ii#1,#2,#3\@nil{% #1,#2 only for algebraic code + \begin@SpecialObj + \addto@pscode{ % thanks to Buddy Ledger + /mfont { \psk@PSfont findfont \psk@fontscale scalefont setfont } bind def + /mfontexp { \psk@PSfont findfont \psk@fontscale 1.2 div scalefont setfont } bind def + /s1 { /Symbol findfont \psk@fontscale scalefont setfont } bind def + \ifPst@algebraic + /x #1 def + /Func (#2) tx@AlgToPs begin AlgToPs end cvx def + Func + \else #1 \fi + /value ED + \psk@Scin { + value 0 ne { value log floor cvi /expon ED }{ /expon 0 def } ifelse + value 10 expon exp div + \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul + \ifPst@round round \else cvi \fi exch div } if + \psk@decimals 0 eq { cvi } if /numb ED + expon \psk@valuewidth string cvs /expon exch def + numb \psk@valuewidth string cvs + \ifPst@dot dot2comma \fi % do we have to change dot to comma + /Output exch def + /txspc \psk@fontscale 4 div def + \psk@xShift\space 0 moveto mfont Output show + txspc 0 rmoveto s1 (\string\264) show + txspc 0 rmoveto mfont (10) show + txspc 2 div txspc 1.5 mul rmoveto mfontexp expon show } + { value + \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul + \ifPst@round round \else cvi \fi exch div } if + \psk@decimals 0 eq { cvi } if %inserted to handle decimals=0 + \psk@valuewidth string cvs + \ifPst@dot dot2comma \fi % do we have to change dot to comma + \psk@xShift\space 0 moveto mfont %Output + show + } ifelse + }% + \end@SpecialObj% +} +% +\catcode`\@=\PstAtCode\relax +% +%% END: pst-tools.tex +\endinput +% |