summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-14 23:07:19 +0000
committerKarl Berry <karl@freefriends.org>2011-08-14 23:07:19 +0000
commita6f1bf5e02c8819c63809f345c5a803cb274c9d5 (patch)
tree4822d0d50c334c78c73d0edcf71b94a913879a68 /Master/texmf-dist/tex/generic
parent135d4e294c8799bf72c97ae9ae12f679d57a2450 (diff)
pst-coil
git-svn-id: svn://tug.org/texlive/trunk@23558 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex65
1 files changed, 41 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex b/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex
index 49a1f17a217..1770fda18a9 100644
--- a/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex
+++ b/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex
@@ -1,4 +1,4 @@
-%% $Id: pst-coil.tex 278 2010-02-01 12:37:08Z herbert $
+%% $Id: pst-coil.tex 537 2011-07-12 08:07:40Z herbert $
%% BEGIN pst-coil.tex
%%
%% Coils and zigzags with PSTricks
@@ -16,13 +16,13 @@
\message{ v\fileversion, \filedate}
\csname PSTcoilsLoaded\endcsname
\let\PSTcoilsLoaded\endinput
-\ifx\PSTricksLoaded\endinput\else
-\def\next{\input pstricks.tex}\expandafter\next
-\fi
-\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%
-\def\fileversion{1.03}
-\def\filedate{2010/02/01}
+\ifx\PSTricksLoaded\endinput \else\input pstricks.tex\fi
+\ifx\PSTnodeLoaded\endinput \else\input pst-node.tex\fi
+\ifx\PSTXKeyLoaded\endinput \else\input pst-xkey \fi
+%
+\def\fileversion{1.05}
+\def\filedate{2011/07/12}
%
\edef\TheAtCode{\the\catcode`\@}
\catcode`\@=11
@@ -30,7 +30,14 @@
\pst@addfams{pst-coil}
\pstheader{pst-coil.pro}
\edef\pst@theheaders{\pst@theheaders,pst-coil.pro}
-\def\pst@coildict{tx@CoilDict begin }
+\def\pst@CoilDict{tx@CoilDict begin }
+%
+\def\tx@CoilLoop {\pst@CoilDict CoilLoop end }
+\def\tx@Coil {\pst@CoilDict Coil end }
+\def\tx@AltCoil {\pst@CoilDict AltCoil end }
+\def\tx@ZigZag {\pst@CoilDict ZigZag end }
+\def\tx@ZigZagCirc{\pst@CoilDict ZigZagCirc end }
+\def\tx@Sin {\pst@CoilDict Sin end }
%
\define@key[psset]{pst-coil}{coilwidth}[1cm]{\pst@getlength{#1}\psk@coilwidth}
\define@key[psset]{pst-coil}{coilheight}[1]{\pst@checknum{#1}\pscoilheight}
@@ -57,12 +64,10 @@
\psk@coilwidth \pscoilheight
\psk@coilarmA \psk@coilarmB
\psk@coilaspect \psk@coilinc
- \pst@coildict \tx@Coil end }%
+ \tx@Coil }%
\showpointsfalse
\end@OpenObj}
%
-\def\tx@CoilLoop{CoilLoop }
-\def\tx@Coil{Coil }
\def\psCoil{\def\pst@par{}\pst@object{psCoil}}
\def\psCoil@i#1#2{%
\begin@AltOpenObj
@@ -76,15 +81,21 @@
\pscoilheight
\psk@coilaspect
\psk@coilinc
- \pst@coildict \tx@AltCoil end
+ \tx@AltCoil
\@nameuse{psls@\pslinestyle} }%
\end@OpenObj}
-\def\tx@AltCoil{AltCoil }
+%
+\define@key[psset]{pst-coil}{bow}[\z@]{%
+ \pst@getlength{#1}\psk@bow \pst@dima=\psk@bow pt
+ \pst@absdim{\pst@dima}{\pst@dimb}
+ \ifdim\pst@dimb<1pt \def\psk@bow{0}\fi}
+\psset[pst-coil]{bow=\z@}
%
\def\pszigzag{\def\pst@par{}\pst@object{pszigzag}}
\def\pszigzag@i{\pst@getarrows\pszigzag@ii}
\def\pszigzag@ii(#1){\@ifnextchar({\pszigzag@iii{1}(#1)}{\pszigzag@iii{\z@}(0,0)(#1)}}
\def\pszigzag@iii#1(#2)(#3){%
+ \addbefore@par{bow=0}%
\begin@OpenObj
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
@@ -96,13 +107,11 @@
\psk@coilwidth
\psk@coilarmA
\psk@coilarmB
- \pst@coildict \tx@ZigZag end
+ \ifdim\psk@bow pt=\z@\tx@ZigZag\else\psk@bow\space\tx@ZigZagCirc\fi
\psline@iii
\tx@Line }%
\end@OpenObj}
%
-\def\tx@ZigZag{ZigZag }
-%
\def\nccoil{\pst@object{nccoil}}
\def\nccoil@i{\check@arrow{\nccoil@ii}}
\def\nccoil@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{%
@@ -114,11 +123,12 @@
\psk@coilwidth \pscoilheight
\psk@coilarmA \psk@coilarmB
\psk@coilaspect \psk@coilinc
- \pst@coildict \tx@Coil end
+ \tx@Coil
end }}
%
\def\pccoil{\def\pst@par{}\pst@object{pccoil}}
\def\pccoil@i{\pc@object\nccoil@ii}
+%
\def\nczigzag{\pst@object{nczigzag}}
\def\nczigzag@i{\check@arrow{\nczigzag@ii}}
\def\nczigzag@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{%
@@ -131,7 +141,7 @@
\psk@coilwidth
\psk@coilarmA
\psk@coilarmB
- \pst@coildict \tx@ZigZag end
+ \ifdim\psk@bow pt=\z@\tx@ZigZag\else\psk@bow\space\tx@ZigZagCirc\fi
\psline@iii
\tx@Line
end }}
@@ -140,10 +150,17 @@
\def\pczigzag@i{\pc@object\nczigzag@ii}
%
\def\pst@checkUnit#1#2{\expandafter\pst@checkUnit@i#1!!#2}
+% 3.5 relative value \def\pst@roundValue{-1}
+% 3.5mm absolute value {-1}
+% *3.5mm absolute value, with real->int conversion (truncate) {0}
+% **3.5mm absolute value, with real->int conversion (round) {1}
\def\pst@checkUnit@i{\@ifnextchar*%
- {\def\pst@roundValue{true }\pst@checkUnit@ii}%
- {\def\pst@roundValue{false }\pst@checkUnit@ii*}}
-\def\pst@checkUnit@ii*#1!!#2{%
+ {\def\pst@roundValue{0 }\pst@checkUnit@ii}%
+ {\def\pst@roundValue{-1 }\pst@checkUnit@iii**}}
+\def\pst@checkUnit@ii*{\@ifnextchar*%
+ {\def\pst@roundValue{1 }\pst@checkUnit@iii*}%
+ {\pst@checkUnit@iii**}}
+\def\pst@checkUnit@iii**#1!!#2{%
\edef\ps@next{#1}%
\ifx\ps@next\@empty\let\pst@num\z@%
\else\expandafter\pst@@checknum\ps@next..\@nil%
@@ -161,7 +178,6 @@
\define@key[psset]{pst-coil}{function}[sin]{\def\psk@function{#1 }}
\psset[pst-coil]{periods=1,amplitude=1,ppoints=360,function=sin}
%
-\def\tx@Sin{Sin }
\def\pssin{\pst@object{pssin}}
\def\pssin@i{\pst@getarrows\pssin@ii}
\def\pssin@ii(#1){\@ifnextchar({\pssin@iii{1}(#1)}{\pssin@iii{\z@}(0,0)(#1)}}
@@ -179,7 +195,7 @@
\psk@coilarmA \psk@coilarmB
\psk@ppoints
{ \psk@function }
- \pst@coildict \tx@Sin end
+ \tx@Sin
}%
\showpointsfalse%
\end@OpenObj}
@@ -197,12 +213,13 @@
\psk@coilarmA \psk@coilarmB
\psk@ppoints
{ \psk@function }
- \pst@coildict \tx@Sin end
+ \tx@Sin
end }}
%
\def\pcsin{\def\pst@par{}\pst@object{pcsin}}
\def\pcsin@i{\pc@object\ncsin@ii}
%
+%
\catcode`\@=\TheAtCode\relax
\endinput
%%