From e9d6d57d90449717e3a5a70e914275379a3dee6b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 11 Dec 2015 23:19:08 +0000 Subject: gnuplottex (11dec15) git-svn-id: svn://tug.org/texlive/trunk@39082 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/gnuplottex/gnuplottex.dtx | 51 +++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/source/latex/gnuplottex') diff --git a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx index bfb90c8b120..a624cb41d27 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-2013, Lars Kotthoff and contributors +% Copyright (c) 2006-2015, Lars Kotthoff and contributors % % Large portions copied from pdftex, % Copyright (c) 2001-3, Radhakrishnan CV @@ -42,8 +42,8 @@ % \NeedsTeXFormat{LaTeX2e}[1999/12/01] % \ProvidesPackage{gnuplottex} %<*package> - [2013/11/24 v0.8 gnuplot graphs in LaTeX] -\RequirePackage{latexsym,graphicx,moreverb,keyval,ifthen} + [2015/12/08 v0.9 gnuplot graphs in LaTeX] +\RequirePackage{graphicx,moreverb,keyval,ifthen,catchfile} % % %<*driver> @@ -67,7 +67,7 @@ % % \fi % -% \CheckSum{412} +% \CheckSum{452} % % \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 @@ -102,6 +102,8 @@ % \changes{v0.7.1}{2013/09/08}{Fix bug with subfolder option with MikTeX (Thomas Schmid).} % \changes{v0.7.2}{2013/11/16}{Allow to specify path to gnuplot (Manuel Solano).} % \changes{v0.8}{2013/11/24}{Extended Documentation.} +% \changes{v0.8.1}{2013/12/29}{Extended Documentation.} +% \changes{v0.9}{2015/12/08}{Show any errors during conversion on Unix (Enrico Gregorio, suggested by Udo H\"ofel).} % % \GetFileInfo{gnuplottex.dtx} % @@ -613,6 +615,31 @@ %\verb- while its offset is $c=\num{\gpgetvar{c}}$.}%-\\ %\verb+ \label{pic:tikz}%+\\ %\verb+\end{figure}%+\\ +% As compiling all pictures everytime can take quite a long time, the \texttt{tikz}-package offers the possibility to externalize the pictures, resulting in a great speedup. +% An example for Lua\TeX{} is shown below, pictures are not generated if they are up-to-date. +% In the preamble write:\\ +% \verb+\usepackage{tikz} +\\ +% \verb+\usetikzlibrary{external}+\\ +% \verb+\tikzexternalize[prefix=gnuplottex/] %-- Use the gnuplottex-subfolder. Deactivate+\\ +%\verb+ %-- the subfolderoption of gnuplottex to use!+\\ +% \verb+\tikzset{external/system call={lualatex -shell-escape -halt-on-error+\\ +% \verb+-interaction=batchmode -jobname "\image" "\texsource"}}+\\ +% \verb+\tikzexternalize+\\ +% In the document, write e.\,g.:\\ +% \verb+\begin{figure}%+\\ +% \verb+ \centering%+\\ +% \verb+ \tikzsetnextfilename{ThisIsASinus}+\\ +% \verb+ \begin{tikzpicture}[gnuplot]+\\ +% \verb+ \begin{gnuplot}[terminal=tikz, terminaloptions=color dashed nopicenvironment]+\\ +%\verb+ set grid xtics mxtics lt 0 ls 0+\\ +%\verb+ set grid ytics mytics lt 0 ls 0+\\ +%\verb+ set key box top left+\\ +%\verb+ plot sin(x) w l t 'Sinus'+\\ +% \verb+ \end{gnuplot}+\\ +% \verb+ \end{tikzpicture}+\\ +% \verb+ \caption{Captiontext.}%+\\ +% \verb+ \label{pic:ThisIsASinus}%+\\ +%\verb+\end{figure}%+\\ % % \DescribeMacro{pstex,pslatex,pstricks} % The \texttt{pstex}- and \texttt{pslatex}-terminal produces unusable output with pdf\TeX. @@ -667,6 +694,7 @@ \else \IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse} \immediate\write18{rm -f \tmpfile} + \immediate\write18{rm -f "\jobname.gnuploterrors"} \fi \fi @@ -784,7 +812,11 @@ \long\gdef\gnuplotgraphicsprocess{% \ifShellEscape \IfFileExists{\subfolder\figname.gnuplot}{% - \immediate\write18{\gnuplotexe\space \subfolder\figname.gnuplot} + \ifmiktex + \immediate\write18{\gnuplotexe\space \subfolder\figname.gnuplot} + \else + \immediate\write18{\gnuplotexe\space \subfolder\figname.gnuplot\space 2>>\jobname.gnuploterrors} + \fi \IfFileExists{\subfolder\figname.\extension}{% \PackageInfo{gnuplottex}{\subfolder\figname.gnuplot converted} \ifcleanup @@ -798,6 +830,15 @@ {\PackageWarningNoLine{gnuplottex} {Conversion of \subfolder\figname.gnuplot failed}}}{} \fi} +\long\def\gnuploterrors@eatpar#1#2\@nil{\def\gnuploterrors@{#2}} +\AtEndDocument{% + \CatchFileDef\gnuploterrors@{\jobname.gnuploterrors}{\endlinechar=`^^J \catcode`\ =12 }% + \expandafter\gnuploterrors@eatpar\gnuploterrors@\@nil + \ifx\gnuploterrors@\@empty\else + \PackageWarningNoLine{gnuplottex}{Gnuplot execution produced errors:^^J% + \detokenize\expandafter{\gnuploterrors@}}% + \fi +} % \end{macrocode} % % \subsection{Graph inclusion} -- cgit v1.2.3