summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gnuplottex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-04-12 22:31:14 +0000
committerKarl Berry <karl@freefriends.org>2020-04-12 22:31:14 +0000
commitcccfc34acdcf78c43f347ada30968db554b62137 (patch)
treee490dcf13fe3b50e09b26fcea3b902752e14702a /Master/texmf-dist/tex/latex/gnuplottex
parenta5cafa2e169673754d52e2d03e2746fb8684968f (diff)
gnuplottex
git-svn-id: svn://tug.org/texlive/trunk@54711 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gnuplottex')
-rw-r--r--Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty80
1 files changed, 41 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty b/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty
index aa89d55390a..0acabce327f 100644
--- a/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty
+++ b/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty
@@ -20,7 +20,7 @@
%%
%% Antoine Chambert-Loir
%% <chambert@math.polytechnique.fr>
-%% http://www.math.polytechnique.fr/\protect \unhbox \voidb@x \penalty \@M \ {}chambert
+%% http://www.math.polytechnique.fr/\protect \unhbox \voidb@x \protect \penalty \@M \ {}chambert
%%
%% Ecole polytechnique, Palaiseau Cedex, France
%%
@@ -41,7 +41,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{gnuplottex}
- [2019/12/22 v0.9.4 gnuplot graphs in LaTeX]
+ [2020/03/19 v0.9.5 gnuplot graphs in LaTeX]
\RequirePackage{graphicx,moreverb,keyval,ifthen,catchfile}
\newif\ifShellEscape
\newif\ifmiktex \miktexfalse
@@ -71,7 +71,7 @@
\immediate\write18{touch \tmpfile}
\fi
\ifmiktex
-\IfFileExists{\tmpfile.}{\ShellEscapetrue}{\ShellEscapefalse}
+\IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse}
\immediate\write18{del "\tmpfile"}
\else
\IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse}
@@ -81,37 +81,39 @@
\fi
\ifusesubfolder
- \ifmiktex
- \immediate\write18{mkdir gnuplottex}
- \immediate\write18{echo test > "gnuplottex/\tmpfile"}
- \else
- \immediate\write18{mkdir -p "gnuplottex"}
- \immediate\write18{touch "gnuplottex/\tmpfile"}
- \fi
- \IfFileExists{gnuplottex/\tmpfile}{
+ \def\subfolder{gnuplottex}
+ \ifShellEscape
\ifmiktex
- \immediate\write18{del "gnuplottex\@backslashchar\tmpfile"}
+ \immediate\write18{mkdir \subfolder}
+ \immediate\write18{echo test > "\subfolder/\tmpfile"}
\else
- \immediate\write18{rm -f "gnuplottex/\tmpfile"}
+ \immediate\write18{mkdir -p "\subfolder"}
+ \immediate\write18{touch "\subfolder/\tmpfile"}
\fi
- \def\subfolder{gnuplottex/}
- }{
- \PackageWarningNoLine{gnuplottex}
- {Creation of subfolder failed.\MessageBreak
- You'll need to create the folder yourself}
- \def\subfolder{}
- }
+ \IfFileExists{gnuplottex/\tmpfile}{
+ \ifmiktex
+ \immediate\write18{del "\subfolder\@backslashchar\tmpfile"}
+ \else
+ \immediate\write18{rm -f "\subfolder/\tmpfile"}
+ \fi
+ }{
+ \PackageWarningNoLine{gnuplottex}
+ {Creation of subfolder failed.\MessageBreak
+ You'll need to create the folder yourself}
+ \def\subfolder{}
+ }
+ \fi
\else
- \def\subfolder{}
+ \def\subfolder{.}
\fi
\ifShellEscape
\PackageInfo{gnuplottex}
- {Automatically converting gnuplot files.}
+ {Automatically converting gnuplot files}
\else
\PackageWarningNoLine{gnuplottex}
{Shell escape not enabled.\MessageBreak
- You'll need to convert the graphs yourself.}
+ You'll need to convert the graphs yourself}
\fi
\newcounter{fignum}
\def\figname{\jobname-gnuplottex-fig\thefignum}
@@ -122,7 +124,7 @@
\def\BeforeStream
{\message{Opening gnuplot stream #1}%
\immediate\write\verbatim@out{\string set terminal \gnuplotterminal \gnuplotterminaloptions}%
-\immediate\write\verbatim@out{\string set output '\subfolder\figname.\gnuplottexextension{\gnuplotterminal}'}%
+\immediate\write\verbatim@out{\string set output '\subfolder/\figname.\gnuplottexextension{\gnuplotterminal}'}%
\ifusesiunitx
\ifthenelse{\equal{\extension}{\string tex}}{\usesiunitxingnuplot}{\PackageWarningNoLine{gnuplottex}{Axis numbers not written in \noexpand\num{}. Use a terminal that allows TeX output to enable this feature.}}
\else
@@ -172,7 +174,7 @@
\def\gnuplotterminaloptions{}%%
\def\gnuplotscale{1}%%
\setkeys{pic}{#1}%%
- \xdef\gnuplotCutFile{\subfolder\figname.gnuplot}%%
+ \xdef\gnuplotCutFile{\subfolder/\figname.gnuplot}%%
\gnuplotverbatimwrite{\gnuplotCutFile}}
{\endgnuplotverbatimwrite%
\gnuplotgraphicsprocess%
@@ -180,24 +182,24 @@
\def\extension{\gnuplottexextension{\gnuplotterminal}}
\long\gdef\gnuplotgraphicsprocess{%
\ifShellEscape%
-\IfFileExists{\subfolder\figname.gnuplot}{%
+\IfFileExists{\subfolder/\figname.gnuplot}{%
\ifmiktex
- \immediate\write18{\gnuplotexe\space \subfolder\figname.gnuplot}%
+ \immediate\write18{\gnuplotexe\space \subfolder/\figname.gnuplot}%
\else
- \immediate\write18{\gnuplotexe\space \subfolder\figname.gnuplot\space 2>>\jobname.gnuploterrors}%
+ \immediate\write18{\gnuplotexe\space \subfolder/\figname.gnuplot\space 2>>\jobname.gnuploterrors}%
\fi%
-\IfFileExists{\subfolder\figname.\extension}{%
-\PackageInfo{gnuplottex}{\subfolder\figname.gnuplot converted}%
+\IfFileExists{\subfolder/\figname.\extension}{%
+\PackageInfo{gnuplottex}{\subfolder/\figname.gnuplot converted}%
\ifcleanup
\ifmiktex
- \immediate\write18{del "\subfolder\figname.gnuplot"}%
+ \immediate\write18{del "\subfolder/\figname.gnuplot"}%
\else
- \immediate\write18{rm -f "\subfolder\figname.gnuplot"}%
+ \immediate\write18{rm -f "\subfolder/\figname.gnuplot"}%
\fi%
\fi%
}
{\PackageWarningNoLine{gnuplottex}
-{Conversion of \subfolder\figname.gnuplot failed}}}{}%
+{Conversion of \subfolder/\figname.gnuplot failed}}}{}%
\fi}
\long\def\gnuploterrors@eatpar#1#2\@nil{\def\gnuploterrors@{#2}}
\AtEndDocument{%
@@ -214,19 +216,19 @@
\fi
}
\long\gdef\gnuplotgraphicsinclude{%
-\IfFileExists{\subfolder\figname.\extension}{%
+\IfFileExists{\subfolder/\figname.\extension}{%
\ifthenelse{\equal{\extension}{\string tex}}
-{\scalebox{\gnuplotscale}{\input{\subfolder\figname.\extension}}}
-{\includegraphics[scale=\gnuplotscale]{\subfolder\figname.\extension}}
+{\scalebox{\gnuplotscale}{\input{\subfolder/\figname.\extension}}}
+{\includegraphics[scale=\gnuplotscale]{\subfolder/\figname.\extension}}
}
{\PackageWarningNoLine{gnuplottex}
-{Please convert \subfolder\figname.gnuplot manually}}
+{Please convert \subfolder/\figname.gnuplot manually}}
}
\newcommand{\gnuplotloadfilewrite}[2]{%
\immediate\openout \verbatim@out #1%
\message{Opening gnuplot stream #1}%
\immediate\write\verbatim@out{\string set terminal \gnuplotterminal \gnuplotterminaloptions}%
- \immediate\write\verbatim@out{\string set output '\subfolder\figname.\gnuplottexextension{\gnuplotterminal}'}%
+ \immediate\write\verbatim@out{\string set output '\subfolder/\figname.\gnuplottexextension{\gnuplotterminal}'}%
\ifusesiunitx
\ifthenelse{\equal{\extension}{\string tex}}{\usesiunitxingnuplot}{\PackageWarningNoLine{gnuplottex}{Axis numbers not written in \noexpand\num{}. Use a terminal that allows TeX output to enable this feature.}}
\else
@@ -249,7 +251,7 @@
\def\gnuplotterminaloptions{}
\def\gnuplotscale{1}
\setkeys{pic}{#1}
- \xdef\gnuplotCutFile{\subfolder\figname.gnuplot}
+ \xdef\gnuplotCutFile{\subfolder/\figname.gnuplot}
\gnuplotloadfilewrite{\gnuplotCutFile}{#2}
\gnuplotgraphicsprocess%
\gnuplotgraphicsinclude