summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/dottex
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2006-10-04 08:43:01 +0000
committerNorbert Preining <preining@logic.at>2006-10-04 08:43:01 +0000
commitba9472aebfed07843bc4faa00c7b96bc86194691 (patch)
tree4a952a012e2f1663beaac6384dec265fb50dd361 /Master/texmf-dist/source/latex/dottex
parenta88bdfe70c672cfced299babf0a54881a916bcca (diff)
Fix ctan2tds for pgf installation
comment powerdot-doc-vn in tpm-ctan-check, it always breaks Update of the following packages: labelcas pstricks-add sectionbox ltxmisc frenchle flowfram verse emulateapj pst-pdf poemscol babelbib dk-bib breakurl screenplay ncctools xkeyval bibleref muthesis pst-labo pgf ncclatex active-conf xcolor commath lineno dottex makeplo git-svn-id: svn://tug.org/texlive/trunk@2240 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/dottex')
-rw-r--r--Master/texmf-dist/source/latex/dottex/dottex.dtx176
1 files changed, 138 insertions, 38 deletions
diff --git a/Master/texmf-dist/source/latex/dottex/dottex.dtx b/Master/texmf-dist/source/latex/dottex/dottex.dtx
index 5d41805b792..d1877d5451e 100644
--- a/Master/texmf-dist/source/latex/dottex/dottex.dtx
+++ b/Master/texmf-dist/source/latex/dottex/dottex.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (c) 2005, Lars Kotthoff <metalhead@metalhead.ws>
+% Copyright (c) 2005-2006, Lars Kotthoff <metalhead@metalhead.ws>
%
% Large portions copied from pdftex,
% Copyright (c) 2001-3, Radhakrishnan CV <cvr@river-valley.com>
@@ -42,8 +42,8 @@
%<package> \NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package> \ProvidesPackage{dottex}
%<*package>
- [2005/08/13 v0.2 dot/neato graphs in LaTeX]
-\RequirePackage{graphicx,moreverb}
+ [2006/04/02 v0.5 dot/neato graphs in LaTeX]
+\RequirePackage{graphicx,moreverb,keyval}
%</package>
%
%<*driver>
@@ -60,7 +60,7 @@
%</driver>
% \fi
%
-% \CheckSum{217}
+% \CheckSum{387}
%
% \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
@@ -79,8 +79,12 @@
% Right brace \} Tilde \~}
%
%
-% \changes{v0.1}{2005/08/06}{Initial version}
-% \changes{v0.2}{2005/08/13}{New way to set graph width, neatopic environment}
+% \changes{v0.1}{2005/08/06}{Initial version.}
+% \changes{v0.2}{2005/08/13}{New way to set graph width, neatopic environment.}
+% \changes{v0.3}{2005/11/16}{Added pdf option to package.}
+% \changes{v0.4}{2006/01/23}{Changed pdf support to ps -> eps -> pdf conversion.
+% Fixed bugs.}
+% \changes{v0.5}{2006/04/02}{Added keyval interface for picture dimensions.}
%
% \GetFileInfo{dottex.dtx}
%
@@ -113,8 +117,9 @@
%
% \section{Requirements}
%
-% To use dottex, you'll need the \texttt{graphicx} and \texttt{moreverb}
-% packages, and of course, dot.
+% To use dottex, you'll need the \texttt{graphicx}, \texttt{keyval} and
+% \texttt{moreverb} packages, ps2epsi and epstopdf if you want to use the pdf
+% option, and of course, dot / neato.
%
% \section{Usage}
%
@@ -126,6 +131,8 @@
% \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:
@@ -142,8 +149,8 @@
% The \texttt{graph} preamble and the surrounding braces are inserted
% automatically.
%
-% The width of the graph in your document can be controlled via the
-% \verb=\dotwidth= parameter, which is set to \verb=\textwidth= by default.
+% For both environments, you may specify width or height of the picture using
+% [width=\meta{width}] or [height=\meta{height}] as in the \texttt{includegraphics} command.
%
% \StopEventually{}
%
@@ -153,17 +160,19 @@
% \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
%% test if shell escape really works
\ifShellEscape
\def\tmpfile{/tmp/w18-test-\the\year\the\month\the\day\the\time}
- \ifmiktex%
+ \ifmiktex
\immediate\write18{rem >"\tmpfile"}
\else
\immediate\write18{touch \tmpfile}
@@ -177,19 +186,18 @@
\ifShellEscape
\PackageInfo{dottex}
- {Automatically converting dot/neato files to ps}
+ {Automatically converting dot/neato files}
\else
\PackageWarningNoLine{dottex}
{Shell escape not enabled.\MessageBreak
- You'll need to convert the graphs yourself}
+ You'll need to convert the graphs yourself.}
\fi
\newcounter{fignum}
-\gdef\dotwidth{\textwidth}
% \end{macrocode}
%
% \subsection{\texttt{.dot}/\texttt{.neato} write out}
% \begin{macrocode}
-\def\figname{\jobname-fig\thefignum}
+\def\figname{\jobname-dottex-fig\thefignum}
\def\dotverbatimwrite#1{%
\def\BeforeStream
@@ -236,13 +244,21 @@
%
% \subsection{Environment definition}
% \begin{macrocode}
-\newenvironment{dotpic}{\stepcounter{fignum}%
+\define@key{pic}{width}{\def\dotwidth{#1}}
+\define@key{pic}{height}{\def\dotheight{#1}}
+\newenvironment{dotpic}[1][]{\stepcounter{fignum}%
+ \let\dotwidth\undefined
+ \let\dotheight\undefined
+ \setkeys{pic}{#1}
\xdef\dotCutFile{\figname.dot}
\dotverbatimwrite{\dotCutFile}}
{\enddotverbatimwrite%
\dotgraphicsinclude}
-\newenvironment{neatopic}{\stepcounter{fignum}%
+\newenvironment{neatopic}[1][]{\stepcounter{fignum}%
+ \let\dotwidth\undefined
+ \let\dotheight\undefined
+ \setkeys{pic}{#1}
\xdef\neatoCutFile{\figname.neato}
\neatoverbatimwrite{\neatoCutFile}}
{\endneatoverbatimwrite%
@@ -253,43 +269,127 @@
% \begin{macrocode}
\long\gdef\dotgraphicsprocess{%
\ifShellEscape
- \IfFileExists{\figname.dot}{%
- \immediate\write18{dot -Tps -o \figname.ps \figname.dot}
- \IfFileExists{\figname.ps}{%
- \PackageInfo{dottex}
- {\figname.dot converted}}
- {\PackageWarningNoLine{dottex}
- {Conversion of \figname.dot failed.}}}{}
- \fi}
+ \IfFileExists{\figname.dot}{%
+ \immediate\write18{dot -Tps -o \figname.ps \figname.dot}
+ \IfFileExists{\figname.ps}{%
+ \ifpdf
+ \immediate\write18{ps2epsi \figname.ps \figname.eps}
+ \immediate\write18{epstopdf \figname.eps}
+ \IfFileExists{\figname.pdf}{%
+ \PackageInfo{dottex}
+ {\figname.dot converted}}
+ {\PackageWarningNoLine{dottex}
+ {Conversion of \figname.dot failed.}}
+ \else
+ \PackageInfo{dottex}
+ {\figname.dot converted}
+ \fi}
+ {\PackageWarningNoLine{dottex}
+ {Conversion of \figname.dot failed.}}}{}
+ \fi}
\long\gdef\neatographicsprocess{%
\ifShellEscape
\IfFileExists{\figname.neato}{%
\immediate\write18{neato -Tps -o \figname.ps \figname.neato}
\IfFileExists{\figname.ps}{%
- \PackageInfo{dottex}
- {\figname.neato converted}}
+ \ifpdf
+ \immediate\write18{ps2epsi \figname.ps \figname.eps}
+ \immediate\write18{epstopdf \figname.eps}
+ \IfFileExists{\figname.pdf}{%
+ \PackageInfo{dottex}
+ {\figname.dot converted}}
+ {\PackageWarningNoLine{dottex}
+ {Conversion of \figname.dot failed.}}
+ \else
+ \PackageInfo{dottex}
+ {\figname.neato converted}
+ \fi}
{\PackageWarningNoLine{dottex}
{Conversion of \figname.neato failed.}}}{}
- \fi}
+ \fi}
% \end{macrocode}
%
% \subsection{Graph inclusion}
% \begin{macrocode}
\long\gdef\dotgraphicsinclude{\dotgraphicsprocess%
- \IfFileExists{\figname.ps}{%
- \includegraphics[width=\dotwidth]{\figname}
- }
- {\PackageWarningNoLine{dottex}
- {Please convert \figname.dot manually}}
+ \ifpdf
+ \IfFileExists{\figname.pdf}{%
+ \ifx\dotwidth\undefined
+ \ifx\dotheight\undefined
+ \includegraphics{\figname}
+ \else
+ \includegraphics[height=\dotheight]{\figname}
+ \fi
+ \else
+ \ifx\dotheight\undefined
+ \includegraphics[width=\dotwidth]{\figname}
+ \else
+ \includegraphics[width=\dotwidth,height=\dotheight]{\figname}
+ \fi
+ \fi
+ }
+ {\PackageWarningNoLine{dottex}
+ {Please convert \figname.dot manually}}
+ \else
+ \IfFileExists{\figname.ps}{%
+ \ifx\dotwidth\undefined
+ \ifx\dotheight\undefined
+ \includegraphics{\figname}
+ \else
+ \includegraphics[height=\dotheight]{\figname}
+ \fi
+ \else
+ \ifx\dotheight\undefined
+ \includegraphics[width=\dotwidth]{\figname}
+ \else
+ \includegraphics[width=\dotwidth,height=\dotheight]{\figname}
+ \fi
+ \fi
+ }
+ {\PackageWarningNoLine{dottex}
+ {Please convert \figname.dot manually}}
+ \fi
}
\long\gdef\neatographicsinclude{\neatographicsprocess%
- \IfFileExists{\figname.ps}{%
- \includegraphics[width=\dotwidth]{\figname}
- }
- {\PackageWarningNoLine{dottex}
- {Please convert \figname.neato manually}}
+ \ifpdf
+ \IfFileExists{\figname.pdf}{%
+ \ifx\dotwidth\undefined
+ \ifx\dotheight\undefined
+ \includegraphics{\figname}
+ \else
+ \includegraphics[height=\dotheight]{\figname}
+ \fi
+ \else
+ \ifx\dotheight\undefined
+ \includegraphics[width=\dotwidth]{\figname}
+ \else
+ \includegraphics[width=\dotwidth,height=\dotheight]{\figname}
+ \fi
+ \fi
+ }
+ {\PackageWarningNoLine{dottex}
+ {Please convert \figname.neato manually}}
+ \else
+ \IfFileExists{\figname.ps}{%
+ \ifx\dotwidth\undefined
+ \ifx\dotheight\undefined
+ \includegraphics{\figname}
+ \else
+ \includegraphics[height=\dotheight]{\figname}
+ \fi
+ \else
+ \ifx\dotheight\undefined
+ \includegraphics[width=\dotwidth]{\figname}
+ \else
+ \includegraphics[width=\dotwidth,height=\dotheight]{\figname}
+ \fi
+ \fi
+ }
+ {\PackageWarningNoLine{dottex}
+ {Please convert \figname.neato manually}}
+ \fi
}
% \end{macrocode}
%