From 88e051a93354de16d70848287cf906503c3032e9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 2 Jul 2013 22:50:16 +0000 Subject: gnuplottex (2jul13) git-svn-id: svn://tug.org/texlive/trunk@31074 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/gnuplottex/gnuplottex.sty | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/tex/latex') 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 +%% Copyright (c) 2006-13, Lars Kotthoff %% %% Large portions copied from pdftex, %% Copyright (c) 2001-3, Radhakrishnan CV @@ -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% } -- cgit v1.2.3