From ba9472aebfed07843bc4faa00c7b96bc86194691 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 4 Oct 2006 08:43:01 +0000 Subject: 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 --- Master/texmf-dist/tex/latex/dottex/dottex.sty | 153 +++++++++++++++++++++----- 1 file changed, 123 insertions(+), 30 deletions(-) (limited to 'Master/texmf-dist/tex/latex/dottex/dottex.sty') diff --git a/Master/texmf-dist/tex/latex/dottex/dottex.sty b/Master/texmf-dist/tex/latex/dottex/dottex.sty index 878f5065a2b..2465f7e2c75 100644 --- a/Master/texmf-dist/tex/latex/dottex/dottex.sty +++ b/Master/texmf-dist/tex/latex/dottex/dottex.sty @@ -41,21 +41,23 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{dottex} - [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} \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} @@ -69,15 +71,14 @@ \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} -\def\figname{\jobname-fig\thefignum} +\def\figname{\jobname-dottex-fig\thefignum} \def\dotverbatimwrite#1{% \def\BeforeStream @@ -116,52 +117,144 @@ \immediate\write\verbatim@out{/*{*/}} \immediate\closeout\verbatim@out \@esphack} -\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% \neatographicsinclude} \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} \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 } \endinput %% -- cgit v1.2.3