summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/gnuplottex
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2006-11-03 06:16:00 +0000
committerNorbert Preining <preining@logic.at>2006-11-03 06:16:00 +0000
commita6d4e22f961008636a3bfc36f89570e6fa0c85f6 (patch)
tree9d13f81b2a37ab6bdf3336066017d4cb5e701011 /Master/texmf-dist/source/latex/gnuplottex
parente9b9a3f32d1a5b371fa2256f098ee4b158f6df1d (diff)
several updates (sorry Karl, it was a long train ride):
updates of packages: screenplay, bussproofs computational-complexity dvdcoll gnuplottex mathmode movie15 pgf pstricks-add pst-labo trfsigns (dvi->pdf move, COPYING file to doc) toptesi tocvsec2 thumb textfit (doc move) added to tpm-ctan-check: typogrid trsym trfsigns tracking toptesi toolbox todo tocvsec2 tocloft tocbibind titling titlefoot thumb textopo textfit teubner tensor git-svn-id: svn://tug.org/texlive/trunk@2382 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/gnuplottex')
-rw-r--r--Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx114
1 files changed, 39 insertions, 75 deletions
diff --git a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx
index b4ac6b8abea..fd8d857a6ee 100644
--- a/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx
+++ b/Master/texmf-dist/source/latex/gnuplottex/gnuplottex.dtx
@@ -42,8 +42,8 @@
%<package> \NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package> \ProvidesPackage{gnuplottex}
%<*package>
- [2006/04/02 v0.1 gnuplot graphs in LaTeX]
-\RequirePackage{graphicx,moreverb,keyval}
+ [2006/10/28 v0.2 gnuplot graphs in LaTeX]
+\RequirePackage{latexsym,graphicx,moreverb,keyval}
%</package>
%
%<*driver>
@@ -60,7 +60,7 @@
%</driver>
% \fi
%
-% \CheckSum{223}
+% \CheckSum{164}
%
% \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
@@ -80,6 +80,7 @@
%
%
% \changes{v0.1}{2006/04/02}{Initial version.}
+% \changes{v0.2}{2006/10/28}{Changed gnuplot output to LaTeX, simplified code.}
%
% \GetFileInfo{gnuplottex.dtx}
%
@@ -98,9 +99,9 @@
% The gnuplot code is extracted from the document and written to
% \texttt{.gnuplot}
% files. Then, if shell escape is used, the graph files are automatically
-% processed and converted to PostScript or PDF files, which will then be included. If
+% processed and converted to LaTeX files, which will then be included. If
% shell escape isn't used, the user will have to manually convert the
-% files.
+% files by running gnuplot on the extracted .gnuplot files.
%
% Shell escape is available in the web2c \TeX{} compiler, it allows the execution
% of shell code during the compilation of a \TeX{} document. It's disabled by
@@ -109,9 +110,8 @@
%
% \section{Requirements}
%
-% To use gnuplottex, you'll need the \texttt{graphicx}, \texttt{keyval} and
-% \texttt{moreverb} packages, epstopdf if you want to use the pdf
-% option, and of course, gnuplot.
+% To use gnuplottex, you'll need the \texttt{graphicx}, \texttt{latexsym},
+% \texttt{keyval} and \texttt{moreverb} packages and, of course, gnuplot.
%
% \section{Usage}
%
@@ -123,8 +123,6 @@
% \item[\oarg{noshell}] Don't use shell escape, graphs must be generated
% manually.
% \item[\oarg{miktex}] We're using mikTeX.
-% \item[\oarg{pdf}] PDF output, generate .pdf files of the graphs out of
-% .ps.
% \end{description}
%
% The following environments can be used to include graphs:
@@ -135,8 +133,9 @@
% The code necessary to write the plot to a file will be inserted by this
% package.
%
-% You may specify width or height of the picture using
-% [width=\meta{width}] or [height=\meta{height}] as in the \texttt{includegraphics} command.
+% You may specify a scaling factor for the graphs by adding the parameter after
+% the beginning of the environment, like so:
+% \verb=\begin{gnuplottex}=[scale=\meta{scale}]
%
% \StopEventually{}
%
@@ -146,12 +145,10 @@
% \begin{macrocode}
\newif\ifShellEscape
\newif\ifmiktex \miktexfalse
-\newif\ifpdf \pdffalse
\DeclareOption{shell}{\ShellEscapetrue}
\DeclareOption{noshell}{\ShellEscapefalse}
\DeclareOption{miktex}{\global\miktextrue}
-\DeclareOption{pdf}{\pdftrue}
\ExecuteOptions{shell}
\ProcessOptions\relax
@@ -187,9 +184,9 @@
\def\gnuplotverbatimwrite#1{%
\def\BeforeStream
- {\message{Opening gnuplot stream=\figname.gnuplot}%
- \immediate\write\verbatim@out{\string set terminal postscript eps enhanced}
- \immediate\write\verbatim@out{\string set output '\figname.eps'}
+ {\message{Opening gnuplot stream #1}%
+ \immediate\write\verbatim@out{\string set terminal latex}
+ \immediate\write\verbatim@out{\string set output '\figname.tex'}
}
\@bsphack
\immediate\openout \verbatim@out #1
@@ -202,16 +199,25 @@
\verbatim@start}
\def\endgnuplotverbatimwrite{%
\immediate\closeout\verbatim@out
- \@esphack}
+ \@esphack
+ \catcode`\\0
+ \catcode`\{1
+ \catcode`\}2
+ \catcode`\$3
+ \catcode`\&4
+ \catcode`\^^M5
+ \catcode`\#6
+ \catcode`\^7
+ \catcode`\_8
+ \catcode`\ 10
+ \catcode`\%14}
% \end{macrocode}
%
% \subsection{Environment definition}
% \begin{macrocode}
-\define@key{pic}{width}{\def\gnuplotwidth{#1}}
-\define@key{pic}{height}{\def\gnuplotheight{#1}}
+\define@key{pic}{scale}{\def\gnuplotscale{#1}}
\newenvironment{gnuplot}[1][]{\stepcounter{fignum}%
- \let\gnuplotwidth\undefined
- \let\gnuplotheight\undefined
+ \def\gnuplotscale{1}
\setkeys{pic}{#1}
\xdef\gnuplotCutFile{\figname.gnuplot}
\gnuplotverbatimwrite{\gnuplotCutFile}}
@@ -222,66 +228,24 @@
% \subsection{\texttt{.gnuplot} file processing}
% \begin{macrocode}
\long\gdef\gnuplotgraphicsprocess{%
- \ifShellEscape
+ \ifShellEscape
\IfFileExists{\figname.gnuplot}{%
\immediate\write18{gnuplot \figname.gnuplot}
- \IfFileExists{\figname.eps}{%
- \ifpdf
- \immediate\write18{epstopdf \figname.eps}
- \IfFileExists{\figname.pdf}{%
- \PackageInfo{gnuplottex}
- {\figname.gnuplot converted}}
- {\PackageWarningNoLine{gnuplottex}
- {Conversion of \figname.gnuplot failed.}}
- \else
- \PackageInfo{gnuplottex}
- {\figname.gnuplot converted}
- \fi}
- {\PackageWarningNoLine{gnuplottex}
- {Conversion of \figname.gnuplot failed.}}}{}
- \fi}
+ \IfFileExists{\figname.tex}{%
+ \PackageInfo{gnuplottex}
+ {\figname.gnuplot converted}}
+ {\PackageWarningNoLine{gnuplottex}
+ {Conversion of \figname.gnuplot failed.}}}{}
+ \fi}
% \end{macrocode}
%
% \subsection{Graph inclusion}
% \begin{macrocode}
\long\gdef\gnuplotgraphicsinclude{\gnuplotgraphicsprocess%
- \ifpdf
- \IfFileExists{\figname.pdf}{%
- \ifx\gnuplotwidth\undefined
- \ifx\gnuplotheight\undefined
- \includegraphics{\figname}
- \else
- \includegraphics[height=\gnuplotheight]{\figname}
- \fi
- \else
- \ifx\gnuplotheight\undefined
- \includegraphics[width=\gnuplotwidth]{\figname}
- \else
- \includegraphics[width=\gnuplotwidth,height=\gnuplotheight]{\figname}
- \fi
- \fi
- }
- {\PackageWarningNoLine{gnuplottex}
- {Please convert \figname.gnuplot manually}}
- \else
- \IfFileExists{\figname.eps}{%
- \ifx\gnuplotwidth\undefined
- \ifx\gnuplotheight\undefined
- \includegraphics{\figname}
- \else
- \includegraphics[height=\gnuplotheight]{\figname}
- \fi
- \else
- \ifx\gnuplotheight\undefined
- \includegraphics[width=\gnuplotwidth]{\figname}
- \else
- \includegraphics[width=\gnuplotwidth,height=\gnuplotheight]{\figname}
- \fi
- \fi
- }
- {\PackageWarningNoLine{gnuplottex}
- {Please convert \figname.gnuplot manually}}
- \fi
+ \IfFileExists{\figname.tex}{%
+ \scalebox{\gnuplotscale}{\input{\figname}}}
+ {\PackageWarningNoLine{gnuplottex}
+ {Please convert \figname.gnuplot manually}}
}
% \end{macrocode}
%