summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/abc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-03-08 23:20:19 +0000
committerKarl Berry <karl@freefriends.org>2008-03-08 23:20:19 +0000
commitd6767c07e4b1da71175894668d79303343af63f2 (patch)
tree69c2d7056589eff6b2dbc3a49bced1220eb06c08 /Master/texmf-dist/tex/latex/abc
parent528aaa7971899a4d43d0b074b87872929e004cf9 (diff)
abc 2 (8mar08)
git-svn-id: svn://tug.org/texlive/trunk@6902 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/abc')
-rw-r--r--Master/texmf-dist/tex/latex/abc/abc.sty98
-rw-r--r--Master/texmf-dist/tex/latex/abc/mup.sty27
2 files changed, 104 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/abc/abc.sty b/Master/texmf-dist/tex/latex/abc/abc.sty
index 6c8322900bf..6251b0cc5df 100644
--- a/Master/texmf-dist/tex/latex/abc/abc.sty
+++ b/Master/texmf-dist/tex/latex/abc/abc.sty
@@ -6,7 +6,7 @@
%%
%% abc.dtx (with options: `package')
%%
-%% Copyright 2006 Enrico Gregorio
+%% Copyright 2006, 2008 Enrico Gregorio
%%
%% This program is provided under the terms of the
%% LaTeX Project Public License distributed from CTAN
@@ -19,29 +19,54 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{abc}
- [2006/03/22 v1.0 Enrico Gregorio]
+ [2008/03/03 v2.0 Enrico Gregorio]
+
\newif\ifabc@shellescape
\newif\ifabc@generate
\newif\ifabc@warning
-\DeclareOption{noshellescape}{\abc@shellescapefalse\abc@warningtrue}
+\newif\ifabc@saveall
+\newif\ifabc@mup
+\DeclareOption{mup}{\abc@muptrue}
+\DeclareOption{noshellescape}{\abc@shellescapefalse\abc@warningtrue
+ \abc@savealltrue}
\DeclareOption{shellescape}{\abc@shellescapetrue}
\DeclareOption{nogenerate}{\abc@generatefalse}
\DeclareOption{generate}{\abc@generatetrue}
+\DeclareOption{nosaveall}{\abc@saveallfalse}
+\DeclareOption{saveall}{\abc@savealltrue}
\def\abc@epsext{eps}
\DeclareOption{ps2eps}{\def\abc@pscmd{ps2eps -f}}
\DeclareOption{ps2epsi}{\def\abc@pscmd{ps2epsi}\def\abc@epsext{epsi}}
\DeclareOption{ps2epsidos}{\def\abc@pscmd{ps2epsi}\def\abc@epsext{epi}}
-\ExecuteOptions{generate,shellescape,ps2eps}
+\ExecuteOptions{generate,shellescape,nosaveall,ps2eps}
\ProcessOptions\relax
\RequirePackage{verbatim}
\RequirePackage{keyval}
\RequirePackage{graphicx}
\RequirePackage{ifpdf}
+\newif\ifabc@unprocessedfiles
+\newcounter{abc@count}
+\ifabc@mup
+\newcommand{\abc@cmd}{mup} % virtually no choice
+\newcommand{\abc@parm}{-F} % -F MUST stay
+\newcommand{\abc@epstopdfcmd}{epstopdf}
+\newcommand{\abc@pdfext}{pdf}
+\def\normalabcoutputfile{out-mup}
+\def\normalmupoutputfile{\normalabcoutputfile}
+\def\mup{\abc}
+\def\endmup{\endabc}
+\def\mupinput{\abcinput}
+\def\abc@ext{.mup}
+\def\abc@packagename{mup}
+\else
\newcommand{\abc@cmd}{abcm2ps} % virtually no choice
\newcommand{\abc@parm}{-O= -c} % -O= MUST stay
\newcommand{\abc@epstopdfcmd}{epstopdf}
\newcommand{\abc@pdfext}{pdf}
\def\normalabcoutputfile{out-abc}
+\def\abc@ext{.abc}
+\def\abc@packagename{abc}
+\fi
\def\abc@tempfile{\normalabcoutputfile}
\def\abc@opt{}
\let\abc@postopt\@empty
@@ -53,10 +78,11 @@
\newif\ifabc@center
\abc@centertrue
\newcommand{\abcwidth}{\linewidth} % only fractions of \linewidth
+\let\mupwidth\abcwidth
\newwrite\abc@out
\def\abc@startgen{%
\@bsphack
- \immediate\openout\abc@out\abc@tempfile.abc
+ \immediate\openout\abc@out\abc@tempfile\abc@ext
\let\do\@makeother\dospecials
\catcode`\^^M\active \catcode`\^^I=12
\def\verbatim@processline{%
@@ -70,10 +96,17 @@
}
\def\abc@doshellcommand{%
\immediate\write18{%
- \abc@cmd\space
- \abc@parm\space
- \abc@opt\space
- \abc@tempfile.abc
+ \ifabc@mup
+ \abc@cmd\space
+ \abc@opt\space
+ \abc@parm\space
+ \abc@tempfile\abc@ext\space
+ \else
+ \abc@cmd\space
+ \abc@parm\space
+ \abc@opt\space
+ \abc@tempfile\abc@ext\space
+ \fi
\ifx\abc@postopt\@empty
\else\space\abc@postopt\fi}%
\immediate\write18{%
@@ -88,7 +121,7 @@
\abc@cmd\space
\abc@parm\space
\abc@opt\space
- \abc@tempfile.abc
+ \abc@tempfile\abc@ext\space
\ifx\abc@postopt\@empty
\else\space\abc@postopt\fi}%
\immediate\write\abc@outsh{%
@@ -99,12 +132,22 @@
\fi
}
\AtEndDocument{%
- \ifabc@warning
- \PackageWarningNoLine{abc}{%
- Remember to generate the [eps,pdf] files before compiling%
- \MessageBreak
- again. Use the file \abc@tempfile.sh for a list or as a script}%
- \fi}
+ \ifabc@warning\ifabc@unprocessedfiles
+ \PackageWarningNoLine{\abc@packagename}{%
+ \ifabc@shellescape
+ You have set the `shellescape' option, but you ran%
+ \MessageBreak
+ (pdf)latex without the `-shell-escape' command line%
+ \MessageBreak
+ option. Fix it either with the `noshellescape' option%
+ \MessageBreak
+ in your document or the correct call of (pdf)latex%
+ \else
+ Remember to generate the [eps,pdf] files before compiling%
+ \MessageBreak
+ again. Use the file \abc@tempfile.sh for a list or as a script%
+ \fi}%
+ \fi\fi}
\ifabc@shellescape
\let\abc@process\abc@doshellcommand
\else
@@ -121,25 +164,38 @@
\let\abc@finish\endcomment
\fi
\def\abc{\@ifnextchar[\abc@grab{\abc@grab[]}}
-\define@key{abc}{name}{\def\abc@tempfile{#1}}
+\define@key{abc}{name}[]{%
+ \if!#1!\stepcounter{abc@count}%
+ \edef\abc@tempfile{\normalabcoutputfile-\@arabic\c@abc@count}%
+ \else
+ \def\abc@tempfile{#1}%
+ \fi
+}
\define@key{abc}{options}{\def\abc@opt{#1}}
\define@key{abc}{postoptions}{\def\abc@postopt{#1}}
\define@key{abc}{program}{\def\abc@cmd{#1}\let\abc@parm\@empty}
\define@key{abc}{width}{\def\abc@width{#1}}
\define@key{abc}{center}[true]{\csname abc@center#1\endcsname}
-\def\abc@grab[#1]{\let\abc@width=\abcwidth\setkeys{abc}{#1}\abc@start}
+\define@key{abc}{extension}{\def\abc@ext{.#1}}
+\def\abc@grab[#1]{\let\abc@width=\abcwidth
+ \ifabc@saveall
+ \setkeys{abc}{name,#1}%
+ \else
+ \setkeys{abc}{#1}%
+ \fi\abc@start}
\def\endabc{%
\abc@finish
\trivlist\item[]\ifabc@center\centering\fi
\IfFileExists{\abc@tempfile.\abc@finalext}
{\includegraphics[width=\abc@width]{\abc@tempfile.\abc@finalext}}%
- {\global\abc@warningtrue\fbox{\abc@tempfile}}%
+ {\global\abc@warningtrue\fbox{\abc@tempfile}%
+ \global\abc@unprocessedfilestrue}%
\endtrivlist
}
\def\abcinput{\@ifnextchar[\abc@grabinput{\abc@grabinput[]}}
\def\abc@grabinput[#1]#2{\let\abc@width=\abcwidth\setkeys{abc}{#1}%
\begingroup\def\abc@tempfile{#2}%
- \IfFileExists{\abc@tempfile.abc}
+ \IfFileExists{\abc@tempfile\abc@ext}
{%
\abc@process
\begin{center}
@@ -149,7 +205,7 @@
\end{center}%
\endgroup
}
- {\PackageWarning{abc}{No file \abc@tempfile.abc found}}%
+ {\PackageWarning{\abc@packagename}{No file \abc@tempfile\abc@ext\space found}}%
}
\endinput
%%
diff --git a/Master/texmf-dist/tex/latex/abc/mup.sty b/Master/texmf-dist/tex/latex/abc/mup.sty
new file mode 100644
index 00000000000..6acbc12c01d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/abc/mup.sty
@@ -0,0 +1,27 @@
+%%
+%% This is file `mup.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% abc.dtx (with options: `package-mup')
+%%
+%% Copyright 2006, 2008 Enrico Gregorio
+%%
+%% This program is provided under the terms of the
+%% LaTeX Project Public License distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt.
+%%
+%% Author: Enrico Gregorio
+%% Enrico dot Gregorio at univr dot it
+%%
+%% This work has the LPPL maintenance status "author-maintained".
+%%
+
+\ProvidesPackage{mup}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{abc}}
+\ProcessOptions\relax
+\RequirePackage[mup]{abc}
+\endinput
+%%
+%% End of file `mup.sty'.