diff options
author | Karl Berry <karl@freefriends.org> | 2008-03-08 23:20:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-03-08 23:20:19 +0000 |
commit | d6767c07e4b1da71175894668d79303343af63f2 (patch) | |
tree | 69c2d7056589eff6b2dbc3a49bced1220eb06c08 | |
parent | 528aaa7971899a4d43d0b074b87872929e004cf9 (diff) |
abc 2 (8mar08)
git-svn-id: svn://tug.org/texlive/trunk@6902 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/abc/README | 31 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/abc/abc.pdf | bin | 162377 -> 166828 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/abc/example.tex | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/abc/mupexa.tex | 76 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/abc/poll.abc | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/abc/simple.mup | 13 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/abc/abc.dtx | 292 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/abc/abc.ins | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/abc/abc.sty | 98 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/abc/mup.sty | 27 |
10 files changed, 479 insertions, 67 deletions
diff --git a/Master/texmf-dist/doc/latex/abc/README b/Master/texmf-dist/doc/latex/abc/README index 09f66ffc759..b59512bab32 100644 --- a/Master/texmf-dist/doc/latex/abc/README +++ b/Master/texmf-dist/doc/latex/abc/README @@ -1,9 +1,9 @@ The abc package lets you include lines of music written in the ABC Plus language (http://abcplus.sourceforge.net). -This is version 1.0 of the package +This is version 2.0 of the 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 @@ -24,26 +24,35 @@ abc.pdf and of the derived files abc.sty +mup.sty example.tex poll.abc +mupexa.tex +simple.mup To install the distribution: o run "latex abc.ins" o run "latex -shell-escape example.tex" for a test -o move "abc.sty" to locations where LaTeX will find - it (the FAQ on CTAN in /help/uktug-FAQ gives more - information about this magic place +o move "abc.sty" and "mup.sty" to locations where LaTeX will + find it (the FAQ on CTAN in /help/uktug-FAQ gives more + information about this magic place) Please note that you need, on your system, the utilities "abcm2ps" (http://abcplus.sourceforge.net), -either "ps2eps" (which comes with teTeX) or "ps2epsi" +either "ps2eps" (which comes with TeX Live) or "ps2epsi" (which comes with Ghostscript), and epstopdf (which -comes with teTeX) if you use pdflatex. +comes with TeX Live) if you use pdflatex. -Note also that you must enable "shell escape" on -your TeX system via the command line switch (at least); -see the teTeX documentation. +If you want to compile the Mup examples, you need the +utility "mup" (http://www.arkkra.com), along with the +Postscript utilities mentioned above. -2006/03/22 +Note also that you must enable "shell escape" on your +TeX system via the command line switch (at least); see +your distribution's documentation. However, this is not +strictly necessary in order to use the package, see the +documentation. + +2008/03/03 Enrico Gregorio diff --git a/Master/texmf-dist/doc/latex/abc/abc.pdf b/Master/texmf-dist/doc/latex/abc/abc.pdf Binary files differindex 3dc7a406f17..1291a8d0f7b 100644 --- a/Master/texmf-dist/doc/latex/abc/abc.pdf +++ b/Master/texmf-dist/doc/latex/abc/abc.pdf diff --git a/Master/texmf-dist/doc/latex/abc/example.tex b/Master/texmf-dist/doc/latex/abc/example.tex index e5129232951..8692722001b 100644 --- a/Master/texmf-dist/doc/latex/abc/example.tex +++ b/Master/texmf-dist/doc/latex/abc/example.tex @@ -6,7 +6,7 @@ %% %% abc.dtx (with options: `example') %% -%% 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 @@ -75,6 +75,7 @@ is already in our directory. \abcinput{poll} \end{document} + \endinput %% %% End of file `example.tex'. diff --git a/Master/texmf-dist/doc/latex/abc/mupexa.tex b/Master/texmf-dist/doc/latex/abc/mupexa.tex new file mode 100644 index 00000000000..b24f5c93d38 --- /dev/null +++ b/Master/texmf-dist/doc/latex/abc/mupexa.tex @@ -0,0 +1,76 @@ +%% +%% This is file `mupexa.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% abc.dtx (with options: `example-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". +%% + +\documentclass[a4paper,12pt]{article} +\usepackage[generate,ps2eps]{mup} +\usepackage{mathptmx} + +\begin{document} + +\title{Example of MUP in \LaTeX{}} +\author{Martin Tarenskeen} +\date{} +\maketitle + +This is a short piece. + +\medskip + +\begin{mup} +1: a-;b-;c;d; +bar +1: e;f;g;a; +endbar +\end{mup} + +\medskip + +This is another short piece, but we would like to keep the +MUP source in our directory. + +\begin{mup}[name=mymup] +score +staffs=2 +time=6/8 +beamstyle=4.,4. + +staff 2 +clef=bass + +music +1: 8c;d;e;f;g;a; +2: 4.ceg;cfa; +repeatend + +\end{mup} + +\clearpage + +And finally, we want to set also the last piece; its MUP code +is already in our directory. + +\medskip + +\mupinput{simple} + +\end{document} +\endinput +%% +%% End of file `mupexa.tex'. diff --git a/Master/texmf-dist/doc/latex/abc/poll.abc b/Master/texmf-dist/doc/latex/abc/poll.abc index 8f46f98680b..a408c7f596d 100644 --- a/Master/texmf-dist/doc/latex/abc/poll.abc +++ b/Master/texmf-dist/doc/latex/abc/poll.abc @@ -13,3 +13,4 @@ K:Amix ~f3 d ~e3 c | d2 (3Bcd efge | aged (3=cBA GB | ~A3 G A2:| |: ef | ~g3 f gfef | g2 ga gedg | eaag a3 g | eaag a2 ag | ~f3 d ~e3 c | d2 (3Bcd efge | aged (3=cBA GB | ~A3 G A2 :| + diff --git a/Master/texmf-dist/doc/latex/abc/simple.mup b/Master/texmf-dist/doc/latex/abc/simple.mup new file mode 100644 index 00000000000..5ec082035ca --- /dev/null +++ b/Master/texmf-dist/doc/latex/abc/simple.mup @@ -0,0 +1,13 @@ + +score +staffs=2 +time=6/8 +beamstyle=4.,4. + +staff 2 +clef=bass + +music +1: 8c;d;e;f;g;a; +2: 4.ceg;cfa; +repeatend diff --git a/Master/texmf-dist/source/latex/abc/abc.dtx b/Master/texmf-dist/source/latex/abc/abc.dtx index 582601a6e19..54508b8deeb 100644 --- a/Master/texmf-dist/source/latex/abc/abc.dtx +++ b/Master/texmf-dist/source/latex/abc/abc.dtx @@ -23,7 +23,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{abc} %<*package> - [2006/03/22 v1.0 Enrico Gregorio] + [2008/03/03 v2.0 Enrico Gregorio] %</package> %<*driver> \documentclass{ltxdoc} @@ -38,7 +38,7 @@ %</driver> % \fi % -% \CheckSum{292} +% \CheckSum{397} % % \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 @@ -56,6 +56,12 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % +% \changes{v2.0}{2008/03/03}{Many changes, in order to allow for Mup +% support; added saveall and nosaveall options} +% +% \changes{v1.1}{2007/03/27}{Added \cs{endgroup} when the warning for +% a non existent file is issued} +% % \changes{v1.0}{2006/03/22}{After long delay decided to publish it} % % \changes{v0.7}{2005/11/21}{Corrected some errors from previous @@ -88,9 +94,13 @@ % \DoNotIndex{\verbatim@processline,\verbatim@start,\write} % \DoNotIndex{\@makeother,\IfFileExists,\ProcessOptions} % \DoNotIndex{\@ifnextchar,\define@key,\MessageBreak,\setkeys} -% \DoNotIndex{\^} +% \DoNotIndex{\stepcounter,\newcounter,\trivlist,\AtEndDocument} +% \DoNotIndex{\@empty,\edef,\csname,\endcsname,\edef,\begingroup} +% \DoNotIndex{\endgroup,\endtrivlist,\global,\if,\ifx,\item} +% \DoNotIndex{\PackageWarningNoLine,\PassOptionsToPackage} +% \DoNotIndex{\ProvidesPackage,\@arabic} % -% \title{The \textsf{abc} class\thanks{This document corresponds to +% \title{The \textsf{abc} package\thanks{This document corresponds to % \textsf{abc}~\fileversion, dated \filedate.}} % % \author{Enrico Gregorio \\ \texttt{Enrico dot Gregorio at univr dot it}} @@ -123,6 +133,16 @@ % \textsc{pdf}\LaTeX{}, without any change in the user's source file. % It employs also the package \textsf{keyval} by David Carlisle and % ideas from the \textsf{verbatim} package in the \LaTeX{} tools. +% +% Martin Tarenskeen wrote me about possible support of Mup--Music +% Publisher\footnote{\texttt{http://www.arkkra.com}} and actually it +% was easy to add it along with some improvements partly suggested by +% him. Therefore the package now comes along with a new \textsf{mup} +% package; see section~\ref{mup}. I owe many thanks to Martin for +% testing the new version. +% +% We are studying whether it is feasible to extend support also to +% other music printing programs like Lilypond. % % \section{Usage} % \DescribeEnv{abc} @@ -142,7 +162,8 @@ % for the temporary file which will be output and massaged by % \texttt{abcm2ps}. \emph{Warning}: the extension \texttt{.abc} is % automatically added to the file name; esistent files with the same -% name will be silently erased (to be changed in future versions). +% name will be silently erased. If the keyword is specified without a +% value, then the output file receives a unique name. % % \item[\normalfont\texttt{options=}\meta{options}:] \meta{options} % are command line parameters to the \texttt{abcm2ps} utility; the @@ -170,6 +191,10 @@ % \item[\normalfont\texttt{center}:] This is a boolean, either true % or false; the default is true, if left flush alignment is preferred, % specify \texttt{center=false}. +% +% \item[\normalfont\texttt{extension}:] This keyword seems practically +% useless, but is needed if one needs to input both ABC and Mup files +% in one and the same document. See later on. % \end{description} % % \DescribeMacro{\abcinput} @@ -232,10 +257,22 @@ % a system where the utility \texttt{ps2epsi} generates a file with % three letter extension \texttt{.epi}. % +% \subsection{\texttt{nosaveall} and \texttt{saveall}} +% The first is the default, but the second is called implicitly when +% the \texttt{noshellescape} is given. When the \texttt{saveall} +% option is active, every `abc' environment produces a unique output +% file; in other words, the \texttt{name} keyword, without value, is +% given for every environment. So the \texttt{noshellescape} option +% along with \texttt{generate} will not overwrite the output from +% unnamed environment. It is possible that, during the document's +% preparation, the numbers added to the default file name are out of +% synch, the process should converge. +% +% % \section{Compiling documents} % Users must give the option \texttt{-shell-escape} when compiling -% their documents (unless they chose the \texttt{nogenerate} package -% option. Thus one of +% their documents, unless they chose the \texttt{nogenerate} package +% option or the \texttt{noshellescape}. Thus one of % \begin{quote} % \texttt{latex -shell-escape} \meta{\TeX{} file name}\\ % \texttt{pdflatex -shell-escape} \meta{\TeX{} file name}\\ @@ -337,10 +374,127 @@ K:Amix %</abc> % \fi % -% \section{To do} -% Find a robust way to assign a unique name to output files. With -% \verb|\label| and \verb|\ref|, probably. +% \section{Mup support}\label{mup} +% Everything we have said about ABC translates verbatim for Mup. +% Simply call the package with +% \iffalse +%<*verb> +% \fi +\begin{verbatim} +\usepackage{mup} +\end{verbatim} +% \iffalse +%</verb> +% \fi + +% with options just like before, and substitute the string `mup' to +% every occurrence of `abc' in the preceding sections. The only +% differences are in the default command line options when calling the +% external program (they are \texttt{-F} for `mup'). % +% It is even possible to use both external programs in the same +% document. If this is desired, call the \textsf{abc} package and +% define a new environment for Mup inclusion as follows +% \iffalse +%<*verb> +% \fi +\begin{verbatim} +\newenvironment{mup}[1][] + {\renewcommand{\normalabcoutputfile}{out-mup}% + \abc[program=mup,options={-F},extension=mup,#1]} + {\endabc} +\newcommand{\mupinput}[2][]{% + \abcinput[program=mup,options={-F},extension=mup,#1]{#2}} +\end{verbatim} +% \iffalse +%</verb> +% \fi +% +% Here is an example with Mup. +% +% \iffalse +%<*example-mup> +% \fi +% \begin{smallverb} +\documentclass[a4paper,12pt]{article} +\usepackage[generate,ps2eps]{mup} +\usepackage{mathptmx} + +\begin{document} + +\title{Example of MUP in \LaTeX{}} +\author{Martin Tarenskeen} +\date{} +\maketitle + +This is a short piece. + +\medskip + +\begin{mup} +1: a-;b-;c;d; +bar +1: e;f;g;a; +endbar +\end{mup} + +\medskip + +This is another short piece, but we would like to keep the +MUP source in our directory. + +\begin{mup}[name=mymup] +score +staffs=2 +time=6/8 +beamstyle=4.,4. + +staff 2 +clef=bass + +music +1: 8c;d;e;f;g;a; +2: 4.ceg;cfa; +repeatend + +\end{mup} + +\clearpage + +And finally, we want to set also the last piece; its MUP code +is already in our directory. + +\medskip + +\mupinput{simple} + +\end{document} +% \end{smallverb} +% \iffalse +%</example-mup> +% \fi +% This file is accompanied by a file \texttt{simple.mup} +% \iffalse +%<*mup> +% \fi +% \begin{smallverb} +score +staffs=2 +time=6/8 +beamstyle=4.,4. + +staff 2 +clef=bass + +music +1: 8c;d;e;f;g;a; +2: 4.ceg;cfa; +repeatend +% \end{smallverb} +% \iffalse +%</mup> +% \fi +% % \StopEventually{\PrintChanges\PrintIndex} % % \section{The implementation} @@ -352,10 +506,16 @@ K:Amix \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} % \end{macrocode} % The following options control the external programs to use. % \begin{macrocode} @@ -366,7 +526,7 @@ K:Amix % \end{macrocode} % Now we declare the default options and call the user specified ones. % \begin{macrocode} -\ExecuteOptions{generate,shellescape,ps2eps} +\ExecuteOptions{generate,shellescape,nosaveall,ps2eps} \ProcessOptions\relax % \end{macrocode} % @@ -381,15 +541,40 @@ K:Amix \RequirePackage{graphicx} \RequirePackage{ifpdf} % \end{macrocode} -% Next we define some internal commands. We choose to give explicitly -% the extensions to the graphics files, since some user could prefer -% \texttt{ps2epsi}. +% Next we define some internal commands. First of all a boolean for +% issuing messages if necessary and a counter to assign unique names +% to output files % \begin{macrocode} +\newif\ifabc@unprocessedfiles +\newcounter{abc@count} +% \end{macrocode} +% We choose to give explicitly the extensions to the graphics files, +% since some user could prefer \texttt{ps2epsi}. Everything is +% doubled for Mup support. +% \begin{environment}{mup} +% \begin{macro}{\mupinput} +% \begin{macrocode} +\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 @@ -401,10 +586,13 @@ K:Amix \newif\ifabc@center \abc@centertrue % \end{macrocode} +% \end{macro} +% \end{environment} % The following is the only parameter the user is authorized to -% tamper with. +% tamper with; it has an alias for Mup. % \begin{macrocode} \newcommand{\abcwidth}{\linewidth} % only fractions of \linewidth +\let\mupwidth\abcwidth % \end{macrocode} % \begin{macro}{\abc@startgen} % \begin{macro}{\abc@finishgen} @@ -418,7 +606,7 @@ K:Amix \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{% @@ -445,10 +633,17 @@ K:Amix % \begin{macrocode} \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{% @@ -463,7 +658,7 @@ K:Amix \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{% @@ -479,12 +674,22 @@ K:Amix % \texttt{nogenerate} option was chosen. % \begin{macrocode} \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} % \end{macrocode} % \end{macro} % \end{macro} @@ -526,13 +731,25 @@ K:Amix % ``out-abc'' which should not clobber any existing file. % \begin{macrocode} \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} % \end{macrocode} % The final part of the environment; we do the processing, if % required and then include the graphics file. If none is found, the @@ -543,7 +760,8 @@ K:Amix \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 } % \end{macrocode} @@ -553,7 +771,7 @@ K:Amix \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} @@ -563,10 +781,18 @@ K:Amix \end{center}% \endgroup } - {\PackageWarning{abc}{No file \abc@tempfile.abc found}}% + {\PackageWarning{\abc@packagename}{No file \abc@tempfile\abc@ext\space found}}% } %</package> % \end{macrocode} % \end{macro} % \end{environment} +% \begin{macrocode} +%<*package-mup> +\ProvidesPackage{mup} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{abc}} +\ProcessOptions\relax +\RequirePackage[mup]{abc} +%</package-mup> +% \end{macrocode} % \Finale diff --git a/Master/texmf-dist/source/latex/abc/abc.ins b/Master/texmf-dist/source/latex/abc/abc.ins index aacc1725eab..e35f358c2fa 100644 --- a/Master/texmf-dist/source/latex/abc/abc.ins +++ b/Master/texmf-dist/source/latex/abc/abc.ins @@ -20,7 +20,7 @@ \input docstrip \preamble - 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 @@ -39,8 +39,11 @@ \Msg{*** Generating the package files ***} \generate{\file{abc.sty}{\from{abc.dtx}{package}}% \file{example.tex}{\from{abc.dtx}{example}}% + \file{mup.sty}{\from{abc.dtx}{package-mup}}% + \file{mupexa.tex}{\from{abc.dtx}{example-mup}}% \nopreamble\nopostamble \file{poll.abc}{\from{abc.dtx}{abc}}% + \file{simple.mup}{\from{abc.dtx}{mup}}% } \Msg{***********************************************************} 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'. |