diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-18 03:00:37 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-18 03:00:37 +0000 |
commit | 841a985f019b145be416f24859bcd1e0833ddb76 (patch) | |
tree | 54da1174340da923d25075b69108553327099df3 /macros/latex/contrib | |
parent | cda3ce3f9172e48d4bc673e57fc617ba0f0b40d1 (diff) |
CTAN sync 201909180300
Diffstat (limited to 'macros/latex/contrib')
16 files changed, 1023 insertions, 1172 deletions
diff --git a/macros/latex/contrib/extract/README b/macros/latex/contrib/extract/README index 7cc0a46779..c54f79fc8a 100644 --- a/macros/latex/contrib/extract/README +++ b/macros/latex/contrib/extract/README @@ -1,4 +1,4 @@ -extract v1.8 +extract v1.9 ------------ This package can be used to (conditionally) extract specific @@ -44,7 +44,7 @@ extract into your LaTeX distribution License ------- -Copyright (C) 2004-2005 Hendri Adriaens +Copyright (C) 2004-2019 Hendri Adriaens This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/macros/latex/contrib/extract/extract.dtx b/macros/latex/contrib/extract/extract.dtx index b4b74776be..42aa96f4c5 100644 --- a/macros/latex/contrib/extract/extract.dtx +++ b/macros/latex/contrib/extract/extract.dtx @@ -109,7 +109,7 @@ of the package. % % \GetFileInfo{extract.sty} % -% \CheckSum{1013} +% \CheckSum{1011} % % \DoNotIndex{\@backslashchar,\@bsphack,\@checkend,\@currenvir, % \@currenvline,\@doendpe,\@eha,\@ehc,\@empty,\@endpefalse,\@esphack, @@ -152,7 +152,7 @@ of the package. %\texttt{/macros/latex/contrib/extract}. See \texttt{extract.dtx} for %information on installing \pf{extract} into your \LaTeX\ %distribution and for the license of this package.}} -%\author{Hendri Adriaens\\\url{http://stuwww.uvt.nl/~hendri}} +%\author{\mktitledecor Hendri Adriaens} %\date{\fileversion\ (\filedate)} %\maketitle % @@ -920,7 +920,7 @@ of the package. %<*extract> \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{extract} - [2005/05/07 v1.8 extract content from document (HA)] + [2019/09/17 v1.9 extract content from document (HA)] \RequirePackage{verbatim} \RequirePackage{xkeyval} \newwrite\XTR@out @@ -1086,11 +1086,12 @@ of the package. % \end{macro} % \begin{macro}{\begin} % \marg{environment}\\ +% \changes{v1.9}{2019/09/17}{Changed definition to robust version} % Modify the macro |\begin| to allow adding code to a level specific % hook which can be executed after |\endgroup| in |\end|. See for % more info on this macro the \LaTeX\ source~\cite{LaTeXbase}. % \begin{macrocode} -\def\begin#1{% +\@namedef{begin}#1{% \@ifundefined{#1}% {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}% {\def\reserved@a{\def\@currenvir{#1}% @@ -1111,9 +1112,10 @@ of the package. % \end{macro} % \begin{macro}{\end} % \marg{environment}\\ +% \changes{v1.9}{2019/09/17}{Changed definition to robust version} % Modify |\end| to execute the code collected in the hook. % \begin{macrocode} -\def\end#1{% +\@namedef{end}#1{% \csname end#1\endcsname\@checkend{#1}% \expandafter\endgroup\if@endpe\@doendpe\fi % \end{macrocode} @@ -1130,7 +1132,7 @@ of the package. % decreasing the depth as to avoid level mixing problems when the % hook contains another environment. This environment has to be % executed at the same level as the environment in which the hook was -% defined since it is executed after the group and does not below +% defined since it is executed after the group and does not belong % anymore to the environment in which the hook was defined. % \begin{macrocode} \reserved@a\relax @@ -2109,6 +2111,7 @@ c\end{extractskip}d \usepackage{xcolor} \usepackage{fourier} \usepackage{varioref} +\usepackage{pst-text} \def\reftextafter{on page~\thevpagerefnum} \def\reftextbefore{on page~\thevpagerefnum} \def\reftextfaceafter{on page~\thevpagerefnum} @@ -2121,6 +2124,20 @@ c\end{extractskip}d \lstset{basicstyle=\footnotesize\ttfamily,columns=flexible,frame=single,% backgroundcolor=\color{yellow!20},xleftmargin=\fboxsep,% xrightmargin=\fboxsep,gobble=1}}{} +\def\mktitledecor{% + \rput[tl]{90}(-6.5,-22.56){% + \psline[linewidth=1pt](0,1.5)(\paperheight,1.5)% + \rput[lB](.075\paperheight,.5){\pscharpath[linecolor=blue!50,% + fillcolor=yellow!20,fillstyle=solid,linewidth=.5pt]% + {\Huge\bfseries\sffamily extract}% + }% + \rput[rB](.925\paperheight,.5){\pscharpath[linecolor=blue!50,% + fillcolor=yellow!20,fillstyle=solid,linewidth=.5pt]% + {\Huge\bfseries Documentation}% + }% + \psline[linewidth=1pt](0,0)(\paperheight,0)% + }% +} \usepackage{float} \newfloat{Listing}{htb}{loe} \makeatletter diff --git a/macros/latex/contrib/extract/extract.pdf b/macros/latex/contrib/extract/extract.pdf Binary files differindex 3176259e8e..1ed5ee687d 100644 --- a/macros/latex/contrib/extract/extract.pdf +++ b/macros/latex/contrib/extract/extract.pdf diff --git a/macros/latex/contrib/extract/extract.sty b/macros/latex/contrib/extract/extract.sty deleted file mode 100644 index 46a653bf85..0000000000 --- a/macros/latex/contrib/extract/extract.sty +++ /dev/null @@ -1,518 +0,0 @@ -%% -%% This is file `extract.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% extract.dtx (with options: `extract') -%% -%% --------------------------------------- -%% Copyright (C) 2004-2005 Hendri Adriaens -%% --------------------------------------- -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2003/12/01 or later. -%% -%% This work has the LPPL maintenance status "maintained". -%% -%% This Current Maintainer of this work is Hendri Adriaens. -%% -%% This work consists of the file extract.dtx and the derived files -%% extract.sty, xtrex1.tex, xtrex2.tex, xtrex3.tex, xtrex4.tex, -%% xtrex5.tex, xtrex6.tex and xtrex7.tex. -%% -%% The following files constitute the extract package and must be -%% distributed as a whole: readme, extract.dtx, extract.pdf and -%% extract.sty. -%% -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{extract} - [2005/05/07 v1.8 extract content from document (HA)] -\RequirePackage{verbatim} -\RequirePackage{xkeyval} -\newwrite\XTR@out -\newwrite\XTR@tmp -\newif\ifXTR@st -\newif\ifXTR@skip -\newif\ifXTR@extract -\def\XTR@err#1{\PackageError{extract}{#1}\@ehc} -\def\XTR@namelet#1#2{% - \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname -} -\define@boolkey[XTR]{extract.sty}[XTR@]{active}[true]{} -\define@boolkey[XTR]{extract.sty}[XTR@]{header}[true]{} -\define@boolkey[XTR]{extract.sty}[XTR@]{handles}[true]{} -\define@boolkey[XTR]{extract.sty}[XTR@]{copydocumentclass}[true]{} -\DeclareOptionX[XTR]{generate}{\lowercase{\def\XTR@file{#1}}} -\DeclareOptionX[XTR]{extract-env}{% - \def\XTR@envs{#1}% - \XKV@for@n{#1}\XTR@tempa\XTR@tempb -} -\DeclareOptionX[XTR]{extract-cmd}{% - \def\XTR@cmdsargs{#1}% - \XKV@for@n{#1}\XTR@tempa\XTR@tempb -} -\DeclareOptionX[XTR]{extract-cmdline}{% - \def\XTR@cmdsline{#1}% - \XKV@for@n{#1}\XTR@tempa\XTR@tempb -} -\def\XTR@tempb{% - \DeclareOptionX[XTR]{\XTR@tempa-nrs}{% - \expandafter\XKV@sp@deflist\csname XTR@\XKV@tkey\endcsname{##1}% - \XTR@namelet{XTR@\XKV@tkey @cnt}{z@}% - }% - \DeclareOptionX[XTR]{\XTR@tempa-labels}{% - \expandafter\XKV@sp@deflist\csname XTR@\XKV@tkey\endcsname{##1}% - }% -} -\def\XTR@tempa{line}\XTR@tempb -\def\XTR@tempa{extract}\XTR@tempb -\def\XTR@tempa{extractskip}\XTR@tempb -\DeclareOptionX*{\XTR@err{Unknown option `\CurrentOption'}} -\ExecuteOptionsX[XTR]{header=true,handles=true,copydocumentclass=true} -\ProcessOptionsX[XTR] -\def\XTR@opentmp{\immediate\openout\XTR@tmp\jobname.xtr\relax} -\def\XTR@writetmp{\immediate\write\XTR@tmp} -\def\XTR@closetmp{\immediate\closeout\XTR@tmp} -\def\XTR@writeout{\immediate\write\XTR@out} -\ifXTR@active - \XKV@ifundefined{XTR@file}{ - \XTR@activefalse - \XTR@err{no file to generate; extract deactivated} - }{} - \XTR@opentmp - \XTR@writetmp{% - \string\lowercase{\string\def\string\XTR@tempa{\jobname}}% - } - \XTR@closetmp - \input{\jobname.xtr} - \ifx\XTR@tempa\XTR@file - \XTR@activefalse - \XTR@err{attempt to overwrite source file; extract deactivated} - \fi -\fi -\newcount\@envdepth\@envdepth\z@ -\def\begin#1{% - \@ifundefined{#1}% - {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}% - {\def\reserved@a{\def\@currenvir{#1}% - \edef\@currenvline{\on@line}% - \csname #1\endcsname}}% - \@ignorefalse - \begingroup\@endpefalse - \global\advance\@envdepth\@ne - \global\@namedef{@afterendenvhook@\romannumeral\@envdepth}{}% - \reserved@a} -\def\end#1{% - \csname end#1\endcsname\@checkend{#1}% - \expandafter\endgroup\if@endpe\@doendpe\fi - \expandafter\let\expandafter\reserved@a - \csname @afterendenvhook@\romannumeral\@envdepth\endcsname - \global\advance\@envdepth\m@ne - \reserved@a\relax - \if@ignore\@ignorefalse\ignorespaces\fi} -\def\AfterEndEnv{% - \expandafter\g@addto@macro - \csname @afterendenvhook@\romannumeral\@envdepth\endcsname -} -\def\XTR@checkxtr#1#2{% - \@nameuse{XTR@#1false}% - \XTR@namelet{XTR@maketrue}{XTR@#1true}% - \XKV@ifundefined{XTR@#2-nrs}{% - \XKV@ifundefined{XTR@#2-labels}\XTR@maketrue{}% - }{% - \begingroup - \expandafter\count@\csname XTR@#2-nrs@cnt\endcsname - \advance\count@\@ne - \edef\XTR@resa{\expandafter\noexpand\expandafter\gdef\expandafter - \noexpand\csname XTR@#2-nrs@cnt\endcsname{\the\count@}}% - \expandafter\endgroup\XTR@resa - }% - \@nameuse{ifXTR@#1}\else - \XKV@ifundefined{XTR@#2-labels}{}{% - \ifx\XTR@currentlabel\relax\else - \@expandtwoargs\in@{,\XTR@currentlabel,}% - {,\csname XTR@#2-labels\endcsname,}% - \ifin@\XTR@maketrue\fi - \fi - }% - \fi - \@nameuse{ifXTR@#1}\else - \XKV@ifundefined{XTR@#2-nrs}{}{% - \expandafter\XTR@ch@ckxtr\csname XTR@#2-nrs\expandafter - \endcsname\csname XTR@#2-nrs@cnt\endcsname - }% - \fi - \global\let\XTR@currentlabel\relax -} -\def\XTR@ch@ckxtr#1#2{% - \XKV@for@o#1\XTR@resa{\expandafter\XTR@ch@ck@tr\XTR@resa--\@nil#2}% -} -\def\XTR@ch@ck@tr#1-#2-#3\@nil#4{% - \ifx\@empty#1\@empty - \ifnum#4>#2 \else\XTR@maketrue\fi - \else - \ifx\@empty#2\@empty - \ifx\@empty#3\@empty - \ifnum#4=#1 \XTR@maketrue\fi - \else - \ifnum#4<#1 \else\XTR@maketrue\fi - \fi - \else - \ifnum#4<#1 \else\ifnum#4>#2 \else\XTR@maketrue\fi\fi - \fi - \fi -} -\def\extractionlabel{\KV@@sp@def\XTR@currentlabel} -\let\XTR@currentlabel\relax -\def\extract{\XTR@stfalse\XTR@extract} -\@namedef{extract*}{\XTR@sttrue\XTR@extract} -\def\XTR@extract{% - \@bsphack - \let\do\@makeother\dospecials\catcode`\^^M\active - \@testopt\XTR@@xtract\@nil -} -\def\XTR@@xtract[#1]{% - \ifXTR@active - \def\XTR@tempa{#1}% - \ifx\XTR@tempa\@nnil\else - \KV@@sp@def\XTR@currentlabel{#1}% - \fi - \XTR@checkxtr{extract}{extract}% - \else - \XTR@extractfalse - \fi - \ifXTR@st\XTR@opentmp\fi - \let\verbatim@processline\XTR@processline@begin - \verbatim@start -} -\begingroup - \lccode`\!=`\\ \lccode`\(=`\{ \lccode`\)=`\} -\lowercase{\endgroup -\def\XTR@processline@begin{% - \@temptokena{}% - \edef\XTR@orig@line{\the\verbatim@line}% - \verbatim@line{}% - \expandafter\XTR@testbegin\XTR@orig@line!begin(extractskip)\@nil -} -\def\XTR@testbegin#1!begin(extractskip)#2\@nil{% - \@temptokena\expandafter{\the\@temptokena#1}% - \verbatim@line\expandafter{\the\verbatim@line#1}% - \def\XTR@tempa{#2}% - \ifx\XTR@tempa\@empty\XTR@processline@write\else\XKV@afterfi - \XTR@skiplabel#2[]\@nil - \XTR@checkxtr{skip}{extractskip}% - \let\verbatim@processline\XTR@processline@end - \ifx\XTR@tempa\@nnil\XKV@afterelsefi - \XTR@t@stbegin#2\@nil - \else\XKV@afterfi - \expandafter\XTR@t@stbegin\XTR@tempa\@nil - \fi - \fi -} -\def\XTR@skiplabel#1[#2]#3\@nil{% - \def\XTR@tempa{#1}% - \def\XTR@tempb{#2}% - \ifx\XTR@tempa\@empty - \ifx\XTR@tempb\@empty - \let\XTR@tempa\@nnil - \else - \KV@@sp@def\XTR@currentlabel{#2}% - \XTR@sk@plabel#3\@nil - \fi - \else - \let\XTR@tempa\@nnil - \fi -} -\def\XTR@sk@plabel#1[]\@nil{\def\XTR@tempa{#1}} -\def\XTR@t@stbegin#1!begin(extractskip)\@nil{% - \XTR@testend#1!end(extractskip)\@nil -} -\def\XTR@processline@end{% - \@temptokena{}% - \edef\XTR@orig@line{\the\verbatim@line}% - \verbatim@line{}% - \expandafter\XTR@testend\XTR@orig@line!end(extractskip)\@nil -} -\def\XTR@testend#1!end(extractskip)#2\@nil{% - \@temptokena\expandafter{\the\@temptokena#1}% - \ifXTR@skip\else\verbatim@line\expandafter{\the\verbatim@line#1}\fi - \def\XTR@tempa{#2}% - \ifx\XTR@tempa\@empty\XTR@processline@write\else\XKV@afterfi - \let\verbatim@processline\XTR@processline@begin - \XTR@t@stend#2\@nil - \fi -} -\def\XTR@t@stend#1!end(extractskip)\@nil{% - \XTR@testbegin#1!begin(extractskip)\@nil -}} -\def\XTR@processline@write{% - \ifXTR@st\ifcat$\the\@temptokena$\else - \XTR@writetmp{\the\@temptokena}% - \fi\fi - \ifXTR@extract\ifcat$\the\verbatim@line$\else - \XTR@writeout{\the\verbatim@line}% - \fi\fi - \ifx\XTR@orig@line\@empty\XTR@writetmp{}\XTR@writeout{}\fi -} -\def\endextract{\XTR@stfalse\XTR@endextract} -\@namedef{endextract*}{\XTR@sttrue\XTR@endextract} -\def\XTR@endextract{% - \@esphack - \ifXTR@st - \XTR@closetmp - \AfterEndEnv{\input{\jobname.xtr}}% - \fi -} -\@namedef{extractskip}{\XTR@activefalse\@nameuse{extract*}} -\XTR@namelet{endextractskip}{endextract*} -\def\extractline{% - \XKV@ifstar{\XTR@sttrue\XTR@extractline}% - {\XTR@stfalse\XTR@extractline}% -} -\def\XTR@extractline{% - \begingroup - \let\do\@makeother\dospecials\catcode`\^^M\active - \@testopt\XTR@@xtractline\@nil -} -\begingroup - \catcode`\~=\active\lccode`\~=`\^^M -\lowercase{\endgroup - \def\XTR@@xtractline[#1]#2~{% - \ifXTR@active - \def\XTR@tempa{#1}% - \ifx\XTR@tempa\@nnil\else - \KV@@sp@def\XTR@currentlabel{#1}% - \fi - \XTR@checkxtr{extract}{line}% - \else - \XTR@extractfalse - \fi - \ifXTR@extract\XTR@writeout{#2}\fi - \ifXTR@st\XTR@opentmp\XTR@writetmp{#2}\XTR@closetmp\fi - \endgroup - \ifXTR@st - \input{\jobname.xtr}% - \fi - }% -} -\ifXTR@active -\immediate\openout\XTR@out\XTR@file\relax -\ifXTR@header - \@tempcnta\time - \divide\@tempcnta 60 - \edef\XTR@tempb{% - \the\year/\ifnum\the\month<10 0\fi\the\month/% - \ifnum\the\day<10 0\fi\the\day,\the\@tempcnta:% - } - \multiply\@tempcnta 60 - \@tempcntb\time - \advance\@tempcntb-\@tempcnta - \ifnum\@tempcntb<10 - \xdef\XTR@tempb{\XTR@tempb0\the\@tempcntb} - \else - \xdef\XTR@tempb{\XTR@tempb\the\@tempcntb} - \fi - \begingroup - \catcode`\%=12 - \gdef\XTR@tempa{%%\space} - \endgroup - \XTR@writeout{\XTR@tempa} - \filename@parse\XTR@file - \ifx\filename@ext\relax\def\filename@ext{tex}\fi - \XTR@writeout{% - \XTR@tempa This is file, `\filename@base.\filename@ext',% - } - \XTR@writeout{% - \XTR@tempa generated with the extract package.^^J\XTR@tempa - } - \XTR@writeout{\XTR@tempa Generated on : \space\XTR@tempb} - \filename@parse\jobname - \ifx\filename@ext\relax\def\filename@ext{tex}\fi - \XTR@writeout{% - \XTR@tempa From source \space: \space\filename@base.\filename@ext - } - \XTR@writeout{% - \XTR@tempa Using options: \space\csname opt@extract.sty\endcsname - } - \XTR@writeout{\XTR@tempa} -\fi -\ifXTR@copydocumentclass - \def\XTR@tempa#1.cls\@nil{\def\XTR@tempa{#1}} - \expandafter\XTR@tempa\XKV@documentclass\@nil - \ifx\XKV@classoptionslist\@empty - \XTR@writeout{\string\documentclass{\XTR@tempa}} - \else - \@temptokena\expandafter{\XKV@classoptionslist}% - \XTR@writeout{\string\documentclass[\the\@temptokena]{\XTR@tempa}} - \fi -\fi -\AtBeginDocument{% - \ifXTR@handles - \XTR@writeout{}% - \XTR@writeout{\string\begin{document}}% - \fi - \XKV@ifundefined{XTR@envs}{}{% - \XKV@for@o\XTR@envs\XTR@tempa{% - \XKV@ifundefined\XTR@tempa{% - \XTR@err{% - environment `\XTR@tempa' not defined; extraction canceled% - }% - }{% - \XTR@namelet{XTR\XTR@tempa}{\XTR@tempa}% - \@namedef{\XTR@tempa\expandafter}\expandafter{\expandafter - \def\expandafter\XTR@tempa\expandafter{\XTR@tempa}% - \XTR@checkxtr{extract}\XTR@tempa - \ifXTR@extract - \XTR@writeout{}\XTR@opentmp - \@bsphack - \let\do\@makeother\dospecials\catcode`\^^M\active - \def\verbatim@processline{% - \let\verbatim@processline\XTR@processline@begin - \XTR@writeout{% - \string\begin{\XTR@tempa}\the\verbatim@line - }% - \XTR@writetmp{% - \string\begin{XTR\XTR@tempa}\the\verbatim@line - }% - }% - \XTR@sttrue\let\XTR@tempb\verbatim@ - \else - \edef\XTR@tempb{\noexpand\begin{XTR\XTR@tempa}}% - \fi - \XTR@tempb - }% - \XTR@namelet{endXTR\XTR@tempa}{end\XTR@tempa}% - \@namedef{end\XTR@tempa\expandafter}\expandafter{\expandafter - \def\expandafter\XTR@tempa\expandafter{\XTR@tempa}% - \ifXTR@extract - \@esphack - \XTR@writeout{\string\end{\XTR@tempa}}% - \XTR@writetmp{\string\end{XTR\XTR@tempa}}% - \XTR@closetmp - \AfterEndEnv{\input{\jobname.xtr}}% - \else - \edef\XTR@tempa{\noexpand\end{XTR\XTR@tempa}}% - \expandafter\XTR@tempa - \fi - }% - }% - }% - }% - \XKV@ifundefined{XTR@cmdsargs}{}{% - \let\XTR@sect\@sect - \let\XTR@chapter\@chapter - \def\XTR@tempb{chapter}% - \XKV@for@o\XTR@cmdsargs\XTR@tempa{% - \XKV@ifundefined\XTR@tempa{% - \XTR@err{command `\@backslashchar\XTR@tempa' not defined; - extraction canceled% - }% - }{% - \@expandtwoargs\in@{,\XTR@tempa,}% - {,chapter,section,subsection,subsubsection,}% - \ifin@ - \ifx\XTR@tempa\XTR@tempb - \def\@chapter[#1]#2{% - \XTR@checkxtr{extract}{chapter}% - \ifXTR@extract - \XTR@writeout{}% - \def\XTR@tempa{#1}% - \def\XTR@tempb{#2}% - \ifx\XTR@tempa\XTR@tempb - \@temptokena{{#2}}% - \else - \@temptokena{[#1]{#2}}% - \fi - \XTR@writeout{\string\chapter\the\@temptokena}% - \fi - \XTR@chapter[#1]{#2}% - }% - \else - \def\@sect#1#2#3#4#5#6[#7]#8{% - \@expandtwoargs\in@{,#1,}{,\XTR@cmdsargs,}% - \ifin@ - \XTR@checkxtr{extract}{#1}% - \ifXTR@extract - \XTR@writeout{}% - \def\XTR@tempa{#7}% - \def\XTR@tempb{#8}% - \ifx\XTR@tempa\XTR@tempb - \@temptokena{{#8}}% - \else - \@temptokena{[#7]{#8}}% - \fi - \XTR@writeout{\expandafter - \string\csname#1\endcsname\the\@temptokena}% - \fi - \fi - \XTR@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}% - }% - \fi - \else - \XTR@err{unsupported command `\XTR@tempa'; - try the `extract-cmdline option}% - \fi - }% - }% - }% - \XKV@ifundefined{XTR@cmdsline}{}{% - \XKV@for@o\XTR@cmdsline\XTR@tempa{% - \XKV@ifundefined\XTR@tempa{% - \XTR@err{command `\@backslashchar\XTR@tempa' not defined; - extraction canceled}% - }{% - \@expandtwoargs\in@{,\XTR@tempa,}% - {,chapter,section,subsection,subsubsection,}% - \ifin@ - \XTR@err{% - use the `extract-cmd' option for command `\XTR@tempa'% - }% - \else - \XTR@namelet{XTR\XTR@tempa}{\XTR@tempa}% - \@namedef{\XTR@tempa\expandafter}\expandafter{\expandafter - \def\expandafter\XTR@tempa\expandafter{\XTR@tempa}% - \XTR@checkxtr{extract}\XTR@tempa - \begingroup - \let\do\@makeother\dospecials\catcode`\^^M\active - \XTR@extractcmdline - }% - \fi - }% - }% - \begingroup - \catcode`\~=\active\lccode`\~=`\^^M - \lowercase{\endgroup - \def\XTR@extractcmdline#1~{\verbatim@line{#1}\XTR@@xtractcmdline}% - }% - \def\XTR@@xtractcmdline{% - \XTR@writeout{}% - \XTR@writeout{\expandafter\string\csname\XTR@tempa - \endcsname\the\verbatim@line - }% - \XTR@opentmp - \XTR@writetmp{\expandafter\string\csname XTR\XTR@tempa - \endcsname\the\verbatim@line - }% - \XTR@closetmp - \endgroup - \input{\jobname.xtr}% - }% - }% -} -\AtEndDocument{% - \ifXTR@handles - \XTR@writeout{}% - \XTR@writeout{\string\end{document}}% - \fi - \immediate\closeout\XTR@out -} -\fi -\endinput -%% -%% End of file `extract.sty'. diff --git a/macros/latex/contrib/ocgx2/ChangeLog b/macros/latex/contrib/ocgx2/ChangeLog index 94f2402057..3384906d48 100644 --- a/macros/latex/contrib/ocgx2/ChangeLog +++ b/macros/latex/contrib/ocgx2/ChangeLog @@ -1,3 +1,7 @@ +2019-09-17 + * v0.44: ocgx2.sty + * fix: wrong visibility of reopened ocg (introduced in v0.41) + 2019-07-04 * v0.43: ocgx2.sty * v0.16: ocgbase.sty diff --git a/macros/latex/contrib/ocgx2/ocgx2.sty b/macros/latex/contrib/ocgx2/ocgx2.sty index dd46efcfe5..2e6cbdf6aa 100644 --- a/macros/latex/contrib/ocgx2/ocgx2.sty +++ b/macros/latex/contrib/ocgx2/ocgx2.sty @@ -48,8 +48,8 @@ \RequirePackage{xparse} \RequirePackage{l3keys2e} -\def\g@ocgxii@date@tl{2019/07/04} -\def\g@ocgxii@version@tl{0.43} +\def\g@ocgxii@date@tl{2019/09/17} +\def\g@ocgxii@version@tl{0.44} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} @@ -189,9 +189,9 @@ \tl_gset:cx{ocgxii_ocg_#3.opts}{\l_tempa_tl} %new options appended \keys_set:nV{ocgx2/ocgenv}\l_tempa_tl \bool_if:nTF{ %initial visibility - \str_if_eq_p:ee{l_ocgxii_argiv_tl}{1} || - \str_if_eq_p:ee{l_ocgxii_argiv_tl}{on} || - \str_if_eq_p:ee{l_ocgxii_argiv_tl}{true} + \str_if_eq_p:ee{\l_ocgxii_argiv_tl}{1} || + \str_if_eq_p:ee{\l_ocgxii_argiv_tl}{on} || + \str_if_eq_p:ee{\l_ocgxii_argiv_tl}{true} }{ \ocgbase_del_from_off_list:n{\tl_use:c{ocgxii_ocg_#3}} }{ diff --git a/macros/latex/contrib/snapshot/README b/macros/latex/contrib/snapshot/README new file mode 100644 index 0000000000..570861d37d --- /dev/null +++ b/macros/latex/contrib/snapshot/README @@ -0,0 +1,17 @@ +README for snapshot 2019/09/17 +https://www.ams.org/arc/resources/snapshot-about.html +tech-support@ams.org + +The snapshot package helps the owner of a LaTeX document +obtain a list of the external dependencies of the document, in a +form that can be embedded at the top of the document. To put it +another way, it provides a snapshot of the current processing +context of the document, insofar as it can be determined from +inside LaTeX. + +Originally written by Michael J. Downes, the snapshot package +is currently maintained by the American Mathematical Society. + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3c +of this license or (at your option) any later version. diff --git a/macros/latex/contrib/snapshot/snapshot.dtx b/macros/latex/contrib/snapshot/snapshot.dtx index 26a502b123..f79605dbf6 100644 --- a/macros/latex/contrib/snapshot/snapshot.dtx +++ b/macros/latex/contrib/snapshot/snapshot.dtx @@ -1,50 +1,55 @@ -%%% ==================================================================== -%%% @LaTeX-doc-source-file{ -%%% filename = "snapshot.dtx", -%%% version = "1.14", -%%% date = "2002/03/05", -%%% time = "15:29:00 EST", -%%% checksum = "39090 807 3449 29761", -%%% author = "American Mathematical Society", -%%% copyright = "Copyright 2001 American Mathematical Society, -%%% all rights reserved. Copying of this file is -%%% authorized only if either: -%%% (1) you make absolutely no changes to your copy, -%%% including name; OR -%%% (2) if you do make changes, you first rename it -%%% to some other name.", -%%% address = "American Mathematical Society, -%%% Electronic Products and Services, -%%% PO Box 6248, -%%% Providence, RI 02940, -%%% USA", -%%% email = "tech-support@ams.org", -%%% URL = "http://www.ams.org/", -%%% supported = "yes", -%%% keywords = "version, compatibility, dependencies, LaTeX", -%%% abstract = "This package provides a way for a LaTeX -%%% document to specify, for each external file -%%% on which the document depends, which version -%%% is required to guarantee output fidelity.", -%%% docstring = "The checksum field above contains a CRC-16 -%%% checksum as the first value, followed by the -%%% equivalent of the standard UNIX wc (word -%%% count) utility output of lines, words, and -%%% characters. This is produced by Robert -%%% Solovay's checksum utility.", -%%% } -%%% ==================================================================== +% \def\filename{snapshot.dtx} +% \def\fileversion{2.13} +% \def\filedate{2012/08/06} +% +% \iffalse meta-comment +% +% American Mathematical Society +% Technical Support +% Publications Technical Group +% 201 Charles Street +% Providence, RI 02904 +% USA +% tel: (401) 455-4080 +% (800) 321-4267 (USA and Canada only) +% fax: (401) 331-3842 +% email: tech-support@ams.org +% +% Copyright 1999-2003, 2004, 2010, 2012 American Mathematical Society. +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is the American Mathematical +% Society. +% +% \fi +% % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e} -\documentclass{amsdtx} +\documentclass[oneside]{amsdtx} \providecommand{\qq}[1]{\textquotedblleft#1\textquotedblright} -\providecommand{\mdash}{\textemdash} +\providecommand{\mdash}{\textemdash\penalty\exhyphenpenalty} +\providecommand{\lat}[1]{\protect\LaTeX{}} +\providecommand{\strong}[1]{\textbf{#1}} +\providecommand{\secref}[1]{Section~\ref{#1}} + +\CodelineIndex + \begin{document} \title{The \pkg{snapshot} package} \author{American Mathematical Society\\Michael Downes} \date{Version \fileversion, \filedate} -\hDocInput{snapshot.dtx} +\DocInput{snapshot.dtx} +\PrintIndex \end{document} %</driver> % \fi @@ -82,7 +87,9 @@ % \end{verbatim} % % \item Run \latex/ on the document. This will produce a dependency -% list in a file \verb'\jobname.dep'. +% list in a file \verb'\jobname.dep'. (I.e., if the document name is +% \fn{vermont.ltx}, the dependency list will be named +% \fn{vermont.dep}.) % % \item Insert the \fn{.dep} file at the top of the document, before % \cn{documentclass}. The following example shows what you would end @@ -132,7 +139,9 @@ % the dependency list, but standard \tex/ 3.x does not provide direct % access to font checksums for macro programmers. This information % could be added by a separate script that scans the DVI file. +% (Certain nontrivial complications are possible, however.) % +% \section{Graphics files} % When a graphics file is read in by a \latex/ document using the % standard \cn{includegraphics} command, it gets a dummy version % number string of @@ -153,9 +162,11 @@ % It would be possible, for \fn{.eps} files at least, to read the % CreationDate comment that is normally included in the file header % and use that as the basis of comparison. Recording the bounding box -% numbers instead of a dummy version number would also be a possibly -% useful stratagem. But I have left these possibilities untouched for -% the time being [mjd,2001-05-14]. +% numbers instead of a dummy version number is another possibility, +% which you can get with the +% \opt{bbinfo} option (as of \pkg{snapshot} version 2.05). +% +% \section{Formalities} % % \DescribeMacro{\RequireVersions} The \cn{RequireVersions} command % scans its argument for file names and associated version number @@ -182,14 +193,31 @@ % \opt{tfm} to turn on the logging of metric files. (Not yet % implemented [mjd,1999/09/23]) % -% \item[format] This is almost always \fn{LaTeX2e}. Other possibilities -% would be \fn{elatex} or \fn{lambda}. The information comes from -% \cs{fmtname}. -% \item[application] This is usually \fn{TeX} with version number -% \fn{3.x}. From inside \latex/ there is no reliable way to get the -% exact version number (one could check to see if version 2.x is in -% use, but this is unlikely to be relevant, nowadays, so I have not -% bothered). +% \item[format] This is almost always \fn{LaTeX2e}. The information +% comes from \cs{fmtname}. Lambda, e\LaTeX{}, and pdf\LaTeX{} leave +% \cs{fmtname} unchanged, and although this may seem dubious at first +% sight, I guess they have little choice: the widespread use of +% \cs{NeedsTeXFormat} in existing package files makes them produce an +% error message if \cs{fmtname} is changed. (Maybe the thing to do +% would be to modify the definition of \cs{NeedsTeXFormat} as well.) +% +% For a \LaTeX{} format that uses the Babel mechanism for preloading +% hyphenation patterns, the version number of \fn{babel.def} that was +% used in building the format might be of interest. But at first +% glance there does not seem to be any easy way of dealing with that, +% and in the normal course of things, a document that relies on Babel +% features will also have a \verb'\usepackage{babel}' statement at +% the top, and that will yield adequate (I think) information for the +% snapshot dependency list. +% +% \item[application] With standard \fn{TeX} there is no reliable way to +% get the exact version number from inside \LaTeX{}. If a document is +% processed with one of the recent variants that address this +% deficiency (such as e-\TeX{}, pdf\TeX{} and Omega) the available +% version info is used, but otherwise a presumptive value of +% \verb'1990/03/25 v3.x' is used (the official release date of \TeX{} +% 3.0). +% % \item[file] None of the above: some other file of miscellaneous type, % e.g., \fn{.clo}, \fn{.cfg}, \fn{.tex}, or \fn{.def}. % \end{description} @@ -200,8 +228,25 @@ % assign a label to particular groups of files in case that helps % with external processing. % -% \section{Warning and error options} +% \section{Package options} % +% The list of options supported by the \pkg{snapshot} package is as +% follows: +% \begin{center}\begin{tabular}{lll} +% dep & date\\ +% log & version\\ +% tfm & major-version\\ +% warning & bbinfo \\ +% error & test \\ +% self-warning +% \end{tabular} +% \end{center} +% +% \begin{description} +% \item[dep, log] Write file date and version information to +% \textit{jobname}\fn{.dep} or to the \LaTeX{} log file, respectively. +% +% \item[error, warning, self-warning] % If the \pkg{snapshot} package is invoked with the \opt{error} % option \emph{and also} the document contains a \cn{RequireVersions} % statement, then each subsequent \cn{ProvidesFile}, @@ -219,12 +264,68 @@ % comparing. % \end{description} % +% The \opt{self-warning} causes a warning to be given, instead of an +% error, if the \pkg{snapshot} package itself has a date or +% version mismatch. +% % \textbf{Note:} A file that doesn't have any sort of % \cn{ProvidesFile} or \cn{ProvidesPackage} statement in it will show % up in the dependency list, with a dummy date and version number of -% 0000/00/00 v0.0, but there is no way, of course, to give any -% meaningful warning or error message about version mismatches for -% such a file. +% 0000/00/00 v0.0, but testing for a version mismatch with such a +% file is then infeasible. +% +% \item[bbinfo] For files of type ``graphic'', include bounding-box info +% as the ``version number''. A normal date and version number are +% seldom available for such files, and \LaTeX{} does not attempt +% to read them, which means that the \pkg{snapshot} package could not +% obtain the information except by drastically modifying the +% low-level \LaTeX{} operations that read graphics file +% information\mdash which seems overly risky. +% +% \item[tfm] \emph{Not implemented yet!} Include information about which +% \TeX{} font metric files are called by \LaTeX{}. This list is +% usually somewhat different from the list of fonts that are actually +% used in the output file (\fn{.dvi} or \fn{.pdf}), primarily because +% the setup for math formulas will normally preload font metric +% information for all the fonts from which \LaTeX{}'s basic math +% symbols are drawn (the symbols documented in the \LaTeX{} book), +% even if the document does not use symbols from all of those fonts. +% +% \item[test] This option is for a special purpose. It drastically +% changes the action of the \cs{RequireVersions} command so that it +% does not merely record the information for later reference, but +% does a \qq{trial load attempt} for each file in the list, and then +% stops the \LaTeX{} job as soon as the list is finished, without +% continuing any further. +% +% By \qq{trial load attempt} I mean that the \cs{RequireVersions} +% command will actually input each file, but with various bits +% redefined so that \cs{ProvidesPackage} and variants will execute +% \cs{endinput}\mdash in other words, only the first few lines of +% each file will be read. +% +% What this means, practically speaking, is that if you run such a +% test on a document, it gives a relatively quick check on two useful +% pieces of information without having to retypeset the entire +% document (which for some documents might be very tedious) +% \begin{enumerate} +% \item The actual location on your system from which the file will be +% loaded. +% +% \item The date and version info from \cs{Provides...} line, if present. +% \end{enumerate} +% +% Similar results could be obtained by a combination of +% \fn{kpsewhich} and \fn{grep}, but because the \pkg{snapshot} \opt{test} +% option works through \LaTeX{}, it is a system-independent method. +% +% Caveat: If a file does not contain any \cs{ProvidesSomething} line, +% it will be read in its entirety, which might lead to errors. Or if +% there is any weird stuff preceding the \cs{ProvidesWhatever} line. +% But for well-behaved files the option seemed useful enough to be +% worth implementing. +% +% \end{description} % % \StopEventually{} % @@ -232,11 +333,7 @@ % Standard declaration of package name and date. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{snapshot}[2002/03/05 v1.14] -% \end{macrocode} -% -% \begin{macrocode} -\let\@xp\expandafter \let\@nx\noexpand +\ProvidesPackage{snapshot}[2012/08/06 v2.13] % \end{macrocode} % % Calling the \pkg{snapshot} package in a document causes \latex/ to @@ -260,11 +357,31 @@ % available; if the second piece is not present, a dummy number % \verb'0.0' is supplied. Similarly, files that don't include any % \cn{ProvidesWhatever} statement will get a dummy date of -% \verb'0000/00/00'; \tex/ system administrators who want to ensure +% \verb'0000/00/00'; +% \begin{center}\begin{minipage}{.9\columnwidth}\bfseries +% \medskip +% \tex/ system administrators who want to ensure % maximal accuracy of the snapshot information should therefore make % it a practice to use \cn{ProvidesFile} in \fn{.cfg} files and other % local files that might have an impact on the output fidelity of % their documents. +% \end{minipage}\end{center} +% +% A couple of shorthand forms. +% \begin{macrocode} +\let\@xp=\expandafter \let\@nx=\noexpand +% \end{macrocode} +% +% A function to compare two strings and return FT or TT (for use with +% \cs{if}). +% \begin{macrocode} +\def\str@cmp#1#2\str@cmp#3{% + \if #1#3\else F\@car\fi \str@cmp#2\str@cmp +} +\def\string@equal#1#2{% + \str@cmp#1\relax\str@cmp#2{\relax\@gobbletwo}\@nil TT% +} +% \end{macrocode} % % \begin{macro}{\RequireVersions} % @@ -272,15 +389,47 @@ % particular collection of files. This might be useful for setting a % \tex/ inputs path. % \begin{macrocode} -\newcommand{\RequireVersions}[2][]{% - \let\snap@check\snap@compare@versions - \let\snap@selfcheck\snap@selfcheck@a - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% +\newcommand{\RequireVersions}[2][]{}% +\renewcommand{\RequireVersions}[1][]{% + \def\snap@check{\snap@compare@versions}% + \toks@{#1}\afterassignment\snap@storem + \let\@let@token= +} +\def\snap@storem{% + \ifx\@let@token\bgroup + \else + \PackageError{snapshot}{Expected a `\@charlb' character here}\@ehc + \@xp\@gobblefour + \fi + \futurelet\@let@token\snap@branch } \@onlypreamble\RequireVersions % \end{macrocode} % % \begin{macrocode} +\let\snap@check\@gobble +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@finish{\toks@\bgroup} +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@branch{% + \ifx\@let@token\egroup + \@xp\snap@finish + \else\ifx\@let@token *% + \let\reserved@c\snap@store@version + \else\ifx\@let@token\@sptoken + \lowercase{\def\reserved@c} {\futurelet\@let@token\snap@branch}% + \else + \let\reserved@c\snap@store@error + \fi\fi\fi + \reserved@c +} +% \end{macrocode} +% +% \begin{macrocode} \def\snap@store@error#1{% \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc } @@ -294,6 +443,48 @@ \@onlypreamble\snap@store@version % \end{macrocode} % +% Detection of e-\LaTeX{}, pdf\LaTeX{}, pdfe\LaTeX{}, and Lambda +% [Omega]: +% \begin{macrocode} +\ifx\OmegaVersion\@@undefined +\else + \edef\snapshotApplication{% + {Omega}\space\space\space + {0000/00/00 v\OmegaVersion}% + }% +\fi +\ifx\eTeXversion\@@undefined +\else + \edef\snapshotApplication{% + {eTeX}\space\space\space\space + {0000/00/00 v\number\eTeXversion\eTeXrevision}% + }% +\fi +\ifx\pdftexversion\@@undefined +\else + \edef\snapshotApplication{% + \ifx\eTeXversion\@@undefined + {pdfTeX}\space\space + \else + {pdfeTeX}\space + \fi + {0000/00/00 v0.\number\pdftexversion\pdftexrevision}% + }% +\fi +% \end{macrocode} +% If none of the above information is available, the exact version +% number of \TeX{} is not accessible from inside \latex/. We then +% fall back to using a nominal date of 1990/03/25, which is when +% version 3.0 of \fn{tex.web} was released by Knuth. +% \begin{macrocode} +\@ifundefined{snapshotApplication}{% + \edef\snapshotApplication{% + {TeX}\space\space\space\space\space + {1990/03/25 v3.x}% + }% +}{} +% \end{macrocode} +% % \begin{macrocode} \def\@fmtextension{fmt} \def\@tfmextension{tfm} @@ -301,9 +492,11 @@ \edef\snapx@class{.\@clsextension} \edef\snapx@format{.\@fmtextension} \edef\snapx@tfm{.\@tfmextension} -\long\def\snapx@application{} -\let\snap@file=\@empty +\long\def\snapx@ignore{} +\let\snapx@application=\snapx@ignore +\let\snapx@file=\@empty \let\snapx@end\@@end +\expandafter\let\csname snapx@-------\endcsname\snapx@end % \end{macrocode} % % For a package named \fn{foo.sty}, this function defines @@ -311,7 +504,7 @@ % \begin{macrocode} \def\snap@store@b#1#2#3#4{% \ifx#1\snapx@end - \@xp\@gobblefour + \@xp\snap@finish \else \ifx#1\relax \let#1\@empty\fi \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% @@ -319,18 +512,23 @@ % % \begin{macrocode} \ifx#1\snapx@application + \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% \else - \xdef\rqv@list{\rqv@list - \ifx\@empty\rqv@list\else,\fi - #3#1% - }% - \fi - \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% - \ifx#1\snapx@format \snap@check{#3.fmt}% - \else \snap@selfcheck{#3.sty}% + \xdef\rqv@list{\rqv@list{#3#1}}% + \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% + \snap@intest{#3}{#1}% + \ifx#1\snapx@format \snap@check{#3.fmt}% +% \end{macrocode} +% Test if current file is \fn{snapshot.sty}. Need to pre-expand the +% extension part to ensure the test is correct. +% \begin{macrocode} + \else + \edef\@tempa{\@nx\string@equal{snapshot.sty}{#3#1}}% + \if\@tempa \snap@selfcheck \fi + \fi \fi \fi - \@ifnextchar *\snap@store@version\snap@store@error + \futurelet\@let@token\snap@branch } \@onlypreamble\snap@store@b % \end{macrocode} @@ -356,21 +554,11 @@ % \end{macrocode} % % The purpose of the `test' option is to support a separate testing -% procedure that resolves file names. If the \cs{RequireVersions} -% data is extracted to a separate file, and -%\begin{verbatim} -%\RequirePackage[test]{snapshot} -%\end{verbatim} -% is added at the top, then the file can be run as a small separate -% \LaTeX{} job whose sole purpose is to produce in the log file a -% nice list of fully resolved file names. A limited, but -% system-independent variant of the \fn{kpsewhich} idea. -% +% procedure for resolving file names and pre-checking version +% numbers. See \secref{test} for more information. % \begin{macrocode} -\let\snap@fake@b\relax -\DeclareOption{test}{% - \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% -} +\let\snap@intest=\@gobbletwo +\DeclareOption{test}{\def\snap@intest{True}} % \end{macrocode} % % For each font used by a document, we would like to list the @@ -402,6 +590,7 @@ % \begin{macrocode} \DeclareOption{error}{% \def\snap@mismatch{\PackageError}% + \def\snap@selfcheck{\snap@selfcheck@a}% \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi } % \end{macrocode} @@ -409,23 +598,32 @@ % \begin{macrocode} \DeclareOption{warning}{% \def\snap@mismatch{\snap@mismatch@warning}% + \def\snap@selfcheck{\snap@selfcheck@a}% \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi } % \end{macrocode} % % Because the exact form of the version number is not mandated by -% LaTeX, just take the first two ``words'' delimited by spaces. And -% take a little extra care to properly handle multiple spaces between -% the words. +% \LaTeX{}, just take the first two ``words'' delimited by spaces. +% And take a little extra care to properly handle multiple spaces +% between the words. % \begin{macrocode} \def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} \let\snap@select\@empty % \end{macrocode} % +% If the naming conventions seem a little peculiar here, it's because +% I had to add some pieces later that I didn't think of initially, +% and I wanted to minimize the chances of compatibility problems for +% client packages [mjd,2002-11-04]. % \begin{macrocode} -\DeclareOption{date}{% - \def\snap@select#1#2 #3\@nil{#1#2}% -} +\def\snap@seldate#1#2 #3\@nil{#1#2}% +\def\snap@selversion#1#2 #3{\snap@select@version #3}% +\def\snap@selmajor#1#2 #3{\snap@select@major #3}% +% \end{macrocode} +% +% \begin{macrocode} +\DeclareOption{date}{\let\snap@select=\snap@seldate} % \end{macrocode} % % \begin{macrocode} @@ -440,19 +638,45 @@ % \end{macrocode} % % \begin{macrocode} -\DeclareOption{version}{% - \def\snap@select#1#2 #3{\snap@select@version #3}% +\DeclareOption{version}{\let\snap@select\snap@selversion} +\DeclareOption{major-version}{\let\snap@select\snap@selmajor} +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@bbinfo{01} +\DeclareOption{bbinfo}{\def\snap@bbinfo{00}} +% \end{macrocode} +% +% Give this an inert definition, for the time being, until we are +% ready to do the split. +% \begin{macrocode} +\let\snap@splitter=? +\AtBeginDocument{% + \xdef\@filelist{\@filelist\snap@splitter}% } % \end{macrocode} % % \begin{macrocode} -\DeclareOption{major-version}{% - \def\snap@select#1#2 #3{\snap@select@major #3}% +\let\snap@selfcheck\@empty +\let\snap@selfcheck@a\@empty +% \end{macrocode} +% +% The \opt{self-warning} option would normally be used in conjunction +% with the \opt{error} option. +% \begin{macrocode} +\DeclareOption{self-warning}{% + \def\snap@selfcheck{% + \begingroup + \def\snap@mismatch{\snap@mismatch@warning}% + \snap@selfcheck@a + \endgroup + } } % \end{macrocode} % % \begin{macrocode} -\ProcessOptions\par +\ExecuteOptions{warning} +\ProcessOptions\relax % \end{macrocode} % % We need the following patch to make up for the fact that @@ -510,54 +734,36 @@ v\ifx\@tempc\fmtname 2.e\else ?.?\fi }% \fi +% \end{macrocode} +% Ensure that files get recorded. +% \begin{macrocode} \listfiles -\def\@dofilelist{% - \snap@restore@extensions - \ifx\rqv@list\@empty - \else \rqv@compare@lists - \fi - \ifx\snap@write\typeout - \else - \newwrite\snap@out - \immediate\openout\snap@out=\jobname.dep \relax - \fi - \snap@write{\string\RequireVersions\@charlb}% % \end{macrocode} -% Since the exact version number of \TeX{} is not normally accessible -% from inside \latex/, we use a nominal date of 1990/03/25, which is -% when version 3.0 of \fn{tex.web} was released by Knuth. +% % \begin{macrocode} - \snap@write{\space\space *{application}{TeX}% - \space\space\space\space\space{1990/03/25 v3.x}}% - \@for\@currname:=\@filelist\do{% - \filename@parse\@currname +\def\snap@doit#1{% + \begingroup + \ifx\delimiter#1\delimiter + \else + \filename@parse{#1}% + \let\@tempd\@empty \ifx\filename@ext\relax - \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% - \def\@tempb{~~~}% + \def\@tempa{file}\def\@tempb{~~~}% \else\ifx\filename@ext\@pkgextension - \def\@tempa{package}\let\@tempd\@empty - \def\@tempb{}% + \def\@tempa{package}\let\@tempb\@empty \else\ifx\filename@ext\@clsextension - \def\@tempa{class}\let\@tempd\@empty - \def\@tempb{~~}% + \def\@tempa{class}\def\@tempb{~~}% \else\ifx\filename@ext\@fmtextension - \def\@tempa{format}\let\@tempd\@empty - \def\@tempb{~}% + \def\@tempa{format}\def\@tempb{~}% \else\ifx\filename@ext\@tfmextension - \def\@tempa{tfm}\let\@tempd\@empty - \def\@tempb{~~~~}% + \def\@tempa{tfm}\def\@tempb{~~~~}% \else \def\@tempa{file}\edef\@tempd{.\filename@ext}% \def\@tempb{~~~}% \fi\fi\fi\fi\fi \@xp\let\@xp\@tempe - \csname ver@\filename@base.\filename@ext\endcsname -% \end{macrocode} -% If a file contains just \verb'\ProvidesFoo{xyz}' without \emph{any} -% optional argument, then \cs{ver@xyz} ends up empty. Resetting it to -% \cs{relax} is the easiest way to get the fallback version -% number in that case also. -% \begin{macrocode} + \csname ver@\filename@base % + \ifx\filename@ext\relax\else.\filename@ext\fi\endcsname \ifx\@tempe\@empty \let\@tempe\relax \fi \edef\@tempe{% \ifx\@tempe\relax 0000/00/00 v0.0% @@ -567,10 +773,91 @@ }% \edef\@tempc{\filename@area\filename@base\@tempd}% full file name \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd - \begingroup \let~\space - \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% - \endgroup + \let~\space + \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% + \fi + \aftergroup\snap@doit + \endgroup +}% +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@bracify#1#2,{% + \ifx\@empty#1\expandafter\@gobble\else {#1#2}\fi \snap@bracify +} +\def\snap@splitter@a{% + \iffalse{{\fi }}% close current file name, end definition + \xdef\specific@files{% + \iffalse}\fi + \specific@files + \expandafter\@gobble\string % discard one closing brace +} +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@fdcheck#1{% + \ifx\delimiter#1\@xp\@gobble + \else\snap@fda#1\@empty.fd\@empty ?\@nil + \fi + \snap@fdcheck +} +\def\snap@fda#1.fd\@empty#2#3\@nil{% + \if ?#2% + \xdef\specific@files{\specific@files {#1}}% + \else + \xdef\general@files{\general@files {#1.fd}}% + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\let\general@files\@empty +\let\specific@files\@empty +% \end{macrocode} +% +% The \cn{SpecialInput} command is related to the \opt{packages-only} +% option. Apart from some ad hoc handling for \fn{.fd} files that get +% loaded on demand, all files that are input after +% \verb'\begin{document}' are put into the specific-files list, and +% all files before \verb'\begin{document}' go into the general-files +% (packages-only) list. If there is a macro file for a book (say), +% that contains definitions specific to that book, and that is loaded +% in the preamble, loading it with \cs{SpecialInput} will cause it to +% go in the specific-files list. +% \begin{macrocode} +\newcommand{\SpecialInput}[1]{% + \xdef\specific@files{\specific@files{#1}}% + \@@input#1\relax +} +% \end{macrocode} +% +% Our definition of \cs{@dofilelist} does not retain much resemblance +% to the original in the \LaTeX{} kernel. +% \begin{macrocode} +\def\@dofilelist{% + \snap@restore@extensions + \xdef\general@files{\@xp\snap@bracify \@filelist \@empty,\@empty,}% + \let\snap@splitter\snap@splitter@a + \xdef\general@files{\general@files}% + \let\@tempa\specific@files \global\let\specific@files\@empty + \@xp\snap@fdcheck\@tempa{\delimiter}% + \ifx\rqv@list\@empty + \else \rqv@compare@lists + \fi + \ifx\snap@write\typeout + \else + \newwrite\snap@out + \immediate\openout\snap@out=\jobname.dep \relax + \fi + \snap@write{\string\RequireVersions\@charlb}% + \snap@write{\space\space *{application}% + \snapshotApplication }% + \@xp\snap@doit\general@files{\delimiter\aftergroup\@gobble\@gobble}% + \ifx\specific@files\@empty + \else + \snap@specific + \fi \snap@write{\@charrb}% \ifx\snap@write\typeout \else \immediate\closeout\snap@out @@ -579,102 +866,86 @@ }% % \end{macrocode} % +% \begin{macrocode} +\def\snap@specific{% + \snap@write{ \space *{-------}{Document-specific files:}{----}}% + \@xp\snap@doit\specific@files{\delimiter\aftergroup\@gobble\@gobble}% +} +% \end{macrocode} +% % The \cs{rqv@compare@lists} function checks to see if any files -% are found only in the RequireVersions list or only in -% \cs{@filelist}. To see which files are only in \cs{@filelist}, we -% map the \cs{rqv@condense} function across both lists, reinitializing -% \cs{L} (used here as a scratch variable) in between. As a side -% effect this leaves the desired file names in \cs{L}. Then the same -% process with the order of the lists reversed tells us which ones -% are only in \cs{rqv@list}. -% \begin{macrocode} -\def\rqv@condense#1,{% - \if ,#1,% +% are found only in the RequireVersions list or only in the +% \cs{general@files} list. +% \begin{macrocode} +\def\rqv@condense#1{% + \@xp\ifx\csname ver@#1\endcsname\N \else - \@xp\ifx\csname ver@#1\endcsname\N - \else - \edef\L{\L,#1}% - \@xp\let\csname ver@#1\endcsname=\N - \fi + \edef\L{\L{#1}}% + \@xp\let\csname ver@#1\endcsname=\N \fi \rqv@condense } +\def\rqv@condend{\endcsname ?\fi + \@xp\@xp\@xp\@gobbletwo\csname @xp\iftrue} % \end{macrocode} % % \begin{macrocode} -\def\rqv@compare@lists{% - \begingroup - \def\N{1}\let\L=\@gobble - \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \let\rqv@list=\L - \let\L=\@gobble - \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space loaded though not in - \noexpand\RequireVersions list% - }\@ehc - }% - \def\N{2}\let\L=\@gobble - \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \let\L=\@gobble - \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space [\csname rqv@\@currname\endcsname] - required but not loaded% - }\@ehc - }% - \endgroup +\def\rqv@overloaded#1{% + \snap@mismatch{snapshot}{^^J% + File #1 loaded though not in \noexpand\RequireVersions list% + }\@ehc } % \end{macrocode} % -% See the documentation above for the `test' option. % \begin{macrocode} -\begingroup \catcode\endlinechar=12\relax % -\long\gdef\snap@ignoline#1 -{}\endgroup % +\def\rqv@notloaded#1{% + \snap@mismatch{snapshot}{^^J% + File #1 [\csname rqv@#1\endcsname] required but not loaded% + }\@ehc +} % \end{macrocode} % % \begin{macrocode} -\def\snap@fake@input#1#2#3#4{% - \ifx#1\snapx@end - \aftergroup\@@end \@xp\@gobblefour - \else - \ifx#1\snapx@format - \else - \message{^^J}% - \@xp\snap@fake@b\@@input #3#1\relax - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} +\def\rqv@set#1{\@xp\let\csname ver@#1\endcsname\N \rqv@set} +\def\rqv@test#1{\csname ver@#1\endcsname{#1}\rqv@test} % \end{macrocode} % % \begin{macrocode} -\newcommand{\rqvTest}[2][]{% - \begingroup \catcode\endlinechar=12 - \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax +\def\rqv@compare@lists{% + \begingroup % \end{macrocode} -% Since \cs{snap@fake@input} just compares \cs{snapx@foo} with -% \cs{ifx}, making \cs{snapx@application} -% and \cs{snapx@tfm} compare equal to \cs{snap@format} -% ensures that only one comparison is needed to tell if -% we shouldn't attempt to input the current file type. +% Clear up duplicate file names (just in case) to avoid redundant +% warning messages. This should seldom be necessary in practice. % \begin{macrocode} - \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% - \endgroup -} + \def\N{1}\let\L\@empty + \@xp\rqv@condense\rqv@list\rqv@condend + \global\let\rqv@list=\L + \def\N{2}\let\L\@empty + \@xp\rqv@condense\general@files\rqv@condend + \global\let\general@files=\L % \end{macrocode} -% +% Let's make a shorthand for the code that terminates our recursion. % \begin{macrocode} -\@ifundefined{snap@fake@b}{}{% - \let\snap@store@b\snap@fake@input - \let\RequireVersions\rqvTest + \def\T{\@firstoftwo{\endcsname\@empty\@gobbletwo}}% +% \end{macrocode} +% Set all the loaded general files to an error function. +% \begin{macrocode} + \let\N\rqv@overloaded \@xp\rqv@set\general@files \T +% \end{macrocode} +% Set all the required files to an ignore function. +% \begin{macrocode} + \let\N\@gobble \@xp\rqv@set\rqv@list \T +% \end{macrocode} +% Execute all the general files. +% \begin{macrocode} + \@xp\rqv@test\general@files{\endcsname\csname @gobbletwo}% +% \end{macrocode} +% And now do essentially the same thing in the reverse direction. +% \begin{macrocode} + \let\N\rqv@notloaded \@xp\rqv@set\rqv@list \T + \let\N\@gobble \@xp\rqv@set\general@files \T + \@xp\rqv@test\rqv@list{\endcsname\csname @gobbletwo}% + \endgroup } % \end{macrocode} % @@ -694,24 +965,94 @@ } % \end{macrocode} % -% Terminate here without touching \LaTeX{} internals, unless -% one of the relevant snapshot options was chosen. +% Because \cs{ProvidesFile} is used in \fn{.fd} files which are +% normally read with special catcodes, there tend to +% be problems with whitespace characters being erroneously lost from +% the second argument. Since we have to put in a \cs{snap@check} call +% anyway, while we're at it let's fix a bug of this type that +% affected some older versions of \latex/. % \begin{macrocode} -\let\snap@compare@versions\@gobble \let\snap@check\@gobble -\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble -\ifx\snap@select\@empty \endinput \fi +\def\ProvidesFile#1{% + \def\snap@checker{\snap@check{#1}}% + \begingroup + \aftergroup\snap@checker + \catcode`\ 10 +% \end{macrocode} +% Added guards from 2001/06/01 version of \latex/. These are +% necessary because, for example, \pkg{inputenc} sets +% \cs{endlinechar} to a large (nonvalid character) value when +% reading input encoding files. The guards prevent an ``invalid +% character'' error. +% \begin{macrocode} + \ifnum\endlinechar < 256 + \ifnum \endlinechar>\m@ne + \catcode\endlinechar 10 + \fi + \fi + \@makeother\/% + \@makeother\&% + \kernel@ifnextchar[{\snap@providesfile{#1}}{\snap@providesfile{#1}[]}% +} +% \end{macrocode} +% +% Normally the string found in the second arg of \cs{ProvidesFile} +% (for a nongraphics file) would begin with the usual date string. +% The \cs{includegraphics} command, however, begins the second arg +% with \texttt{Graphic file} instead. This test therefore just checks +% if the first two letters are \texttt{Gr}; this is enough, +% ordinarily, for us to conclude that we are dealing with a graphic +% file. +% \begin{macrocode} +\def\snap@graphic@test#1#2#3\@nil{r\if G#1#2\else X\fi} +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@providesfile#1[#2]{% + \wlog{File: #1 #2}% + \if\snap@graphic@test#2@@\@nil + \snap@record@graphic#1\relax #2 (type ??)\@nil + \else + \expandafter\xdef\csname ver@#1\endcsname{#2}% + \fi + \endgroup +} +% \end{macrocode} +% +% This is what \cn{includegraphics} does to record graphic file +% information. +%\begin{verbatim} +%\@providesfile #1[#2]-> +%\wlog {File: #1 #2}\expandafter \xdef \csname ver@#1\endcsname {#2} +%\endgroup +%#1<-\Gin@base \Gin@ext +%#2<-Graphic file (type eps) +%\end{verbatim} +% +% Check the graphics info. +% \begin{macrocode} +\def\snap@record@graphic#1\relax #2(type #3)#4\@nil{% + \expandafter\xdef\csname ver@#1\endcsname{% + Graphic% + \if\snap@bbinfo :bb=\Gin@llx/\Gin@lly/\Gin@urx/\Gin@ury\fi + \space v0.0% + }% +} % \end{macrocode} % % \begin{macrocode} -\begingroup \catcode`\.=11\relax -\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} -\gdef\snap@selfcheck@a#1{% - \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% - \rqv@snapshot.sty F\@nil - \snap@check{#1}% +\def\@pr@videpackage [#1]{% + \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% + \ifx\@currext\@clsextension + \typeout{Document Class: \@gtempa\space#1}% + \else + \wlog{Package: \@gtempa\space#1}% \fi + \snap@check{\@currname.\@currext}% } -\endgroup +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@selfcheck@a{\snap@check{snapshot.sty}} % \end{macrocode} % % \begin{macrocode} @@ -747,61 +1088,210 @@ \fi }% \endgroup +% \end{macrocode} +% When the \opt{test} option is in effect, jump out of the current +% file instead of continuing. +% \begin{macrocode} + \snap@test@abort } % \end{macrocode} % -% Because \cs{ProvidesFile} is used in \fn{.fd} files which are -% normally read with special catcodes, there tend to -% be problems with whitespace characters being erroneously lost from -% the second argument. Since we have to put in a \cs{snap@check} call -% anyway, while we're at it let's fix a bug of this type that -% affected some older versions of \latex/. % \begin{macrocode} -\def\ProvidesFile#1{% - \def\snap@checker{\snap@check{#1}}% - \begingroup - \aftergroup\snap@checker - \catcode`\ 10\catcode\endlinechar 10 % - \@makeother\/% - \@makeother\&% - \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% +\let\snap@test@abort=\@empty +% \end{macrocode} +% +% \section{Compatibility} +% +% Suppose that I have a \lat/ document containing a +% \cs{RequireVersions} statement generated by \pkg{snapshot} and I +% send this to my colleague who, we believe, has a \lat/ setup that +% is for our purposes identical. Suppose that our belief is erroneous +% in the following way: My colleague has a newer version of +% \pkg{snapshot} and a newer version of one of the affected files. +% +% Here is what we \strong{don't} want to happen: That the differing +% version of snapshot would cause the other differing file to be +% accepted without demur. +% +% Conversely, if it is I who have the newer version of +% \pkg{snapshot}, the main concern is that some difference in the +% contents of the \cs{RequireVersions} statement would lead to an +% error when my colleague attempts to process the document. +% +% \section{In conclusion} +% +% \begin{macrocode} +\ifx\snap@select\@empty + \let\snap@compare@versions\@gobble + \let\snap@check\@gobble +\fi +% \end{macrocode} +% +% Fallback for a command that is sometimes used in AMS journal +% production. +% \begin{macrocode} +\providecommand{\controldates}[1]{} +% \end{macrocode} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section{And finally \dots}\label{test} +% +% If the embedded \cs{RequireVersions} +% data in a \lat/ document is extracted to a separate file, and +%\begin{verbatim} +%\RequirePackage[test]{snapshot} +%\end{verbatim} +% is added at the top, then the file can be run as a small separate +% \LaTeX{} job that will, among other things, produce in the log file +% a nice list of fully resolved file names\mdash sort of a limited, +% but system-independent variant of the \fn{kpsewhich} idea. +% \begin{macrocode} +\ifx\snap@intest\@gobbletwo \endinput \fi +% \end{macrocode} +% +% Some old, ill-behaved packages might throw in a \cs{makeatother} at +% the end which can cause problems for the next file that comes along +% when testing. +% \begin{macrocode} +\def\restore@some@catcodes{} +\def\save@some@catcodes{% + \edef\restore@some@catcodes{% + \catcode\number`\@=\number\catcode`\@ + \catcode\number`\"=\number\catcode`\" + \catcode\number`\^=\number\catcode`\^ + \catcode\number`\_=\number\catcode`\_ + \relax + }% } % \end{macrocode} % +% Some typical calls of \cs{snap@intest}: +%\begin{verbatim} +% \snap@intest{LaTeX2e}{\snapx@format} +% \snap@intest{snapshot}{\snapx@package} +% \snap@intest{mcom-l}{\snapx@class} +% \snap@intest{amsmath}{\snapx@package} +% \snap@intest{umsa.fd}{\snapx@file} +% \snap@intest{pictex}{\snapx@file} +%\end{verbatim} +% +% The extant public versions of the following files (in the teTeX +% distribution, at least) are known to be problematic when we are +% trying to read a \cs{ProvidesWhatever} line from the top of the +% file: psfig.sty, pictex.sty, pictex.tex, epic.sty, amstex.sty, +% xy.tex. Either (a) they don't have a \cs{ProvidesWhatever} line at +% all, or (b) they include some code before the \cs{ProvidesWhatever} +% line that makes some assumption true in normal processing but false +% in snapshot-test processing. E.g., there is code in \fn{amstex.sty} +% that assumes \cs{documentstyle} or \cs{documentclass} was already +% executed and that the \cs{if@compatibility} switch got set +% accordingly. +% % \begin{macrocode} -\def\@pr@videpackage[#1]{% - \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% - \ifx\@currext\@clsextension - \typeout{Document Class: \@gtempa\space#1}% +\def\snap@intest#1#2{% + \message{^^J}% + \begingroup \edef\0{#1#2}\def\9{latex209.def}% + \ifx\0\9\global\@compatibilitytrue \fi + \ifx#2\snapx@format +% \end{macrocode} +% If arg1 + arg2 = ``LaTeX2e.fmt'', the calling function +% \cs{snap@storeb} will run \cs{snap@check} separately. +% This is a crude way of making things work in that case without +% much extra trouble. +% \begin{macrocode} + \def\snap@test@abort{\endgroup}% \else - \wlog{Package: \@gtempa\space#1}% + \edef\N{% + \noexpand\snap@intest@b{#1#2}% + {#1}{\@xp\@gobble#2\@empty}% + {\csname rqv@#1#2\endcsname}}% + \expandafter\endgroup\N \fi - \snap@check{\@currname.\@currext}% } % \end{macrocode} % -% The usual \cs{endinput} to ensure that random garbage at the end of -% the file doesn't get copied by \fn{docstrip}. % \begin{macrocode} -\endinput +\def\snap@intest@b#1#2#3#4{% + \def\@currname{#2}\def\@currext{#3}% + \begingroup \lccode`\/=`\0\relax\lowercase{\endgroup + \ifnum\snap@seldate#4 00 0\@nil>\z@ + }% matches \lowercase + \save@some@catcodes + \@@input #1 \relax + \restore@some@catcodes + \else + \snap@specialtest{#1}{#4}% + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\snap@specialtest#1#2{% + \fake@input{#1}% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\fake@input#1{% + \begingroup + % Ensure that outer \foo or unmatched braces don't trip us up + \catcode`\\=12 \catcode`\{=12 \catcode`\}=12 + \endinput +% \end{macrocode} +% Note that these definitions of \cs{G} and \cs{?} are local, and +% recall that one-letter cs names don't use up hash table entries. +% \begin{macrocode} + \def\G{\@car\endgroup}% + \expandafter\futurelet\expandafter\?\expandafter\G\@@input#1 \relax\@nil +} +% \end{macrocode} +% +% \begin{macrocode} +\let\snap@test@abort=\endinput +\let\snap@selfcheck=\@empty % \end{macrocode} % -% \section*{To Do} +% There's an extra close-brace left hanging around at the end, but I +% guess we don't care. +% \begin{macrocode} +\def\snap@finish{%% + \endgroup \message{^^J}% + \def\X##1{##1,\X}% + \edef\@filelist{\@xp\X\rqv@list{\@gobbletwo}}% + \def\X##1,?{##1}\edef\@filelist{\@xp\X\@filelist ?}% + \@dofilelist + \@@end +}% +% \end{macrocode} % -% \begin{itemize} -% \item Provide a test to distinguish between shared-use files and -% document-specific files? Document-specific files would be things -% like graphics files loaded via \cs{includegraphics} or book -% chapters loaded via \cs{include}. But there might also be something -% like \verb'\input{my-book-macros}' in the preamble. Maybe authors -% should be encouraged to put this after \verb'\begin{document}'? Or, -% even, after \verb'\begin{abstract}' so that the abstract will -% contain only lowest-common-denominator \LaTeX{} commands? +% \begin{macrocode} +\def\snap@mismatch#1#2#3{} +% \end{macrocode} % -% The non-document-specific files most commonly loaded after -% \verb'\begin{document}' would be \fn{.fd} files, but there is also -% the possibility of autoloaded stuff (\fn{alatex} format). -% \end{itemize} +% Problematic: xy.sty, because it calls xy.tex before it calls +% \cs{ProvidesPackage}. And pictex.tex because it doesnt use +% \cs{ProvidesFile} at all. +% \begin{macrocode} +\renewcommand{\RequireVersions}[2][]{% + \begingroup + \makeatletter + \def\snap@check{\snap@compare@versions}%% + \let\snapx@tfm=\snap@ignore +% \end{macrocode} +% This seems to help, with english.ldf for example, to prevent an +% endless loop when attempting to load babel.def. +% \begin{macrocode} + \def\ProvidesLanguage##1{\ProvidesFile{##1.ldf}}% + \iffalse{\fi \futurelet\@let@token\snap@branch #2}% + \endgroup +} +% \end{macrocode} +% +% The usual \cs{endinput} to ensure that random garbage at the end of +% the file doesn't get copied by \fn{docstrip}. +% \begin{macrocode} +\endinput +% \end{macrocode} % -% \CheckSum{777} +% \CheckSum{1209} % \Finale diff --git a/macros/latex/contrib/snapshot/snapshot.ins b/macros/latex/contrib/snapshot/snapshot.ins index d30602c46e..262760e4c9 100644 --- a/macros/latex/contrib/snapshot/snapshot.ins +++ b/macros/latex/contrib/snapshot/snapshot.ins @@ -1,12 +1,77 @@ -% Normal installation of this package in a standard TDS texmf tree: -% Put snapshot.sty into the directory texmf/tex/latex/misc. -% Put snapshot.dvi (produced by running LaTeX on snapshot.dtx) into -% texmf/doc/latex/misc. +%% filename: snapshot.ins +%% version: 1.00 +%% date: 2010/08/13 +%% +%% American Mathematical Society +%% Technical Support +%% Publications Technical Group +%% 201 Charles Street +%% Providence, RI 02904 +%% USA +%% tel: (401) 455-4080 +%% (800) 321-4267 (USA and Canada only) +%% fax: (401) 331-3842 +%% email: tech-support@ams.org +%% +%% Copyright 2010 American Mathematical Society. +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is the American Mathematical +%% Society. +%% +%% ==================================================================== + +\input docstrip + +\askforoverwritefalse + +\keepsilent -\def\batchfile{snapshot.ins} -\input docstrip.tex \preamble + +Copyright 2001, 2004, 2006, 2007, 2010, 2012 American Mathematical Society. + +American Mathematical Society +Technical Support +Publications Technical Group +201 Charles Street +Providence, RI 02904 +USA +tel: (401) 455-4080 + (800) 321-4267 (USA and Canada only) +fax: (401) 331-3842 +email: tech-support@ams.org + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3c +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This work has the LPPL maintenance status `maintained'. + +The Current Maintainer of this work is the American Mathematical +Society. + \endpreamble -\keepsilent + +\usedir{tex/latex/snapshot} + +\generate{% + \file{snapshot.sty}{\from{snapshot.dtx}{}} +} + \generateFile{snapshot.sty}{f}{\from{snapshot.dtx}{}} -\endinput + +\endbatchfile diff --git a/macros/latex/contrib/snapshot/snapshot.pdf b/macros/latex/contrib/snapshot/snapshot.pdf Binary files differindex d1925581ff..0dfa0f13f6 100644 --- a/macros/latex/contrib/snapshot/snapshot.pdf +++ b/macros/latex/contrib/snapshot/snapshot.pdf diff --git a/macros/latex/contrib/snapshot/snapshot.sty b/macros/latex/contrib/snapshot/snapshot.sty deleted file mode 100644 index 6646abaa2c..0000000000 --- a/macros/latex/contrib/snapshot/snapshot.sty +++ /dev/null @@ -1,341 +0,0 @@ -%% -%% This is file `snapshot.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% snapshot.dtx -%% -%%% ==================================================================== -%%% @LaTeX-doc-source-file{ -%%% filename = "snapshot.dtx", -%%% version = "1.14", -%%% date = "2002/03/05", -%%% time = "15:29:00 EST", -%%% checksum = "39090 807 3449 29761", -%%% author = "American Mathematical Society", -%%% copyright = "Copyright 2001 American Mathematical Society, -%%% all rights reserved. Copying of this file is -%%% authorized only if either: -%%% (1) you make absolutely no changes to your copy, -%%% including name; OR -%%% (2) if you do make changes, you first rename it -%%% to some other name.", -%%% address = "American Mathematical Society, -%%% Electronic Products and Services, -%%% PO Box 6248, -%%% Providence, RI 02940, -%%% USA", -%%% email = "tech-support@ams.org", -%%% URL = "http://www.ams.org/", -%%% supported = "yes", -%%% keywords = "version, compatibility, dependencies, LaTeX", -%%% abstract = "This package provides a way for a LaTeX -%%% document to specify, for each external file -%%% on which the document depends, which version -%%% is required to guarantee output fidelity.", -%%% docstring = "The checksum field above contains a CRC-16 -%%% checksum as the first value, followed by the -%%% equivalent of the standard UNIX wc (word -%%% count) utility output of lines, words, and -%%% characters. This is produced by Robert -%%% Solovay's checksum utility.", -%%% } -%%% ==================================================================== -\NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{snapshot}[2002/03/05 v1.14] -\let\@xp\expandafter \let\@nx\noexpand -\newcommand{\RequireVersions}[2][]{% - \let\snap@check\snap@compare@versions - \let\snap@selfcheck\snap@selfcheck@a - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% -} -\@onlypreamble\RequireVersions -\def\snap@store@error#1{% - \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc -} -\@onlypreamble\snap@store@error -\def\snap@store@version #1#2#3#4{% - \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% -} -\@onlypreamble\snap@store@version -\def\@fmtextension{fmt} -\def\@tfmextension{tfm} -\edef\snapx@package{.\@pkgextension} -\edef\snapx@class{.\@clsextension} -\edef\snapx@format{.\@fmtextension} -\edef\snapx@tfm{.\@tfmextension} -\long\def\snapx@application{} -\let\snap@file=\@empty -\let\snapx@end\@@end -\def\snap@store@b#1#2#3#4{% - \ifx#1\snapx@end - \@xp\@gobblefour - \else - \ifx#1\relax \let#1\@empty\fi - \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% - \ifx#1\snapx@application - \else - \xdef\rqv@list{\rqv@list - \ifx\@empty\rqv@list\else,\fi - #3#1% - }% - \fi - \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% - \ifx#1\snapx@format \snap@check{#3.fmt}% - \else \snap@selfcheck{#3.sty}% - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\@onlypreamble\snap@store@b -\def\snap@write{\immediate\write\snap@out} -\let\snap@out\sixt@@n % fallback, probably never used -\DeclareOption{dep}{% - \def\snap@write{\immediate\write\snap@out}% -} -\DeclareOption{log}{% - \let\snap@write\typeout -} -\let\snap@fake@b\relax -\DeclareOption{test}{% - \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% -} -\DeclareOption{tfm}{% - \typeout{Option 'tfm' not implemented yet [1999/09/23]}% -} -\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} -\def\snap@mismatch{\snap@mismatch@warning} -\DeclareOption{error}{% - \def\snap@mismatch{\PackageError}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\DeclareOption{warning}{% - \def\snap@mismatch{\snap@mismatch@warning}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} -\let\snap@select\@empty -\DeclareOption{date}{% - \def\snap@select#1#2 #3\@nil{#1#2}% -} -\def\snap@select@version#1{% - \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi -} -\def\snap@sva#1.#2 #3\@nil{#1.#2} -\def\snap@select@major#1{% - \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi -} -\def\snap@svm#1.#2\@nil{#1} -\DeclareOption{version}{% - \def\snap@select#1#2 #3{\snap@select@version #3}% -} -\DeclareOption{major-version}{% - \def\snap@select#1#2 #3{\snap@select@major #3}% -} -\ProcessOptions\par -\edef\snap@restore@extensions{% - \def\@nx\@pkgextension{\@pkgextension}% - \def\@nx\@clsextension{\@clsextension}% -} -\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} -\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} -\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} -\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} -\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} -\def\snap@trim@c#1#2 #3\@nil{#2} -\let\rqv@list=\@empty -\edef\@tempc#1\fmtname{#1\fmtname}\@tempc -\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} -\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} -\if ?\@tempb?\@nil - \edef\@filelist{\fmtname.fmt,\@filelist}% - \def\@tempc{LaTeX2e}% - \@xp\edef\csname ver@\fmtname.fmt\endcsname{% - \fmtversion\space - v\ifx\@tempc\fmtname 2.e\else ?.?\fi - }% -\fi -\listfiles -\def\@dofilelist{% - \snap@restore@extensions - \ifx\rqv@list\@empty - \else \rqv@compare@lists - \fi - \ifx\snap@write\typeout - \else - \newwrite\snap@out - \immediate\openout\snap@out=\jobname.dep \relax - \fi - \snap@write{\string\RequireVersions\@charlb}% - \snap@write{\space\space *{application}{TeX}% - \space\space\space\space\space{1990/03/25 v3.x}}% - \@for\@currname:=\@filelist\do{% - \filename@parse\@currname - \ifx\filename@ext\relax - \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% - \def\@tempb{~~~}% - \else\ifx\filename@ext\@pkgextension - \def\@tempa{package}\let\@tempd\@empty - \def\@tempb{}% - \else\ifx\filename@ext\@clsextension - \def\@tempa{class}\let\@tempd\@empty - \def\@tempb{~~}% - \else\ifx\filename@ext\@fmtextension - \def\@tempa{format}\let\@tempd\@empty - \def\@tempb{~}% - \else\ifx\filename@ext\@tfmextension - \def\@tempa{tfm}\let\@tempd\@empty - \def\@tempb{~~~~}% - \else - \def\@tempa{file}\edef\@tempd{.\filename@ext}% - \def\@tempb{~~~}% - \fi\fi\fi\fi\fi - \@xp\let\@xp\@tempe - \csname ver@\filename@base.\filename@ext\endcsname - \ifx\@tempe\@empty \let\@tempe\relax \fi - \edef\@tempe{% - \ifx\@tempe\relax 0000/00/00 v0.0% - \else - \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil - \fi - }% - \edef\@tempc{\filename@area\filename@base\@tempd}% full file name - \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd - \begingroup \let~\space - \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% - \endgroup - }% - \snap@write{\@charrb}% - \ifx\snap@write\typeout - \else \immediate\closeout\snap@out - \typeout{Dependency list written on \jobname.dep.}% - \fi -}% -\def\rqv@condense#1,{% - \if ,#1,% - \else - \@xp\ifx\csname ver@#1\endcsname\N - \else - \edef\L{\L,#1}% - \@xp\let\csname ver@#1\endcsname=\N - \fi - \fi - \rqv@condense -} -\def\rqv@compare@lists{% - \begingroup - \def\N{1}\let\L=\@gobble - \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \let\rqv@list=\L - \let\L=\@gobble - \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space loaded though not in - \noexpand\RequireVersions list% - }\@ehc - }% - \def\N{2}\let\L=\@gobble - \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \let\L=\@gobble - \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space [\csname rqv@\@currname\endcsname] - required but not loaded% - }\@ehc - }% - \endgroup -} -\begingroup \catcode\endlinechar=12\relax % -\long\gdef\snap@ignoline#1 -{}\endgroup % -\def\snap@fake@input#1#2#3#4{% - \ifx#1\snapx@end - \aftergroup\@@end \@xp\@gobblefour - \else - \ifx#1\snapx@format - \else - \message{^^J}% - \@xp\snap@fake@b\@@input #3#1\relax - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\newcommand{\rqvTest}[2][]{% - \begingroup \catcode\endlinechar=12 - \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax - \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% - \endgroup -} -\@ifundefined{snap@fake@b}{}{% - \let\snap@store@b\snap@fake@input - \let\RequireVersions\rqvTest -} -\AtBeginDocument{% - \@ifundefined{ver@amsgen}{}{% - \@xp\let\csname ver@amsgen.sty\@xp\endcsname - \csname ver@amsgen\endcsname - }% -} -\let\snap@compare@versions\@gobble \let\snap@check\@gobble -\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble -\ifx\snap@select\@empty \endinput \fi -\begingroup \catcode`\.=11\relax -\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} -\gdef\snap@selfcheck@a#1{% - \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% - \rqv@snapshot.sty F\@nil - \snap@check{#1}% - \fi -} -\endgroup -\def\@nofmt#1.fmt.#2 {#1 } -\def\snap@mismatch@a#1#2#3{% - \snap@mismatch{snapshot}{^^J% - \space\space Required version #2 of \@nofmt#1.fmt. and^^J% - \space\space provided version #3 do not match% - }\@ehc -} -\def\snap@compare@versions#1{% - \begingroup - \@ifundefined{rqv@#1}{}{% - \edef\0{\csname rqv@#1\endcsname}% - \edef\1{\csname ver@#1\endcsname}% - \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% - \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% - \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% - \ifx\@tempa\@tempb - \else - \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% - \@xp\@tempd - \fi - }% - \endgroup -} -\def\ProvidesFile#1{% - \def\snap@checker{\snap@check{#1}}% - \begingroup - \aftergroup\snap@checker - \catcode`\ 10\catcode\endlinechar 10 % - \@makeother\/% - \@makeother\&% - \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% -} -\def\@pr@videpackage[#1]{% - \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% - \ifx\@currext\@clsextension - \typeout{Document Class: \@gtempa\space#1}% - \else - \wlog{Package: \@gtempa\space#1}% - \fi - \snap@check{\@currname.\@currext}% -} -\endinput -%% -%% End of file `snapshot.sty'. diff --git a/macros/latex/contrib/upmethodology/doc/upmethodology-doc.pdf b/macros/latex/contrib/upmethodology/doc/upmethodology-doc.pdf Binary files differindex f1bad92b53..c95d723e65 100644 --- a/macros/latex/contrib/upmethodology/doc/upmethodology-doc.pdf +++ b/macros/latex/contrib/upmethodology/doc/upmethodology-doc.pdf diff --git a/macros/latex/contrib/upmethodology/doc/upmethodology-doc.tex b/macros/latex/contrib/upmethodology/doc/upmethodology-doc.tex index c7b44593fb..c168be50c2 100644 --- a/macros/latex/contrib/upmethodology/doc/upmethodology-doc.tex +++ b/macros/latex/contrib/upmethodology/doc/upmethodology-doc.tex @@ -1,4 +1,4 @@ -\documentclass[book]{upmethodology-document} +\documentclass[book,taskpackage,specpackage,codepackage]{upmethodology-document} \setfrontcover{classic} @@ -9,6 +9,8 @@ \incsubversion{\makedate{08}{08}{2017}}{Fixing spelling errors and typos.}{\upmpublic} \incsubversion{\makedate{28}{11}{2017}}{Add 'standardlists' option.}{\upmpublic} \incsubversion{\makedate{04}{08}{2019}}{Add 'graphicspathcontext' option.}{\upmpublic} +\incversion{\makedate{17}{09}{2019}}{Add class options to include optional packages.}{\upmpublic} +%\incversion{\makedate{17}{09}{2019}}{Add the documentation for the \texttt{upmethodology-spec} package.}{\upmpublic} \addauthorvalidator*[galland@arakhne.org]{St{\'e}phane}{Galland}{Original Author} \addauthor*{Frans}{van Dunn\'e}{Reviewer} @@ -27,6 +29,7 @@ \let\VERtask\upm@package@task@ver \let\VERdocclazz\upm@package@docclazz@ver \let\VERcode\upm@package@code@ver +\let\VERspec\upm@package@spec@ver \makeatother \setpublisher{Arakhn\^e.org Group} @@ -66,9 +69,10 @@ Packages are: \item \texttt{upmethodology-document.sty}: provides functions to manage the project, the subproject and the status of the document; \item \texttt{upmethodology-frontpage.sty}: formats and provides a front page for the document; \item \texttt{upmethodology-backpage.sty}: formats and provides a back page for the document; -\item \texttt{upmethodology-task.sty}: is the \LaTeXe\xspace package that provides macros to manage project's tasks. +\item \texttt{upmethodology-task.sty}: is the \emph{optional} \LaTeXe\xspace package that provides macros to manage project's tasks. +\item \texttt{upmethodology-spec.sty}: is the \emph{optional} \LaTeXe\xspace package that provides macros to build a specification description. \item \texttt{upmethodology-document.cls}: is the \LaTeXe\xspace class that provides the whole document specification. It is based on \texttt{book} and on the previous packages; -\item \texttt{upmethodology-code.sty}: provides macros for source code formatting; +\item \texttt{upmethodology-code.sty}: provides \emph{optional} macros for source code formatting; \item \texttt{upmethodology-extension.sty}: provides macros for extension mechanism. \end{itemize} @@ -136,13 +140,13 @@ This section contains the list of all the package dependencies for the \texttt{u \item \texttt{a4wide} \item \texttt{hyperref} \item \texttt{upmethodology-backpage} -\item \texttt{upmethodology-code} +\item \texttt{upmethodology-code} (optional) \item \texttt{upmethodology-document} \item \texttt{upmethodology-extension} \item \texttt{upmethodology-frontpage} \item \texttt{upmethodology-p-common} -\item \texttt{upmethodology-spec} -\item \texttt{upmethodology-task} +\item \texttt{upmethodology-spec} (optionnal) +\item \texttt{upmethodology-task} (optionnal) \item \texttt{url} \end{itemize} @@ -319,6 +323,18 @@ nobackcover & do not put a cover page at the end of the document. \\ standardlists & The style does not override the standard list, description and enumeration definitions. \\ +\hline\hline + +codepackage & Include the \texttt{upmethodology-code} package. \\ + +\hline + +specpackage & Include the \texttt{upmethodology-spec} package. \\ + +\hline + +taskpackage & Include the \texttt{upmethodology-task} package. \\ + \hline \end{mtable} @@ -2074,6 +2090,86 @@ The provided macros are listed in the following table: \\ %########################################################### +%\chapter{Package upmethodology-spec} + +%\begin{center} +% \texttt{Version: \VERspec} +%\end{center} + +%The \LaTeX\ package \texttt{upmethodology-spec} provides a set of macros for building a specification document. + +%\section{Specification Definition} + +%The definition of a specification could be made only inside one of the following environments: \\ +%\texttt{{\textbackslash}begin\{detailspec\}[width]\{title\}...{\textbackslash}end\{detailspec\}} \\ +%\texttt{{\textbackslash}begin\{detailspec*\}[width]\{title\}...{\textbackslash}end\{detailspec*\}} \\ +%where \texttt{width} is the width of the specification box on the page, and \texttt{title} is the title of the specification box. + +%The environment \texttt{specdetail} displays the detailed description and uses a more complex rendering. On the other hand, \texttt{specdetail*} never displays the description and uses a simpler rendering. + +%\section{Components of a Specification} + +%A specification has several components that may be defined by the macros in the following table: +%\begin{tabularx}{\linewidth}{|>{\ttfamily}l|X|} +% \hline +% {\normalfont Macro} & Description \\ +% \hline\hline +% {\textbackslash}specfunc[modifiers]\{return type\}\{name\}\{parameters\} & \\ +% \hline +% {\textbackslash}speccons[modifiers]\{name\}\{parameters\} & \\ +% \hline +% {\textbackslash}specget[modifiers]\{return type\}\{name\} & \\ +% \hline +% {\textbackslash}specset[modifiers]\{return type\}\{name\} & \\ +% \hline\hline +% {\textbackslash}specparam[in|inout|out]\{name\}\{description\} & \\ +% \hline\hline +% {\textbackslash}specreturn[modifiers]\{description\} & \\ +% \hline +% {\textbackslash}specglobalreturn[modifiers]\{description\} & \\ +% \hline\hline +% {\textbackslash}specstarthline & \\ +% \hline +% {\textbackslash}specendhline & \\ +% \hline +%\end{tabularx} + +%\section{Examples of Specifications} + +%\subsection{Description of the specification} + +%Let consider a specification with a description: +%\begin{verbatim} +%\begin{detailspec}{Example 1} +% This is a description. +%\end{detailspec} +%\end{verbatim} + +%The previous \LaTeX\ code generates the following figure: +%\begin{detailspec}{Example 1} +% This is a description. +%\end{detailspec} + +%\subsection{Returned Values} + +%Let add into the previous example the specification of returned values: +%\begin{verbatim} +%\begin{detailspec}{Example 2} +% This is a description. +% \specreturn{description of a first returned value} +% \specreturn{description of a second returned value} +%\end{detailspec} +%\end{verbatim} + +%The previous \LaTeX\ code generates the following figure: +%\begin{detailspec}{Example 2} +%% This is a description. +%% \specreturn{description of a first returned value} +%% \specreturn{description of a second returned value} +%\end{detailspec} + +%########################################################### + \chapter{Authors and License} Copyright \copyright\ \upmcopyrightdate\ \makename{St\'ephane}{Galland} diff --git a/macros/latex/contrib/upmethodology/src/UPMVERSION.def b/macros/latex/contrib/upmethodology/src/UPMVERSION.def index 02b668610d..fbd7b4b22f 100644 --- a/macros/latex/contrib/upmethodology/src/UPMVERSION.def +++ b/macros/latex/contrib/upmethodology/src/UPMVERSION.def @@ -1 +1 @@ -\def\UPMVERSION{20190804} +\def\UPMVERSION{20190917} diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-document.cls b/macros/latex/contrib/upmethodology/src/upmethodology-document.cls index 4385aca329..735ffbae2a 100644 --- a/macros/latex/contrib/upmethodology/src/upmethodology-document.cls +++ b/macros/latex/contrib/upmethodology/src/upmethodology-document.cls @@ -17,7 +17,7 @@ % write to the Free Software Foundation, Inc., 59 Temple Place - Suite % 330, Boston, MA 02111-1307, USA. -\global\edef\upm@package@docclazz@ver{2014/09/11} +\global\edef\upm@package@docclazz@ver{2019/09/17} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{upmethodology-document}[\upm@package@docclazz@ver] @@ -35,6 +35,13 @@ \newif\ifupm@package@docclazz@addbackcover \upm@package@docclazz@addbackcovertrue +\newif\ifupm@package@docclazz@taskpackage +\upm@package@docclazz@taskpackagefalse +\newif\ifupm@package@docclazz@specpackage +\upm@package@docclazz@specpackagefalse +\newif\ifupm@package@docclazz@codepackage +\upm@package@docclazz@codepackagefalse + \gdef\upm@package@docclazz@optionstopass{a4paper,11pt} \DeclareOption{twoside}{% @@ -91,6 +98,15 @@ \DeclareOption{backcover}{% \global\upm@package@docclazz@addbackcovertrue% } +\DeclareOption{taskpackage}{% + \global\upm@package@docclazz@taskpackagetrue% +} +\DeclareOption{specpackage}{% + \global\upm@package@docclazz@specpackagetrue% +} +\DeclareOption{codepackage}{% + \global\upm@package@docclazz@codepackagetrue% +} \DeclareOption{book}{% \global\upmbookformattrue \global\upmreportformatfalse @@ -139,9 +155,15 @@ \RequirePackage{upmethodology-extension} \RequirePackage{upmethodology-frontpage} \RequirePackage{upmethodology-backpage} -\RequirePackage{upmethodology-task} -\RequirePackage{upmethodology-code} -\RequirePackage{upmethodology-spec} +\ifupm@package@docclazz@taskpackage + \RequirePackage{upmethodology-task} +\fi +\ifupm@package@docclazz@codepackage + \RequirePackage{upmethodology-code} +\fi +\ifupm@package@docclazz@specpackage + \RequirePackage{upmethodology-spec} +\fi \RequirePackage{url} \ifpdf diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty b/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty index 0ad41328ee..bc96076ab4 100644 --- a/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty +++ b/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty @@ -23,7 +23,7 @@ % 2007-03-19 Add localization. % -\global\edef\upm@package@spec@ver{2009/10/30} +\global\edef\upm@package@spec@ver{2019/09/17} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{upmethodology-spec}[\upm@package@spec@ver] @@ -133,7 +133,7 @@ \upm@spec@func@modifiers@scan{#1}% } \newcommand{\upm@spec@func@modifiers@scan}[1]{% - \upm@ifnotempty{#1}{% + \Ifnotempty{#1}{% \edef\upm@reserved@a{\upm@spec@head #1\@empty\@empty}% \edef\upm@reserved@b{\upm@spec@tail #1\@empty\@empty}% \ifthenelse{\equal{\upm@reserved@a}{+}}{% @@ -187,7 +187,7 @@ %----- %\upm@spec@param@modifiers{modifiers} \newcommand{\upm@spec@param@modifiers}[1]{% - \upm@ifnotempty{#1}{% + \Ifnotempty{#1}{% \ifthenelse{\equal{#1}{out}}{% %out \upm@spec@lang@modifier@out% @@ -205,7 +205,7 @@ %----- \def\upm@spec@trim#1{#1} \newcommand{\upm@spec@splitparams}[1]{% - \upm@ifnotempty{#1}{% + \Ifnotempty{#1}{% \upm@spec@firstparamtrue \@for\reserved@a:=#1\do{% \ifupm@spec@firstparam\upm@spec@firstparamfalse\else, \fi% @@ -247,7 +247,7 @@ \addtocounter{upm@detailspec@function@counter}{1}% \protected@xdef\upm@spec@reserved@a{\protect\csname upm@detailspec@return@ptr@\theupm@detailspec@function@counter\endcsname}% \gdef\upm@spec@reserved@b{} - \upm@ifnotempty{##2}{\gdef\upm@spec@reserved@b{\string:\ }} + \Ifnotempty{##2}{\gdef\upm@spec@reserved@b{\string:\ }} \gdef\upm@spec@reserved@c{}% \upm@spec@func@modifiers{##1}% @@ -271,17 +271,17 @@ \gdef\upm@spec@reserved@e{\upm@spec@lang@modifier@const}% \fi \ifupm@spec@modifier@has@final% - \upm@ifnotempty{\upm@spec@reserved@e}{% + \Ifnotempty{\upm@spec@reserved@e}{% \xdef\upm@spec@reserved@e{\upm@spec@reserved@e,}}% \protected@xdef\upm@spec@reserved@e{\upm@spec@reserved@e\protect\upm@spec@lang@modifier@final}% \fi \ifupm@spec@modifier@has@abstract% - \upm@ifnotempty{\upm@spec@reserved@e}{% + \Ifnotempty{\upm@spec@reserved@e}{% \xdef\upm@spec@reserved@e{\upm@spec@reserved@e,}}% \protected@xdef\upm@spec@reserved@e{\upm@spec@reserved@e\protect\upm@spec@lang@modifier@abstract}% \fi \ifupm@spec@modifier@has@root% - \upm@ifnotempty{\upm@spec@reserved@e}{% + \Ifnotempty{\upm@spec@reserved@e}{% \xdef\upm@spec@reserved@e{\upm@spec@reserved@e,}}% \protected@xdef\upm@spec@reserved@e{\upm@spec@reserved@e\protect\upm@spec@lang@modifier@root}% \fi @@ -343,13 +343,13 @@ \ifthenelse{\equal{\upm@spec@global@return}{\@empty}}{% \gdef\upm@detailspec@return@section{} - \upm@ifnotempty{\upm@spec@local@return}{ + \Ifnotempty{\upm@spec@local@return}{ \gdef\upm@detailspec@separator{ & & & \\} \protected@xdef\upm@detailspec@return@section{\upm@spec@local@return}% \upm@spec@showreturnstrue% }% }{% - \upm@ifnotempty{\upm@spec@local@return}{% + \Ifnotempty{\upm@spec@local@return}{% \gdef\upm@detailspec@separator{ & & & \\} \gdef\upm@spec@reserved@a{ \upm@spec@lang@except@for:\protect\upm@spec@local@return}}% \protected@xdef\upm@detailspec@return@section{% @@ -358,9 +358,8 @@ \upm@spec@showreturnstrue% } - \ifthenelse{\equal{\upm@spec@detailspec@title}{\@empty}}{ - \gdef\upm@spec@reserved@c{} - }{ + \gdef\upm@spec@reserved@c{} + \Ifnotempty{\upm@spec@detailspec@title}{ \gdef\upm@spec@reserved@c{\hline% \multicolumn{4}{>{\columncolor{backtableheader}}l}{\color{fronttableheader}{\large\textsc{\upm@spec@detailspec@title}}} \\% } @@ -370,11 +369,11 @@ \upm@spec@showparamsfalse% - \upm@ifnotempty{\upm@spec@parameters}{% + \Ifnotempty{\upm@spec@parameters}{% \ifupm@spec@showdescription% \gdef\upm@detailspec@separator{ & & & \\}% \fi% - \upm@ifnotempty{\upm@spec@functions}{% + \Ifnotempty{\upm@spec@functions}{% \gdef\upm@detailspec@separator{ & & & \\}% }% \upm@spec@showparamstrue% @@ -429,7 +428,7 @@ } %----- -%\begin{detailspec}}[width]{title}...\end{detailspec}.... +%\begin{detailspec}[width]{title}...\end{detailspec}.... \newenvironment{detailspec}[2][\linewidth] {% \upm@spec@showdescriptiontrue% @@ -442,7 +441,7 @@ } %----- -%\begin{detailspec}}[width]{title}...\end{detailspec}.... +%\begin{detailspec*}[width]{title}...\end{detailspec*}.... \newenvironment{detailspec*}[2][\linewidth] {% \upm@spec@showdescriptionfalse% |