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/doc/latex/gnuplottex/gnuplottex.pdf | Bin 167418 -> 170018 bytes .../source/latex/gnuplottex/gnuplottex.dtx | 35 +++++++++++++++++++-- .../source/latex/gnuplottex/gnuplottex.ins | 4 +-- .../texmf-dist/tex/latex/gnuplottex/gnuplottex.sty | 28 +++++++++++++++-- 4 files changed, 60 insertions(+), 7 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/gnuplottex/gnuplottex.pdf b/Master/texmf-dist/doc/latex/gnuplottex/gnuplottex.pdf index 88c15c3eeaa..a0e2f3f4e04 100644 Binary files a/Master/texmf-dist/doc/latex/gnuplottex/gnuplottex.pdf and b/Master/texmf-dist/doc/latex/gnuplottex/gnuplottex.pdf differ diff --git a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx index cd4d9cf7c57..08e088d39ca 100644 --- a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx +++ b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (c) 2006-2012, Lars Kotthoff +% Copyright (c) 2006-2013, Lars Kotthoff % % Large portions copied from pdftex, % Copyright (c) 2001-3, Radhakrishnan CV @@ -42,7 +42,7 @@ % \NeedsTeXFormat{LaTeX2e}[1999/12/01] % \ProvidesPackage{gnuplottex} %<*package> - [2013/06/03 v0.5 gnuplot graphs in LaTeX] + [2013/06/28 v0.6 gnuplot graphs in LaTeX] \RequirePackage{latexsym,graphicx,moreverb,keyval,ifthen} % % @@ -60,7 +60,7 @@ % % \fi % -% \CheckSum{286} +% \CheckSum{355} % % \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 @@ -90,6 +90,7 @@ % \changes{v0.4.5}{2012/10/02}{Add support for cairolatex terminal (Mika Pfl\"uger).} % \changes{v0.4.6}{2013/04/14}{Fix bug with temporary file creation in LuaTeX (Henri Menke).} % \changes{v0.5}{2013/06/03}{Provide command to include gnuplot code in file verbatim (Michel Vo\ss{}kuhle).} +% \changes{v0.6}{2013/06/28}{Support for \texttt{siunitx} package and tikz terminal (Udo H\"ofel).} % % \GetFileInfo{gnuplottex.dtx} % @@ -137,6 +138,10 @@ % \item[\oarg{noshell}] Don't use shell escape, graphs must be generated % manually. % \item[\oarg{miktex}] We're using mikTeX. +% \item[\oarg{siunitx}] Use \texttt{siunitx} to typeset numbers in the +% graphs. You need to load the \texttt{siunitx} package before +% \texttt{gnuplottex} for this to work. If the gnuplot terminal does not +% support \TeX, a warning will be given and the functionality not used. % \end{description} % % The following environment can be used to include graphs: @@ -193,12 +198,14 @@ % \begin{macrocode} \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 @@ -235,11 +242,20 @@ % \begin{macrocode} \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 @@ -277,6 +293,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}} @@ -327,6 +344,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% } diff --git a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.ins b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.ins index 1abe863cb9a..deccc9b9378 100644 --- a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.ins +++ b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.ins @@ -1,5 +1,5 @@ %% -%% Copyright (c) 2006, Lars Kotthoff +%% Copyright (c) 2006-13, Lars Kotthoff %% %% Large portions copied from pdftex, %% Copyright (c) 2001-3, Radhakrishnan CV @@ -40,7 +40,7 @@ \preamble -Copyright (c) 2006, Lars Kotthoff +Copyright (c) 2006-13, Lars Kotthoff Large portions copied from pdftex, Copyright (c) 2001-3, Radhakrishnan CV 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