diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/gnuplottex')
-rw-r--r-- | Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty | 81 |
1 files changed, 23 insertions, 58 deletions
diff --git a/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty b/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty index e4427eee8dc..4fe162fc373 100644 --- a/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty +++ b/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty @@ -41,16 +41,14 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{gnuplottex} - [2006/04/02 v0.1 gnuplot graphs in LaTeX] -\RequirePackage{graphicx,moreverb,keyval} + [2006/10/28 v0.2 gnuplot graphs in LaTeX] +\RequirePackage{latexsym,graphicx,moreverb,keyval} \newif\ifShellEscape \newif\ifmiktex \miktexfalse -\newif\ifpdf \pdffalse \DeclareOption{shell}{\ShellEscapetrue} \DeclareOption{noshell}{\ShellEscapefalse} \DeclareOption{miktex}{\global\miktextrue} -\DeclareOption{pdf}{\pdftrue} \ExecuteOptions{shell} \ProcessOptions\relax @@ -82,9 +80,9 @@ \def\gnuplotverbatimwrite#1{% \def\BeforeStream - {\message{Opening gnuplot stream=\figname.gnuplot}% - \immediate\write\verbatim@out{\string set terminal postscript eps enhanced} -\immediate\write\verbatim@out{\string set output '\figname.eps'} + {\message{Opening gnuplot stream #1}% + \immediate\write\verbatim@out{\string set terminal latex} +\immediate\write\verbatim@out{\string set output '\figname.tex'} } \@bsphack \immediate\openout \verbatim@out #1 @@ -97,74 +95,41 @@ \verbatim@start} \def\endgnuplotverbatimwrite{% \immediate\closeout\verbatim@out - \@esphack} -\define@key{pic}{width}{\def\gnuplotwidth{#1}} -\define@key{pic}{height}{\def\gnuplotheight{#1}} + \@esphack +\catcode`\\0 +\catcode`\{1 +\catcode`\}2 +\catcode`\$3 +\catcode`\&4 +\catcode`\^^M5 +\catcode`\#6 +\catcode`\^7 +\catcode`\_8 +\catcode`\ 10 +\catcode`\%14} +\define@key{pic}{scale}{\def\gnuplotscale{#1}} \newenvironment{gnuplot}[1][]{\stepcounter{fignum}% -\let\gnuplotwidth\undefined -\let\gnuplotheight\undefined +\def\gnuplotscale{1} \setkeys{pic}{#1} \xdef\gnuplotCutFile{\figname.gnuplot} \gnuplotverbatimwrite{\gnuplotCutFile}} {\endgnuplotverbatimwrite% \gnuplotgraphicsinclude} \long\gdef\gnuplotgraphicsprocess{% - \ifShellEscape +\ifShellEscape \IfFileExists{\figname.gnuplot}{% \immediate\write18{gnuplot \figname.gnuplot} -\IfFileExists{\figname.eps}{% -\ifpdf -\immediate\write18{epstopdf \figname.eps} -\IfFileExists{\figname.pdf}{% +\IfFileExists{\figname.tex}{% \PackageInfo{gnuplottex} {\figname.gnuplot converted}} {\PackageWarningNoLine{gnuplottex} -{Conversion of \figname.gnuplot failed.}} -\else -\PackageInfo{gnuplottex} -{\figname.gnuplot converted} -\fi} -{\PackageWarningNoLine{gnuplottex} {Conversion of \figname.gnuplot failed.}}}{} \fi} \long\gdef\gnuplotgraphicsinclude{\gnuplotgraphicsprocess% -\ifpdf -\IfFileExists{\figname.pdf}{% -\ifx\gnuplotwidth\undefined -\ifx\gnuplotheight\undefined -\includegraphics{\figname} -\else -\includegraphics[height=\gnuplotheight]{\figname} -\fi -\else -\ifx\gnuplotheight\undefined -\includegraphics[width=\gnuplotwidth]{\figname} -\else -\includegraphics[width=\gnuplotwidth,height=\gnuplotheight]{\figname} -\fi -\fi -} +\IfFileExists{\figname.tex}{% +\scalebox{\gnuplotscale}{\input{\figname}}} {\PackageWarningNoLine{gnuplottex} {Please convert \figname.gnuplot manually}} -\else -\IfFileExists{\figname.eps}{% -\ifx\gnuplotwidth\undefined -\ifx\gnuplotheight\undefined -\includegraphics{\figname} -\else -\includegraphics[height=\gnuplotheight]{\figname} -\fi -\else -\ifx\gnuplotheight\undefined -\includegraphics[width=\gnuplotwidth]{\figname} -\else -\includegraphics[width=\gnuplotwidth,height=\gnuplotheight]{\figname} -\fi -\fi -} -{\PackageWarningNoLine{gnuplottex} -{Please convert \figname.gnuplot manually}} -\fi } \endinput %% |