diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty b/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty index 31a27de5f2c..290c26d7465 100644 --- a/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty +++ b/Master/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty @@ -6,7 +6,7 @@ %% %% gnuplottex.dtx (with options: `package') %% -%% Copyright (c) 2006, Lars Kotthoff <metalhead@metalhead.ws> +%% Copyright (c) 2006-13, Lars Kotthoff <lars@larsko.org> %% %% Large portions copied from pdftex, %% Copyright (c) 2001-3, Radhakrishnan CV <cvr@river-valley.com> @@ -41,16 +41,18 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{gnuplottex} - [2013/06/03 v0.5 gnuplot graphs in LaTeX] + [2013/06/28 v0.6 gnuplot graphs in LaTeX] \RequirePackage{latexsym,graphicx,moreverb,keyval,ifthen} \newif\ifShellEscape \newif\ifmiktex \miktexfalse +\newif\ifusesiunitx \newwrite\verbatim@out \DeclareOption{shell}{\ShellEscapetrue} \DeclareOption{noshell}{\ShellEscapefalse} \DeclareOption{miktex}{\global\miktextrue} +\DeclareOption{siunitx}{\usesiunitxtrue} \ExecuteOptions{shell} \ProcessOptions\relax @@ -83,11 +85,20 @@ \newcounter{fignum} \def\figname{\jobname-gnuplottex-fig\thefignum} +\def\usesiunitxingnuplot{{\escapechar=-1\edef\percentforgnuplot{\string\%} + \escapechar=-1\edef\backslashforgnuplot{\string\\} + \immediate\write\verbatim@out{set format '\backslashforgnuplot num{\percentforgnuplot g}'}}} + \def\gnuplotverbatimwrite#1{% \def\BeforeStream {\message{Opening gnuplot stream #1}% \immediate\write\verbatim@out{\string set terminal \gnuplotterminal \gnuplotterminaloptions} \immediate\write\verbatim@out{\string set output '\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 + \relax + \fi } \@bsphack \immediate\openout \verbatim@out #1 @@ -121,6 +132,7 @@ \def\gnuplottexextension@pstex{\string tex} \def\gnuplottexextension@emtex{\string tex} \def\gnuplottexextension@jpeg{\string jpg} +\def\gnuplottexextension@tikz{\string tex} \def\gnuplottexextension#1{\@ifundefined{gnuplottexextension@#1}{#1}{\csname gnuplottexextension@#1\endcsname}} \define@key{pic}{scale}[1]{\def\gnuplotscale{#1}} \define@key{pic}{terminal}[latex]{\def\gnuplotterminal{#1}} @@ -159,6 +171,18 @@ \message{Opening gnuplot stream #1}% \immediate\write\verbatim@out{\string set terminal \gnuplotterminal \gnuplotterminaloptions}% \immediate\write\verbatim@out{\string set output '\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 + \relax + \fi + \ifusesiunitx + {\escapechar=-1\edef\percentforgnuplot{\string\%} + \escapechar=-1\edef\backslashforgnuplot{\string\\} + \immediate\write\verbatim@out{set format '\backslashforgnuplot num{\percentforgnuplot g}'}} + \else + \relax + \fi \immediate\write\verbatim@out{\string load '#2'}% \immediate\closeout\verbatim@out% } |