diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty | 208 |
1 files changed, 120 insertions, 88 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 4ba71859a7b..332ee17a450 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: 3.3a (2012/09/18) +%% Version: 3.4alpha (2013/02/03) %% -%% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net> +%% Copyright (C) 2007-2013 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} - [2012/09/18 v3.3a Optical experimental setups with PSTricks] + [2013/02/03 v3.4 Optical experimental setups with PSTricks] \RequirePackage{pstricks} \RequirePackage{pst-xkey} \RequirePackage{pst-node} @@ -267,6 +267,7 @@ \define@boolkey[psset]{optexp}[POE@]{frontlayer}[true]{} \define@boolkey[psset]{optexp}[POE@]{optexpenv}[true]{} \psset[optexp]{backlayer, frontlayer}% +\newcommand{\oelabel}[1]{#1}% \define@key[psset]{optexp}{labelangle}{% \pst@checknum{#1}\POE@key@labelangle } @@ -348,7 +349,7 @@ \def\POE@key@extnodealign{#1}% \fi }% - {\PackageError{pst-optexp}{Unknown value '\val' for extnodealign.}} + {\PackageError{pst-optexp}{Unknown value '\val' for extnodealign}} \define@key[psset]{optexp}{extnode}{% \edef\POE@key@extnode{#1}% \ifx\@empty\POE@key@extnode\else @@ -404,15 +405,15 @@ \define@choicekey*[psset]{optexp}{namingscheme}% [\val\nr]{old,new}[new]{% \ifcase\nr\relax - \edef\POE@str@basicname@default{tempNode} - \edef\POE@str@basicname@prefix{} - \gdef\POE@str@basicname@sep{Intern} - \edef\POE@str@extnode@postfix{ExtNode} + \edef\POE@str@basicname@default{tempNode}% + \edef\POE@str@basicname@prefix{}% + \gdef\POE@str@basicname@sep{Intern}% + \edef\POE@str@extnode@postfix{ExtNode}% \or - \edef\POE@str@basicname@default{@} - \edef\POE@str@basicname@prefix{OE@} - \gdef\POE@str@basicname@sep{} - \edef\POE@str@extnode@postfix{Ext} + \edef\POE@str@basicname@default{@}% + \edef\POE@str@basicname@prefix{OE@}% + \gdef\POE@str@basicname@sep{}% + \edef\POE@str@extnode@postfix{Ext}% \fi }% \psset[optexp]{namingscheme=new}% @@ -542,7 +543,7 @@ \def\POE@psset@@crystalsize#1 #2 #3\@nil{% \ifx\\#2\\% \PackageWarning{pst-optexp}{% - Parameter 'crystalsize' requires two numbers}% + Parameter 'crystalsize' requires two numbers.}% \fi \psset[optexp]{crystalwidth=#1}% \psset[optexp]{crystalheight=#2}% @@ -578,7 +579,7 @@ \def\POE@psset@@optboxsize#1 #2 #3\@nil{% \ifx\\#2\\% \PackageWarning{pst-optexp}{% - Parameter 'optboxsize' requires two numbers}% + Parameter 'optboxsize' requires two numbers.}% \fi \psset[optexp]{optboxwidth=#1, optboxheight=#2}% }% @@ -607,7 +608,7 @@ \def\POE@psset@@platesize#1 #2 #3\@nil{% \ifx\\#2\\% \PackageWarning{pst-optexp}{% - Parameter 'platesize' requires two numbers}% + Parameter 'platesize' requires two numbers.}% \fi \psset[optexp]{platewidth=#1, plateheight=#2}% }% @@ -626,7 +627,7 @@ }% \define@choicekey*+[psset]{optexp}{dettype}[\val\nr]{round,diode}% {\edef\POE@key@dettype{\val}} - {\PackageError{pst-optexp}{Unknown value '\val' for dettype.}} + {\PackageError{pst-optexp}{Unknown value '\val' for dettype}} \newpsstyle{DetectorStyle}{} \psset[optexp]{% detsize=0.8, @@ -648,7 +649,7 @@ \define@choicekey+[psset]{optexp}{poltype}% [\val\nr]{parallel,misc,perp,rcirc,lcirc}% {\edef\POE@key@poltype{#1}} - {\PackageError{pst-optexp}{Unknown value '\val' for poltype.}% + {\PackageError{pst-optexp}{Unknown value '\val' for poltype}% } \psset[optexp]{% poltype=parallel, @@ -686,7 +687,7 @@ \def\POE@psset@@glanthompsonsize#1 #2 #3\@nil{% \ifx\\#2\\% \PackageWarning{pst-optexp}{% - Parameter 'glanthompsonsize' requires two numbers}% + Parameter 'glanthompsonsize' requires two numbers.}% \fi \psset[optexp]{glanthompsonwidth=#1, glanthompsonheight=#2}% }% @@ -806,7 +807,7 @@ \else \def\POE@key@gratingalign{#1}% \fi}% - {\PackageError{pst-optexp}{Unknown value '\val' for gratingalign.}} + {\PackageError{pst-optexp}{Unknown value '\val' for gratingalign}} \define@boolkey[psset]{optexp}[POE@]{reverse}[true]{} \psset[optexp]{% gratingcount=10, @@ -834,7 +835,7 @@ \define@choicekey+[psset]{optexp}{prismalign}[\val\nr]% {auto,center}% {\def\POE@key@prismalign{#1}}% - {\PackageError{pst-optexp}{Unknown value '\val' for prismalign.}}% + {\PackageError{pst-optexp}{Unknown value '\val' for prismalign}}% \psset[optexp]{% prismsize=1, prismangle=60, @@ -884,7 +885,7 @@ \define@choicekey+[psset]{optexp}{polcontroltype}[\val\nr]% {linear,triangle}% {\def\POE@key@polcontroltype{#1}}% - {\PackageError{pst-optexp}{Unknown polcontroltype '\val'}} + {\PackageError{pst-optexp}{Unknown value '\val' for polcontroltype}} \psset[optexp]{% polcontrolsize=0.15, polcontroltype=linear @@ -942,12 +943,20 @@ }% \psset[optexp]{fiberpolsize=0.6}% \define@key[psset]{optexp}{switchsize}{% - \pst@checknum{#1}\POE@key@switchsize -} + \pst@expandafter\POE@psset@@switchsize{#1} {} {} {}\@nil +}% +\def\POE@psset@@switchsize#1 #2 #3\@nil{% + \pst@checknum{#1}\POE@key@switchwidth + \ifx\\#2\\% + \pst@checknum{#1}\POE@key@switchheight + \else + \pst@checknum{#2}\POE@key@switchheight + \fi +}% \define@choicekey+[psset]{optexp}{switchstyle}% [\val\nr]{opened,closed}% {\edef\POE@key@switchstyle{#1}}% - {\PackageError{pst-optexp}{Unknown value '\val' for switchstyle.}} + {\PackageError{pst-optexp}{Unknown value '\val' for switchstyle}} \psset[optexp]{% switchsize=0.8, switchstyle=opened @@ -991,8 +1000,6 @@ \pst@expandafter\POE@psset@@optcircangle{#1} {} {} {}\@nil }% \def\POE@psset@@optcircangle#1 #2 #3\@nil{% - \edef\POE@tempA{#1}% - \edef\POE@tempB{#2}% \ifx\\#2\\% \PackageError{pst-optexp}{optcircangle requires two numbers}% \else\ifx\\#1\\% @@ -1029,7 +1036,7 @@ \let\POE@key@couplertype\POE@str@couplertype@ellipse \fi }% - {\PackageError{pst-optexp}{Unknown value '\val' for couplertype.}} + {\PackageError{pst-optexp}{Unknown value '\val' for couplertype}} \define@key[psset]{optexp}{align}{% \psset[optexp]{coupleralign=#1}% \PackageWarning{pst-optexp}{% @@ -1048,7 +1055,7 @@ \else \def\POE@key@coupleralign{#1}% \fi}% - {\PackageError{pst-optexp}{Unknown value '\val' for coupleralign.}} + {\PackageError{pst-optexp}{Unknown value '\val' for coupleralign}} \psset[optexp]{% couplersize=0.2, couplersep=0.05, @@ -1103,7 +1110,7 @@ \psset[optexp]{n=#1}% \PackageWarning{pst-optexp}{% Option 'refractiveindex' is deprecated,\MessageBreak - use 'n' instead}% + use 'n' instead.}% }% \define@key[psset]{optexp}{n}{% \POE@parsealg{n}#1\@nil @@ -1147,7 +1154,7 @@ \def\POE@key@savebeampoints{#1} \else \PackageError{pst-optexp}% - {savebeampoints must be a positive integer or 0.}% + {savebeampoints must be a positive integer or 0}% \fi \@expandtwoargs\in@{,\POE@key@savebeampoints,}{,\POE@beamlist,}% \ifin@\else @@ -1169,7 +1176,7 @@ \def\POE@key@loadbeampoints{#1}% \else \PackageError{pst-optexp}% - {loadbeampoints must be a positive integer or 0.}% + {loadbeampoints must be a positive integer or 0}% \fi \@expandtwoargs\in@{,\POE@key@loadbeampoints,}{,\POE@beamlist,}% \ifin@\else @@ -1214,7 +1221,7 @@ \def\POE@key@beamalign{#1}% \fi }% - {\PackageError{pst-optexp}{Unknown value '\val' for beamalign.}} + {\PackageError{pst-optexp}{Unknown value '\val' for beamalign}} \define@key[psset]{optexp}{ArrowInsideMinLength}{% \def\POE@key@ArrowInsideMinLength{#1}% }% @@ -1384,10 +1391,10 @@ \def\POE@key@fiberalign{#1}% \fi }% - {\PackageError{pst-optexp}{Unknown value '\val' for fiberalign.}}% + {\PackageError{pst-optexp}{Unknown value '\val' for fiberalign}}% \define@key[psset]{optexp}{fiberstyle}{% \@ifundefined{nc#1}% - {\PackageError{pst-optexp}{Unknown value '#1' for fiberstyle.}}% + {\PackageError{pst-optexp}{Unknown value '#1' for fiberstyle}}% {\def\POE@key@fiberstyle{#1}}} \psset[optexp]{% fiberangleA=0, @@ -1423,6 +1430,7 @@ \POE@getcoor#1#2 \edef\POE@temp{{\pst@coor}}% \else + \POE@checkcompname{#1#2}% \edef\POE@temp{/\oenode{}{#1#2}\space}% \fi% }% @@ -1896,12 +1904,18 @@ \def\POE@getcomprange#1-#2\@nil{% \ifx\\#2\\% \ifx\\#1\\% - % empty option \edef\POE@firstcomp{\the\POE@cnt}% \edef\POE@lastcomp{\the\POE@cnt}% \else \edef\POE@firstcomp{#1}% \edef\POE@lastcomp{#1}% + \ifodd + \ifnum 0<\POE@firstcomp\ifnum\POE@lastcomp>\the\POE@cnt \@ne\else\z@\fi\else\@ne\fi + \PackageError{pst-optexp}% + {Component ID \POE@firstcomp\space is not valid, + \ifnum\the\POE@cnt=0 no components have been defined\else + valid range is from 1 to \the\POE@cnt\fi} + \fi \fi \else \ifx\\#1\\% @@ -1910,20 +1924,36 @@ \edef\POE@firstcomp{#1}% \fi \POE@getlastcomp#2% + \ifnum\POE@firstcomp>\the\POE@cnt + \ifnum\POE@lastcomp>\the\POE@cnt + \PackageError{pst-optexp}% + {All components \POE@firstcomp-\POE@lastcomp\space out of range}% + \fi + \fi + \ifnum\POE@firstcomp<1 + \PackageWarning{pst-optexp}% + {Component ID \POE@firstcomp\space is not valid, setting to 1.}% + \def\POE@firstcomp{1}% + \else\ifnum\POE@firstcomp>\the\POE@cnt + \PackageWarning{pst-optexp}% + {Component ID \POE@firstcomp\space is not valid, setting to \MessageBreak + the last defined value (\the\POE@cnt).}% + \edef\POE@firstcomp{\the\POE@cnt}% + \fi\fi + \ifnum\POE@lastcomp>\the\POE@cnt + \PackageWarning{pst-optexp}% + {Component ID \POE@lastcomp\space is not valid, setting to \MessageBreak + the last defined value (\the\POE@cnt).}% + \edef\POE@lastcomp{\the\POE@cnt}% + \else\ifnum\POE@lastcomp<1 + \PackageWarning{pst-optexp}% + {Component ID \POE@lastcomp\space is not valid, setting to 1.}% + \def\POE@lastcomp{1}% + \fi\fi \fi - \ifnum\POE@firstcomp<1 - \def\POE@firstcomp{1}% - \else\ifnum\POE@firstcomp>\the\POE@cnt - \edef\POE@firstcomp{\the\POE@cnt}% - \fi\fi - \ifnum\POE@lastcomp>\the\POE@cnt - \edef\POE@lastcomp{\the\POE@cnt}% - \else\ifnum\POE@lastcomp<1 - \def\POE@lastcomp{1}% - \fi\fi -} +}% \def\POE@getlastcomp#1-{% - \ifx.#1.% + \ifx\\#1\\% \edef\POE@lastcomp{\the\POE@cnt}% \else \ifx\@empty#1\relax @@ -1932,7 +1962,7 @@ \edef\POE@lastcomp{#1}% \fi \fi -} +}% \def\POE@getcomps#1#2{% \ifx\POE@key@conn\@empty \def\POE@aftercomps{\addto@pscode{#1 \POE@comps }#2}% @@ -1973,6 +2003,7 @@ \POE@firstcomp\space\POE@lastcomp\space GetCompRange % }% \else + \POE@checkcompname{#1#2}% \POE@getcomp{(\oenode{}{#1#2})}% \fi\fi\fi\fi% \POE@getcomps@i% @@ -2230,7 +2261,7 @@ \def\POE@checkcompname#1{% \@expandtwoargs\in@{,#1,}{,\POE@complist,}% \ifin@\else - \PackageError{pst-optexp}{^^Jcompname '#1' undefined!^^J} + \PackageError{pst-optexp}{Component '#1' is undefined} \fi }% \def\POE@getlastcompname{% @@ -2240,18 +2271,18 @@ \def\oenode#1#2{% \POE@str@basicname@prefix% \ifx\\#2\\% - \ifnum9<1\POE@getlastcompname% - \POE@str@basicname@default% - \POE@getlastcompname% - \else% - \POE@getlastcompname% - \POE@str@basicname@sep% - \fi% - \else% - \ifnum9<1#2% - \POE@str@basicname@default% + \ifnum9<1\POE@getlastcompname\space% + \POE@str@basicname@default + \POE@getlastcompname + \else + \POE@getlastcompname + \POE@str@basicname@sep + \fi + \else + \ifnum9<1#2 + \POE@str@basicname@default #2% - \else% + \else #2\POE@str@basicname@sep% \fi% \fi% @@ -2281,7 +2312,7 @@ \else \PackageWarning{pst-optexp}{% \string\oenodeIfc\space node argument must be\MessageBreak - integer, 'N', or 'C'} + integer, 'N', or 'C'.} \fi\fi\fi }% \def\oenodeBeam#1{% @@ -2506,8 +2537,7 @@ \dipole@iimacro{#2}% }{% \PackageError{pst-optexp}{% - dipole component `#2' already defined - }% + dipole component '#2' already defined}% }% \ignorespaces}% \def\POE@newfiberdipole[#1]#2#3{% @@ -2538,8 +2568,7 @@ \fiberdipole@iimacro{#2}% }{% \PackageError{pst-optexp}{% - fiber dipole object `#2' already defined - }% + fiber dipole object '#2' already defined}% }% \ignorespaces}% \def\POE@newtripole[#1]#2#3{% @@ -2566,8 +2595,7 @@ \tripole@iimacro{#2}% }{% \PackageError{pst-optexp}{% - tripole object `#2' already defined - }% + tripole object '#2' already defined}% }% \ignorespaces}% \def\dipole@iimacro#1{% @@ -2836,7 +2864,8 @@ \ifnum\POE@key@fiberboxcountout=1 \ifdim\POE@key@fiberboxheight pt=0pt \PackageError{pst-optexp}{% - Cannot determine fiberboxheight automatically} + Cannot determine height of 1x1 fiberbox automatically, + use fiberboxheight}% \fi \fi \fi @@ -3021,10 +3050,10 @@ {\POE@key@labelangle}% {\oenodeCenter{}}% {\pnode(0,0){\oenodeLabel{}}% - \rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}% + \rput[\POE@key@labelalign](0,0){\POE@key@labelstyle\oelabel{#1}}}% \else\ifx\POE@key@labelref\POE@str@labelref@relgrav \rput[\POE@key@labelalign](\oenodeLabel{}){% - \POE@key@labelstyle #1}% + \POE@key@labelstyle\oelabel{#1}}% \else\ifx\POE@key@labelref\POE@str@relative \begingroup \pst@def{InitNC}< % kindly contributed by Herbert Voss @@ -3046,14 +3075,14 @@ {\POE@trefnodeA}{\POE@trefnodeB}% \ifx\POE@key@position\@empty \ifx\POE@key@abspos\@empty - \ncput[nrot=:U,npos=]{\POE@putlabelrelative{#1}}% + \ncput[nrot=:U,npos=]{\POE@putlabelrelative{\oelabel{#1}}}% \else \POE@nlput[nrot=:U](\POE@trefnodeA)(\POE@trefnodeB)% - {\POE@key@abspos}{\POE@putlabelrelative{#1}}% + {\POE@key@abspos}{\POE@putlabelrelative{\oelabel{#1}}}% \fi \else \ncput[nrot=:U, npos=\POE@key@position]% - {\POE@putlabelrelative{#1}}% + {\POE@putlabelrelative{\oelabel{#1}}}% \fi \endgroup \fi\fi\fi @@ -3452,10 +3481,10 @@ dimen=outer](! \@ht 4 div 0)% (! \@ht -4 div \@ht 2.5 div) \ifx\POE@key@extnode\@empty - \psbezier(! 0 \@ht 2.5 div)% - (! 0 \@ht 1.5 div)% - (! \@ht 2 div \@ht 2 div)% - (! \@ht 4 div \@ht) + \psbezier[fillstyle=none](! 0 \@ht 2.5 div)% + (! 0 \@ht 1.5 div)% + (! \@ht 2 div \@ht 2 div)% + (! \@ht 4 div \@ht) \fi \else\ifx\POE@key@mirrortype\POE@str@mirrortype@extended \psframe[style=ExtendedMirror]% @@ -3508,7 +3537,7 @@ \egroup \fi \bgroup - \psset{linewidth=\POE@key@mirrorlinewidth} + \psset{linewidth=\POE@key@mirrorlinewidth, fillstyle=none} \begin@OpenObj \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}% \end@OpenObj @@ -3772,11 +3801,11 @@ \pscircle[fillstyle=none](0,0){0.12} \fi \ifx\POE@key@poltype\POE@str@pol@polrcirc - \psellipticarc[arrows=->]% + \psellipticarc[fillstyle=none, arrows=->]% (0,0)(! \@sz 2 div \@sz){20}{-20} \fi \ifx\POE@key@poltype\POE@str@pol@pollcirc - \psellipticarc[arrows=<-]% + \psellipticarc[fillstyle=none, arrows=<-]% (0,0)(! \@sz 2 div \@sz){20}{-20} \fi \ignorespaces}% @@ -4108,6 +4137,8 @@ }% }% \def\optmzm@comp{% + \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})% + (!\POE@dict{@@x @@y}) \bgroup \ifPOE@usefiberstyle \psset{style=Fiber, arrows=-, ArrowInside=-} @@ -4121,8 +4152,6 @@ (! \POE@dict{@@x -0.4 mul @@y -0.6 mul})% (! \POE@dict{@@x} -0.7 mul 0)% \egroup - \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})% - (!\POE@dict{@@x @@y}) \ignorespaces}% \def\optfilter@ref{% \POE@setref{\POE@key@filtersize\space 0.5 mul dup /@@y ED /@@x ED }% @@ -4263,9 +4292,14 @@ \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht) \ignorespaces}% \def\optswitch@ref{% - \POE@setref{\POE@key@switchsize\space 0.5 mul dup /@@y ED /@@x ED }% + \POE@setref{% + /@@x \POE@key@switchwidth\space 0.5 mul def + /@@y \POE@key@switchheight\space 0.5 mul def + }% }% \def\optswitch@comp{% + \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})% + (! \POE@dict{@@x @@y})% \pstVerb{tx@Dict begin /@lw \getCLW def end}% \bgroup \ifPOE@usefiberstyle @@ -4292,8 +4326,6 @@ \pscircle(! \POE@dict{@@x} -0.6 mul 0){\pslinewidth}% \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)% \fi - \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})% - (! \POE@dict{@@x @@y})% \ignorespaces}% \def\fiberdelayline@ref{% \POE@setref{% @@ -4365,7 +4397,7 @@ {@@x neg @@y0 \@sep sub} {@@x @@y0 \@sep add} {@@x @@y0 \@sep sub} }% - \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}} + \pnode(0,0){\oenodeCenter{}} }% \def\POE@coupler@ref{% \POE@setref{% @@ -4449,7 +4481,7 @@ {@@x neg @@y0 \@sep add} {@@x neg @@y0 \@sep sub} {@@x 0}}% - \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}} + \pnode(0,0){\oenodeCenter{}} }% \def\wdmcoupler@comp{% \ifx\POE@key@couplertype\POE@str@couplertype@none @@ -4480,7 +4512,7 @@ {@@x neg 0} {@@x @@y0 \@sep add} {@@x @@y0 \@sep sub}} - \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}} + \pnode(0,0){\oenodeCenter{}} }% \def\wdmsplitter@comp{% \ifx\POE@key@couplertype\POE@str@couplertype@none |