diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-14 00:00:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-14 00:00:52 +0000 |
commit | ae3316ebcba4127854375bc6089614efdad986a3 (patch) | |
tree | 93ae48f015c6c3b321b34c5eb574cd5c32f623ba /Master/texmf-dist/tex/latex/pst-optexp | |
parent | 72292f770e87b207288e709d626f014b3e70e2e3 (diff) |
pst-optexp (13jan14)
git-svn-id: svn://tug.org/texlive/trunk@32656 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-optexp')
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty | 195 |
1 files changed, 121 insertions, 74 deletions
diff --git a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty index 9602efcbc19..905c664bf88 100644 --- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty +++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty @@ -9,9 +9,9 @@ %% This is a generated file. %% %% Project: pst-optexp -%% Version: 4.6 (2013/11/27) +%% Version: 4.7 (2014/01/12) %% -%% Copyright (C) 2007-2013 by Christoph Bersch <usenet@bersch.net> +%% Copyright (C) 2007-2014 by Christoph Bersch <usenet@bersch.net> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -31,7 +31,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{pst-optexp} - [2013/11/27 v4.6 Optical experimental setups with PSTricks] + [2014/01/12 v4.7 Optical experimental setups with PSTricks] \RequirePackage{ifthen} \RequirePackage{pstricks} \RequirePackage{pst-xkey} @@ -2533,43 +2533,77 @@ \else \@tempcnta=#1 \fi - \POE@getlastcomp#2% - \ifnum\@tempcnta>\POE@cnt - \ifnum\@tempcntb>\POE@cnt - \PackageError{pst-optexp}% - {All components \the\@tempcnta-\the\@tempcntb\space out of range}% - \fi + \edef\POE@temp{\POE@getfirstchar#2\@nil}% + \expandafter\ifx\POE@temp<\relax + \POE@getlastcompprev#2% + \else + \POE@getlastcomp#2% \fi - \ifnum\@tempcnta<\@ne - \PackageWarning{pst-optexp}% - {Component ID \the\@tempcnta\space is not valid, setting to 1.}% - \@tempcnta=\@ne - \else\ifnum\@tempcnta>\POE@cnt - \PackageWarning{pst-optexp}% - {Component ID \the\@tempcnta\space is not valid, setting to \MessageBreak - the last defined value (\the\POE@cnt).}% - \@tempcnta=\POE@cnt% - \fi\fi + \POE@checkandfixcomprange + \fi +}% +\def\POE@getcomprangeprev<#1-#2\@nil{% + \@tempcnta=\POE@cnt + \@tempcntb=\POE@cnt + \ifx\\#1\\% + \advance\@tempcnta by -1 + \else + \advance\@tempcnta by -#1 + \fi + \ifx\\#2\\\else + \edef\POE@temp{\POE@getfirstchar#2\@nil}% + \expandafter\ifx\POE@temp<\relax + \POE@getlastcompprev#2% + \else + \POE@getlastcomp#2% + \fi + \fi + \POE@checkandfixcomprange +}% +\def\POE@checkandfixcomprange{% + \ifnum\@tempcnta>\POE@cnt \ifnum\@tempcntb>\POE@cnt - \PackageWarning{pst-optexp}% - {Component ID \the\@tempcntb\space is not valid, setting to \MessageBreak - the last defined value (\the\POE@cnt).}% - \@tempcntb=\POE@cnt% - \else\ifnum\@tempcntb<\@ne - \PackageWarning{pst-optexp}% - {Component ID \the\@tempcntb\space is not valid, setting to 1.}% - \@tempcntb=\@ne - \fi\fi + \PackageError{pst-optexp}% + {All components \the\@tempcnta-\the\@tempcntb\space out of range}% + \fi \fi + \ifnum\@tempcnta<\@ne + \PackageWarning{pst-optexp}% + {Component ID \the\@tempcnta\space is not valid, setting to 1.}% + \@tempcnta=\@ne + \else\ifnum\@tempcnta>\POE@cnt + \PackageWarning{pst-optexp}% + {A: Component ID \the\@tempcnta\space is not valid, setting to \MessageBreak + the last defined value (\the\POE@cnt).}% + \@tempcnta=\POE@cnt + \fi\fi + \ifnum\@tempcntb>\POE@cnt + \PackageWarning{pst-optexp}% + {B: Component ID \the\@tempcntb\space is not valid, setting to \MessageBreak + the last defined value (\the\POE@cnt).}% + \@tempcntb=\POE@cnt + \else\ifnum\@tempcntb<\@ne + \PackageWarning{pst-optexp}% + {Component ID \the\@tempcntb\space is not valid, setting to 1.}% + \@tempcntb=\@ne + \fi\fi }% \def\POE@getlastcomp#1-{% - \ifx\@empty#1\relax + \ifx\\#1\\% \ifnum\@tempcnta>\POE@cnt \PackageError{pst-optexp}{All components \the\@tempcnta- out of range.}% - \fi + \fi% \@tempcntb=\POE@cnt \else - \@tempcntb=#1 + \@tempcntb=#1\relax + \fi +}% +\def\POE@getlastcompprev<#1-{% + \@tempcntb=\POE@cnt + \ifx\\#1\\% + \advance\@tempcntb by -1 + \else + \advance\@tempcntb by -#1 \fi }% \def\POE@getcomps#1#2{% @@ -2585,32 +2619,42 @@ \def\POE@getcomps@ii{% \@ifnextchar\bgroup{\POE@getcomps@iii}{\POE@aftercomps}% }% -\def\POE@getcomps@iii#1{% - \def\POE@temp{#1\@empty}% - \expandafter\POE@getcomps@iv\POE@temp\@nil +\def\POE@getfirstchar#1#2\@nil{#1}% +\def\POE@getprevcompid<#1\@nil{% + \ifx\\#1\\% + \number\numexpr\POE@cnt-1\relax + \else + \number\numpexp\POE@cnt-#1\relax + \fi }% -\def\POE@getcomps@iv#1#2\@nil{% - \edef\POE@temp{#1}% +\def\POE@getcomps@iii#1{% + \edef\POE@temp{\POE@getfirstchar#1{}\@nil}% \ifx\POE@temp\@empty \POE@getcomp{(\oenode{}{})}% - \else\ifx(#1\relax%) - \POE@getplanenode#1#2% - \else\ifnum9<1#1\relax - \POE@getcomprange#1#2-\@nil + \else\expandafter\ifx\POE@temp(\relax%) + \POE@getplanenode#1% + \else\ifnum9<1\POE@temp\relax + \expandafter\POE@getcomprange#1-\@nil \POE@getcomp{% (\POE@str@basicname@prefix\POE@str@basicname@default) \the\@tempcnta\space\the\@tempcntb\space GetCompRange % }% - \else\ifx-#1\relax - \POE@getcomprange#1#2-\@nil + \else\expandafter\ifx\POE@temp<\relax + \expandafter\POE@getcomprangeprev#1-\@nil + \POE@getcomp{% + (\POE@str@basicname@prefix\POE@str@basicname@default) + \the\@tempcnta\space\the\@tempcntb\space GetCompRange % + }% + \else\expandafter\ifx\POE@temp-\relax + \POE@getcomprange#1-\@nil \POE@getcomp{% (\POE@str@basicname@prefix\POE@str@basicname@default) \the\@tempcnta\space\the\@tempcntb\space GetCompRange % }% \else - \POE@checkcompname{#1#2}% - \POE@getcomp{(\oenode{}{#1#2})}% - \fi\fi\fi\fi% + \POE@checkcompname{#1}% + \POE@getcomp{(\oenode{}{#1})}% + \fi\fi\fi\fi\fi% \POE@getcomps@i% }% \def\POE@getplanenode(#1){% @@ -2650,20 +2694,20 @@ \@ifnextchar\bgroup{\POE@normalizecomps@iv}{\POE@aftercomps}% }% \def\POE@normalizecomps@iv#1{% - \def\POE@temp{#1\@empty}% - \expandafter\POE@normalizecomps@v\POE@temp\@nil -}% -\def\POE@normalizecomps@v#1#2\@nil{% - \edef\POE@temp{#1}% - \ifnum9<1#1\relax - \def\POE@tempa{1} - \else\ifx-#1\relax - \def\POE@tempa{1} + \edef\POE@temp{\POE@getfirstchar#1{}\@nil}% + \let\POE@tempb\POE@getcomprange + \ifnum9<1\POE@temp\relax + \def\POE@tempa{1}% + \else\expandafter\ifx\POE@temp-\relax + \def\POE@tempa{1}% + \else\expandafter\ifx\POE@temp<\relax + \def\POE@tempa{1}% + \let\POE@tempb\POE@getcomprangeprev \else - \def\POE@tempa{0} - \fi\fi + \def\POE@tempa{0}% + \fi\fi\fi \ifodd\POE@tempa - \POE@getcomprange#1#2-\@nil + \POE@tempb#1-\@nil \ifnum\@tempcnta<\@tempcntb \def\POE@rel{<}\def\POE@inc{\@ne}% \else \def\POE@rel{>}\def\POE@inc{\m@ne}\fi \advance\@tempcntb\POE@inc @@ -2672,7 +2716,7 @@ \advance\@tempcnta\POE@inc }% \else - \edef\POE@comps{\POE@comps{#1#2}}% + \edef\POE@comps{\POE@comps{#1}}% \fi \POE@normalizecomps@i% }% @@ -2747,30 +2791,33 @@ \PackageError{pst-optexp}{Component '#1' is undefined} \fi }% -\def\POE@getlastcompname{% - \expandafter\POE@getlastcompname@i \POE@complist,\relax,\@nil -}% -\def\POE@getlastcompname@i#1,#2,#3\@nil{#1}% \def\oenode#1#2{% \POE@str@basicname@prefix% \ifx\\#2\\% - \ifnum9<1\POE@getlastcompname\space% - \POE@str@basicname@default - \POE@getlastcompname - \else - \POE@getlastcompname - \POE@str@basicname@sep - \fi + \POE@str@basicname@default\the\POE@cnt \else \ifnum9<1#2 \POE@str@basicname@default #2% \else - #2\POE@str@basicname@sep% + \POE@prevnode#2\@nil + \POE@str@basicname@sep% \fi% \fi% #1% }% +\def\POE@prevnode#1#2\@nil{% + \ifx<#1% + \POE@str@basicname@default + \ifx\\#2\\% + \number\numexpr\POE@cnt-1\relax + \else + \number\numexpr\POE@cnt-#2\relax + \fi + \else + #1#2% + \fi +}% \def\oenodeExt#1{\oenode{\POE@str@extnode@postfix}{#1}}% \def\oenodeIn#1{\oenode{1}{#1}}% \def\oenodeOut#1{\oenode{N}{#1}}% @@ -2879,12 +2926,12 @@ \let\newOptexpElecComp\newOptexpFiberComp \def\POE@compalias#1#2{% \POE@Verb{% - /\oenode{}{#1} dup currentdict exch known { - load /#2 ED + /\oenode{}{#2} dup currentdict exch known { + load /\oenode{}{#1} ED } { pop } ifelse - (#2) (\oenode{}{#1}) + (\oenode{}{#1}) (\oenode{}{#2}) tx@NodeDict begin 1 { 3 copy inttostr dup @@ -2967,7 +3014,7 @@ }% \def\end@OptexpObj{% \ifnum9<1\POE@key@compname\else - \POE@compalias{\POE@key@compname}{\oenode{}{\the\POE@cnt}}% + \POE@compalias{\POE@key@compname}{\the\POE@cnt}% \fi \endgroup \ignorespaces% |