diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/egplot/egplot.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/egplot/egplot.sty | 94 |
1 files changed, 62 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/egplot/egplot.sty b/Master/texmf-dist/tex/latex/egplot/egplot.sty index 2989278caa1..169d4279745 100644 --- a/Master/texmf-dist/tex/latex/egplot/egplot.sty +++ b/Master/texmf-dist/tex/latex/egplot/egplot.sty @@ -32,7 +32,7 @@ %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% \CheckSum{376} +%% \CheckSum{449} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -50,22 +50,28 @@ %% Right brace \} Tilde \~} %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\fileversion{v1.01} +\def\fileversion{v1.02a} \NeedsTeXFormat{LaTeX2e} \gdef\filename{egplot.sty}% -\gdef\filedate{1998/06/20}% +\gdef\filedate{1998/07/08}% \gdef\filemaintainer{Axel Probst}% \ProvidesPackage{egplot}[\filedate\space\fileversion\space Encapsulated gnuplot LaTeX Package (\filemaintainer)] -\RequirePackage{graphicx}[1994/12/15] \RequirePackage{verbatim} \RequirePackage{ifthen} \newboolean{egp@german} \setboolean{egp@german}{false} \DeclareOption{german}{% \setboolean{egp@german}{true}} +\newboolean{egp@oldgp} +\setboolean{egp@oldgp}{true} +\DeclareOption{gnuplot35}{% + \setboolean{egp@oldgp}{true}} +\DeclareOption{gnuplot36beta}{% + \setboolean{egp@oldgp}{false}} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}} \ProcessOptions +\RequirePackage{graphicx}[1994/12/15] {\catcode`\#=11\gdef\egpcomment{#}} \def\egpwrite#1{% \if@egpio @@ -75,11 +81,17 @@ \newif\if@egpio \@egpiotrue \newwrite\@outegp -\newcommand{\egpfile}[1][\jobname]{% +\newcounter{egpfilenum} % 1998-03-07 +\setcounter{egpfilenum}{0} % 1998-03-07 +\newcommand{\egpfile}[1][\jobname\theegpfilenum_]{% \def\theegpfile{#1}% + \ifthenelse{\equal{\theegpfile}{\jobname\theegpfilenum_}}{% + \stepcounter{egpfilenum}% + \def\theegpfilename{\jobname\theegpfilenum.gp}}{% + \def\theegpfilename{\theegpfile.gp}} \if@egpio - \immediate\openout\@outegp=\theegpfile.gp\relax - \egpwrite{\egpcomment\space \theegpfile.gp -- % + \immediate\openout\@outegp=\theegpfilename\relax + \egpwrite{\egpcomment\space \theegpfilename -- % do not edit, generated automatically by \jobname.tex^^J} \expandafter\ifx\expandafter*\the\egp@prelude*\else \egpwrite{\the\egp@prelude;}% @@ -116,20 +128,26 @@ \egp@def} \def\egp@{% \egp@start% - \egpwrite{print 'generating picture ---- \theegpfile\theegpfig.eps'^^J% - set output '\theegpfile\theegpfig.eps'^^J} + \ifthenelse{\boolean{egp@oldgp}} + {\egpwrite{\egpcomment\space --- \theegpfile\theegpfig.eps ---}} + {\egpwrite{print 'generating picture ---- \theegpfile\theegpfig.eps'}} + \egpwrite{set output '\theegpfile\theegpfig.eps'} \egp@includegraphics{\theegpfile}{\theegpfig}% \egpcmds} \def\egp@x#1{% - \egp@start% - \egpwrite{print 'generating picture ---- \theegpfile\theegpfig.eps'^^J% - set output '\theegpfile\theegpfig.eps'^^J} - \egp@includegraphicx[#1]{\theegpfile}{\theegpfig}% - \egpcmds} + \egp@start% + \ifthenelse{\boolean{egp@oldgp}} + {\egpwrite{\egpcomment\space --- \theegpfile\theegpfig.eps ---}} + {\egpwrite{print 'generating picture ---- \theegpfile\theegpfig.eps'}} + \egpwrite{set output '\theegpfile\theegpfig.eps'} + \egp@includegraphicx[#1]{\theegpfile}{\theegpfig}% + \egpcmds} \def\egp@def{% \egp@start% - \egpwrite{print 'generating picture ---- \theegpfile\theegpfig.eps'^^J% - set output '\theegpfile\theegpfig.eps'^^J} + \ifthenelse{\boolean{egp@oldgp}} + {\egpwrite{\egpcomment\space --- \theegpfile\theegpfig.eps ---}} + {\egpwrite{print 'generating picture ---- \theegpfile\theegpfig.eps'}} + \egpwrite{set output '\theegpfile\theegpfig.eps'} \egpcmds} \def\egp@start{% \egp@checkfile @@ -141,7 +159,7 @@ \def\egp@checkfile{% \ifx\theegpfile\relax \errhelp={Outside an egpfile environment, I have no clue as to where^^J% - the GNUPlot commands should go. I will use egpdefault.gp^^J% + the gnuplot commands should go. I will use egpdefault.gp^^J% for this graph, but you'd better fix your code!}% \errmessage{I detected a egp environment outside of egpfile}% \egpfile[egpdefault] @@ -152,7 +170,7 @@ {\includegraphics{#1#2.eps}}% {\typeout{% egp: File #1#2.eps\space not found:^^J% - egp: Process #1.gp with GNUPlot and then % + egp: Process \theegpfilename\space with gnuplot and then % reprocess this file.}}} \newcommand{\egp@includegraphicx}[3][scale=1]{% \leavevmode @@ -160,7 +178,7 @@ {\includegraphics[#1]{#2#3.eps}}% {\typeout{% egp: File #2#3.eps\space not found:^^J% - egp: Process #2.gp with GNUPlot and then % + egp: Process \theegpfilename\space with gnuplot and then % reprocess this file.}}} \def\egpcmds{% \begingroup @@ -175,13 +193,15 @@ \def\endegp{% \endegpcmds \ifthenelse{\boolean{egp@german}}{% - \egpwrite{!sed -e '/[0-9]*[.][0-9]*)\ .show/s/[.]/,/' \theegpfile\theegpfig.eps >\theegpfile\theegpfig.tmp^^J} + \egpwrite{!sed -e '/[0-9]*[.][0-9]*)\ .show/s/[.]/,/' % + \theegpfile\theegpfig.eps >\theegpfile\theegpfig.tmp} \egpwrite{!cp \theegpfile\theegpfig.tmp \theegpfile\theegpfig.eps} \egpwrite{!rm -f \theegpfile\theegpfig.tmp}} {} \expandafter\ifx\expandafter*\the\egp@figepilog*\else \egpwrite{\the\egp@figepilog}% - \fi} + \fi + \egpwrite{}} \def\endegpx{\endegp} \def\endegpdef{\endegp} \def\egp@@def#1{% @@ -200,16 +220,21 @@ \egp@checkfile \global\expandafter\advance\csname c@egpcalc\endcsname \@ne \egpc@@def{\egp@@name}% - \egpwrite{print 'calculating value ----- \theegpfile\theegpcalc.val'^^J% - set term table; set output '\theegpfile\theegpcalc.tmp'^^J% + \ifthenelse{\boolean{egp@oldgp}} + {\egpwrite{\egpcomment\space --- \theegpfile\theegpcalc.val ---}} + {\egpwrite{print 'calculating value ----- \theegpfile\theegpcalc.val'}} + \egpwrite{set term table; set output '\theegpfile\theegpcalc.tmp'^^J% set samples 2^^J% set zero 0^^J% - plot [0:0] \egp@expression^^J} + plot [0:0] \egp@expression} \ifthenelse{\boolean{egp@german}}{% - \egpwrite{!tail -3 \theegpfile\theegpcalc.tmp | head -1 | cut -f 2 -d' ' | sed -e 's/[.]/{,}/' >\theegpfile\theegpcalc.val^^J}} - {\egpwrite{!tail -3 \theegpfile\theegpcalc.tmp | head -1 | cut -f 2 -d' ' >\theegpfile\theegpcalc.val^^J}} - \egpwrite{!rm -f \theegpfile\theegpcalc.tmp^^J% - reset^^J}} + \egpwrite{!tail -3 \theegpfile\theegpcalc.tmp | head -1 |% + cut -f 2 -d' ' | sed -e 's/[.]/{,}/' % + >\theegpfile\theegpcalc.val}} + {\egpwrite{!tail -3 \theegpfile\theegpcalc.tmp | head -1 |% + cut -f 2 -d' ' >\theegpfile\theegpcalc.val}} + \egpwrite{!rm -f \theegpfile\theegpcalc.tmp} + \egpwrite{}} \def\egpc@@def#1{% \global\e@namedef{egp@k:f:#1}{\theegpfile}% \global\e@namedef{egp@k:v:#1}{\theegpcalc}} @@ -218,12 +243,12 @@ {\input{#1#2.val}}% {\typeout{% egp: File #1#2.val\space not found:^^J% - egp: Process #1#2.gp with GNUPlot and then % + egp: Process \theegpfilename\space with gnuplot and then % reprocess this file.}}} \newcommand{\egpshowval}[2][*]{% \def\egp@@name{#1}% - \def\egp@expression{#2} - \egp@calc + \def\egp@expression{#2}% + \egp@calc% \egp@includevalue{\theegpfile}{\theegpcalc}} \newcommand{\egpuseval}[1]{% \@ifundefined{egp@k:f:#1}% @@ -231,8 +256,13 @@ {\egp@includevalue{\@nameuse{egp@k:f:#1}}{\@nameuse{egp@k:v:#1}}}} \newcommand{\egpassign}[2]{% \egpwrite{#1=#2}\egpshowval{#1}} +\ifthenelse{\boolean{egp@oldgp}} + {\egpprelude{save "reset.gp"}} + {\relax} \egpfigprelude{set terminal postscript eps monochrome dashed "Helvetica" 17} -\egpfigepilog{reset} +\ifthenelse{\boolean{egp@oldgp}}{% + \egpfigepilog{load "reset.gp"}}{% + \egpfigepilog{reset}} \InputIfFileExists{egplot.cfg} {\typeout{egp: Using configuration file 'egplot.cfg'}} {} |