diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/egplot/egplot.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/egplot/egplot.dtx | 203 |
1 files changed, 144 insertions, 59 deletions
diff --git a/Master/texmf-dist/source/latex/egplot/egplot.dtx b/Master/texmf-dist/source/latex/egplot/egplot.dtx index 78f345b9a8b..5e875969676 100644 --- a/Master/texmf-dist/source/latex/egplot/egplot.dtx +++ b/Master/texmf-dist/source/latex/egplot/egplot.dtx @@ -19,7 +19,7 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -%% \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 @@ -40,8 +40,14 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \changes{v1.00}{1998/06/17}{First released version} -% \changes{v1.01}{1998/06/25}{Fixed bug with \texttt{german} option and negative tic -% mark values} +% \changes{v1.01}{1998/06/25}{Fixed bug with \texttt{german} option and +% negative tic mark values} +% \changes{v1.02}{1998/07/08}{Added options \texttt{gnuplot35} and +% \texttt{gnuplot36beta} to allow output of +% syntax of \GP{}-3.5.\\ +% Added numbering of \GP{} files to allow multiple +% \texttt{egpfile} environments w/o explicitly +% defined names in one document.} % % \MakeShortVerb{\|} % @@ -70,7 +76,10 @@ % enable the user to let \GP{} do calculations and insert the result values % into the generated output. % \end{abstract} -% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \begin{multicols}{2} +% \tableofcontents +% \end{multicols} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \vfill % \section*{Copying} @@ -90,7 +99,7 @@ % Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \newpage +% % \def\topfraction{0.9} % \def\bottomfraction{0.9} % \def\textfraction{0.1} @@ -130,13 +139,14 @@ % In addition to the image inclusion commands \EGP{} provides the user with % commands to let \GP{} do calculations and include the results into the % document. Unfortunately these features are implemented with the UN*X text utils -% and so they are only usable if these are installed on the system. Since the +% and so they are only usable if these are installed on the system. If the user +% does not provide a name for the \GP{} file the % names for the PostScript and the result values files are built by appending -% the figure/calculation number and a three letter extension (|.eps| or |.val|) -% to |\jobname| the user has to choose a |\jobname| that is short enough so -% that the generated filenames fit into the conventions of certain operating -% systems. -% +% the number of the \GP{} file, the figure/calculation number and a three +% letter extension (|.eps| or |.val|) to |\jobname|. So the user has to +% choose a |\jobname| that is short enough so that the generated +% filenames fit into the conventions of certain operating systems. +% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \section{Usage} % @@ -145,13 +155,28 @@ % \label{sec:options} % % \DescribeMacro{Options} -% Besides the options of the |graphicx| package the option |german| is -% recognized by the \EGP{} package. -% -% If |german| is specified the calculated values and the tic labels of the -% diagrams are changed to show a `,' as decimal point character. The default is -% a `.'. This feature is also implemented with UN*X text utils and is only -% available if they are installed on the system. +% Besides the options of the |graphicx| package \EGP{} recognizes the following +% options: +% \begin{description} +% \item[|german|:] If |german| is specified the calculated values and the tic labels of the +% diagrams are changed to show a `,' as decimal point +% character. The default is a `.'. This feature is also +% implemented with UN*X text utils and is only available if +% they are installed on the system. +% \item[|gnuplot35|:] If |gnuplot35|~(default) is specified the \GP{} commands +% generated by |egplot| will be compatible with the syntax +% of the official \GP{} version~3.5. Of course the user +% has to look for the right syntax in his \GP{} code +% himself. Special care has to be taken for the +% |\egpprelude{|\dots|}| and the |\egpfigepilog{|\dots|}| +% commands since these are used to implement the missing +% |reset| command of \GP{}-3.5. +% \item[|gnuplot36beta|:] If |gnuplot36beta| is specified the \GP{} commands +% generated by |egplot| will use the features of the +% beta version \GP{}~3.6beta. As mentioned above the user +% has to look for the right syntax in his \GP{} code +% himself. +% \end{description} % % \subsection{Commands and Environments} % \label{sec:commands} @@ -260,11 +285,13 @@ % This command can be used for e.g. |replot|ting the figure to the screen or % |reset|ing to the defaults after every figure. % -% The default is: +% The defaults are as follows: % \begin{quote} -% \qquad{}|reset| +% \begin{tabular}{lll} +% Option: & none, |gnuplot35| & |gnuplot36beta| \\ +% & |load "reset.gp"| & |reset| \\ +% \end{tabular} % \end{quote} -% % % \subsubsection{Calculating} % \label{sec:calculations} @@ -307,8 +334,9 @@ % \label{sec:procedure} % % After \LaTeX{} has done it's job for the first time you have to invoke \GP{} -% on the generated file~(default: |\jobname.gp|). Then another \LaTeX{} run is -% necessary to include the figures and the results into the output. +% on the generated file~(default: |\jobnameX.gp|, where |X| is a number). Then +% another \LaTeX{} run is necessary to include the figures and the results into +% the output. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Examples} % \label{sec:examples} @@ -414,7 +442,8 @@ % \begin{macrocode} $f(\pi/4)=\egpshowval[sin_quarter_pi]{sin(pi/4)}$ % \end{macrocode} -% and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. +% and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}\footnote{I +% couldn't figure out how to remove the trailing space, yet. Any hints ?}$ % \begin{macrocode} and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. \end{egpfile} @@ -481,10 +510,10 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % % \begin{macrocode} %<*style> -\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}% % \end{macrocode} % @@ -493,19 +522,32 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. \ProvidesPackage{egplot}[\filedate\space\fileversion\space Encapsulated gnuplot LaTeX Package (\filemaintainer)] % \end{macrocode} -% Every option we don't understand is sent down to |graphicx|: +% +% Load the required packages: % \begin{macrocode} -\RequirePackage{graphicx}[1994/12/15] \RequirePackage{verbatim} \RequirePackage{ifthen} +% \end{macrocode} % +% Now the options are specified: +% \begin{macrocode} \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}} +% \end{macrocode} % +% Every option we don't understand is sent down to |graphicx|: +% \begin{macrocode} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}} \ProcessOptions +\RequirePackage{graphicx}[1994/12/15] % \end{macrocode} % % \begin{macro}{\egpwrite} @@ -527,14 +569,20 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % This environment encloses each \GP{} input file. The single optional % argument gives the name of the file. % \begin{macrocode} -\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}} % \end{macrocode} % Open the \GP{} file. % \begin{macrocode} \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} % \end{macrocode} % append the defined prelude and write it out: @@ -622,20 +670,26 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % \begin{macrocode} \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} % \end{macrocode} % \end{macro} @@ -668,7 +722,7 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. \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] @@ -686,7 +740,7 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. {\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 @@ -694,7 +748,7 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. {\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.}}} % \end{macrocode} % \end{macro} @@ -733,13 +787,15 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. \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} % \end{macrocode} @@ -792,11 +848,13 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. \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} % \end{macrocode} % % Here intensive usage of UN*X text utils is made to extract the calculated @@ -811,10 +869,16 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % % \begin{macrocode} \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} +% \ifthenelse{\boolean{egp@oldgp}}{% +% \egpwrite{load "reset.gp"}}{% +% \egpwrite{reset}} + \egpwrite{}} % \end{macrocode} % \end{macro} % @@ -833,11 +897,12 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % avoid this but I don't know how. Any wizards out there? % \begin{macrocode} \newcommand{\egp@includevalue}[2]{% +% \InputIfFileExists{#1#2.val}{\ignorespaces}% \IfFileExists{#1#2.val}% {\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.}}} % \end{macrocode} % \end{macro} @@ -847,8 +912,8 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % \begin{macrocode} \newcommand{\egpshowval}[2][*]{% \def\egp@@name{#1}% - \def\egp@expression{#2} - \egp@calc + \def\egp@expression{#2}% + \egp@calc% \egp@includevalue{\theegpfile}{\theegpcalc}} % \end{macrocode} % \end{macro} @@ -870,10 +935,20 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % \end{macrocode} % \end{macro} % +% Define the file prelude: +% If the user specifies that the official version \GP{}-3.5 is used a file with +% the name |reset.gp| is generated at the start of the \GP{} run. Wherever a +% |reset| is done in the \GP{}-3.6 file this file is |load|ed instead. % \begin{macrocode} -\egpfigprelude{set terminal postscript eps monochrome dashed "Helvetica" 17} +\ifthenelse{\boolean{egp@oldgp}} + {\egpprelude{save "reset.gp"}} + {\relax} % \end{macrocode} % +% Define the default prelude for the figures: +% \begin{macrocode} +\egpfigprelude{set terminal postscript eps monochrome dashed "Helvetica" 17} +% \end{macrocode} % To get e.g. Computer Modern as font for the axis tics you can specify the % name of a CM-Type-1 font file as fontname option of the \GP{} postscript % terminal. @@ -885,12 +960,20 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % \end{quote} % To see the correct font in the Postscript file you have to use the % appropriate fontmap when calling dvips or you have to download the file -% |cmss17.pfb| as header file. The error message of dvips can then be ignored. +% |cmss17.pfb| as header file. The error message of dvips can then be +% ignored.\\ +% +% % % Reset all options to their default values after every |egp|, |egpx| and % |egpdef| environment. +% As mentioned above the file |reset.gp| that is generated at the start of the +% \GP{} run is |load|ed to implement the new |reset| command of \GP{}-3.6beta +% if the user didn't specify |gnuplot36beta| as package option. % \begin{macrocode} -\egpfigepilog{reset} +\ifthenelse{\boolean{egp@oldgp}}{% + \egpfigepilog{load "reset.gp"}}{% + \egpfigepilog{reset}} % \end{macrocode} % % You can configure \EGP{} by putting the appropriate commands in the file @@ -913,6 +996,7 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. %<*driver> \documentclass[a4paper]{article} \usepackage{doc} +\usepackage{multicol} % \end{macrocode} % % \begin{macrocode} @@ -927,7 +1011,8 @@ and get $\frac{\sqrt{2}}{2}=\fbox{\egpuseval{sin_quarter_pi}}$. % \end{macrocode} % % \begin{macrocode} -\usepackage{egplot} +\usepackage[gnuplot35]{egplot} +%\usepackage[gnuplot36beta]{egplot} % \end{macrocode} % \begin{macrocode} \setlength{\parindent}{0pt} |