diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/revtex/ltxutil.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/revtex/ltxutil.dtx | 320 |
1 files changed, 271 insertions, 49 deletions
diff --git a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx index bf9000c82af..485620035d2 100644 --- a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx +++ b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx @@ -79,9 +79,11 @@ License \keepsilent \generate{% %{ignore} -% \usedir{tex/latex/revtex}% \file{ltxutil.sty}{% - \from{ltxutil.dtx}{package,kernel}%{ltxutil,ltxutil-krn}% + \from{ltxutil.dtx}{package,kernel}% + }% + \file{ltxutil.krn}{% + \from{ltxutil.dtx}{kernel}% }% }% \ifToplevel{ @@ -106,15 +108,15 @@ License %</ignore> % \fi % -% \GetFileInfo{ltxutil.dtx}\CheckSum{4094} +% \GetFileInfo{ltxutil.dtx}\CheckSum{4291} % % \iffalse ltxdoc klootch %<*package> %%% @LaTeX-file{ %%% filename = "ltxutil.dtx", -%%% version = "4.1h", -%%% date = "2009/10/09", -%%% time = "11:23:00 GMT+8", +%%% version = "4.1p", +%%% date = "2010/02/25", +%%% time = "18:00:00 UT-8", %%% checksum = "4094", %%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net), %%% commissioned by the American Physical Society. @@ -197,10 +199,20 @@ License % As desired, the following modules all % take common version information: % \begin{macrocode} -%<package>\ProvidesFile{ltxutil.sty}% +%<kernel&!package&!doc>\typeout{% +%<*package|doc> +\ProvidesFile{% +%</package|doc> +%<*kernel|package|doc> +ltxutil% +%</kernel|package|doc> %<*doc> -\expandafter\ProvidesFile\expandafter{\jobname.dtx}% +.dtx% %</doc> +%<package>.sty% +%<*package|doc> +}% +%</package|doc> % \end{macrocode} % % The following line contains, for once and for all, @@ -208,10 +220,13 @@ License % By various means, this information is reproduced % consistently in all generated files and in the % typeset documentation. +% Give credit where due. % \begin{macrocode} -%<*doc|package> - [2009/10/09 4.1h utilities package]% \fileversion -%</doc|package> +%<*doc|package|kernel> +%<version> + [2010/02/25/18:00:00 4.1p utilities package (portions licensed from W. E. Baxter web at superscript.com)]% \fileversion +%</doc|package|kernel> +%<kernel&!package&!doc>}% % \end{macrocode} % % @@ -426,6 +441,14 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! \changes{4.1g}{2009/10/06}{(AO, 532) Both arguments of \cs{href} get sanitized}% \changes{4.1g}{2009/10/07}{(AO, 525) Remove phantom paragraph above display math that is given in vertical mode}% \changes{4.1g}{2009/10/07}{(AO, 539) Use of double-backslash in argument of \cs{section} gives error. The \classname{textcase} package is involved.}% +\changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}% +\changes{4.1n}{2009/12/06}{(AO) Incorporate change to ltmiscen.dtx v1.1i 2000/05/19}% +\changes{4.1n}{2009/12/09}{(AO, 569) execute \classname{atveryend}'s \cs{Call@AfterLastShipout} at the proper time}% +\changes{4.1n}{2009/12/13}{(AO, 574) protect against \classname{lineno.sty}, which forces a visit to the output routine, which appears to destroy the value of \cs{@tempdima}}% +\changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}% +\changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}% +\changes{4.1n}{2010/01/06}{(AO, 572) title block footnotes numbered independently from body footnotes}% +\changes{4.1p}{2010/02/24}{(AO, 582) A patch of \classname{hyperref.sty} to provide backward compatibility to \TeX Live 2007's version 6.75r}% \end{filecontents*} @@ -523,12 +546,8 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % \end{macrocode} % % \subsection{Banner and beginning of the \file{kernel} {\sc docstrip} module}% -% Credit where due. % \begin{macrocode} %<*kernel> -\typeout{% - ltxutil [2009/07/07 4.1f]: portions licensed from W. E. Baxter (web at superscript.com)% -}% % \end{macrocode} % % \subsection{Errors and warnings} @@ -967,6 +986,7 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % \begin{macro}{\enddocument} % \begin{macro}{\check@aux} % \begin{macro}{\do@check@aux} +% \changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}% % The standard \LaTeX\ \enve{document} processing is a potential problem, % particularly when the output routine has been changed by \classname{ltxgrid}. % We separate out the procedure that checks the auxiliary file at the end of @@ -977,14 +997,28 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % with the output routine. % \begin{macrocode} \def\enddocument{% +% \end{macrocode} +% \changes{4.1n}{2009/12/06}{(AO) Incorporate change to ltmiscen.dtx v1.1i 2000/05/19}% +% The following line from \filename{ltmiscen.dtx} `resets \cmd\AtEndDocument for latex/3060'. +% \begin{macrocode} + \let\AtEndDocument\@firstofone +% \end{macrocode} +% \begin{macrocode} \@enddocumenthook \@checkend{document}% +% \end{macrocode} +% The \cmd\clear@document\ statement ends the current page (we must guarantee no further shipouts), +% then executes all cleanup procedures that must occur only after the last shipout. +% Clients will queue up their procedures via \cmd\AfterLastShipout, if it exists, otherwise by doing \cmd\appdef\cmd\clear@document. +% \begin{macrocode} \clear@document +% \end{macrocode} +% We are very close to ending the \TeX\ run, now. +% \begin{macrocode} \check@aux \deadcycles\z@ \@@end }% -\def\clear@document{\clearpage}% \def\check@aux{\do@check@aux}% \def\do@check@aux{% \@if@sw\if@filesw\fi{% @@ -1022,6 +1056,36 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % \end{macro} % \end{macro} % +% \begin{macro}{\clear@document} +% \changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}% +% The procedure \cmd\clear@document\ is responsible for flushing out the last page of the document, +% if not already done. +% The procedure then executes those procedures that must wait for execution until +% after the last page is shipped out. +% Clients of \classname{ltxutil}, such as \classname{ltxgrid} and \classname{revtex4} +% will queue these procedures up via \cmd\AfterLastShipout, if it exists, otherwise by doing \cmd\appdef\cmd\clear@document. +% +% The command \cmd\Call@AfterLastShipout\ is provided by Heiko Oberdiek's \classname{atveryend} package. +% This package is compatible with \classname{ltxutil}. +% +% Note on compatibility with \classname{atveryend}: +% we arrange for \cmd\Call@AfterLastShipout\ to be called from the safety of the output routine, +% thereby ensuring that all of the procedures queued up by that package's +% \cmd\AfterLastShipout\ are executed at the right time. +% We also ensure that \cmd\Call@AfterLastShipout\ has a default definition, in case the package was never loaded. +% \changes{4.1n}{2009/12/09}{(AO, 569) execute \classname{atveryend}'s \cs{Call@AfterLastShipout} at the proper time}% +% \begin{macrocode} +\def\clear@document{% + \clearpage + \do@output@cclv{% + \Call@AfterLastShipout + }% +}% +\appdef\class@documenthook{% + \providecommand\Call@AfterLastShipout{}% +}% +% \end{macrocode} +% \end{macro} % % \subsection{Class Extensions}% % \changes{4.1a}{2008/08/12}{Class extension mechanism \cs{class@extension}, \cs{class@extensionfile}, and \cs{class@ext@hook}.} @@ -1512,8 +1576,12 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % is not the right parameter to use for the set width of a footnote. % In such a case, for the applicable scope, you should define % \cmd\set@footnotewidth\ to perform this job correctly. +% +% If we are setting type on multiple page grids, we must still ensure that all footnotes that +% find their way into the \cmd\footins\ insert register are set on the same width. +% This implies the need for a document to have an ``overall'' page grid, which determines the set width of all footnotes +% with the exception of minipage footnotes. % -% A procedure, \cmd\set@footnotewidth@ii, illustrates how to do this when in a two-column page grid. % In general, remember that footnotes, like all insertions (including floats), % are a step outside of the galley context, and all aspects of insertions need to be % properly handled, including the set width. @@ -1538,20 +1606,53 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! \make@footnotetext }% % \end{macrocode} +% Procedure \cmd\make@footnotetext\ sets the footnote \verb+#1+ into type, with the proper +% font, color, leading, width, and label in effect. +% It also establishes a strut and null glue at the end of the last paragraph of the footnote; +% The strut helps compensate for the lack of \cmd\interlineskip\ glue between \cmd\insert s; +% the glue establishes a feasible \cmd\vsplit\ point between footnotes. +% +% Note that in the title block (\classname{ltxfront}), the alternative definition, under the name \cmd\frontmatter@footnotetext, is used. +% The only material difference there is the reference to \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext. +% +% Dependency note: the \cmd\@makefntext\ procedure is used to further process the footnote text +% and to execute the \cmd\@makefnmark\ procedure to produce the footnote mark. +% The definition of the former is customarily found in the document class (hereunder that of \filename{article.cls}), +% the latter in \filename{latex.ltx}. They are as follows: +% \begin{verbatim} +%\newcommand\@makefntext[1]{% +% \parindent 1em\noindent +% \hb@xt@1.8em{\hss\@makefnmark}% +% #1% +%}% +%\def\@makefnmark{% +% \hbox{\@textsuperscript{\normalfont\@thefnmark}}% +%}% +% \end{verbatim} +% +% \changes{4.1n}{2010/01/06}{(AO, 572) title block footnotes numbered independently from body footnotes}% % \begin{macrocode} \long\def\make@footnotetext#1{% \set@footnotefont % \end{macrocode} -% As noted above, we do \emph{not} do \cmd\floatingpenalty\ \cmd\@MM. +% As noted above, we do \emph{not} do \cmd\floatingpenalty\ \cmd\@MM, as in standard \LaTeX. % \begin{macrocode} \set@footnotewidth \@parboxrestore \protected@edef\@currentlabel{% - \csname p@footnote\endcsname\@thefnmark +% \end{macrocode} +% Note that we employ \cmd\@mpfn\ as a level of redirection for the footnotecounter. +% \begin{macrocode} + \csname p@\@mpfn\endcsname\@thefnmark }% \color@begingroup \@makefntext{% - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox + \rule\z@\footnotesep\ignorespaces#1% +% \end{macrocode} +% \changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}% +% The following strut and glue are for spacing and splitting, as mentioned above. +% \begin{macrocode} + \@finalstrut\strutbox\vadjust{\vskip\z@skip}% }% \color@endgroup \minipagefootnote@drop @@ -1569,20 +1670,10 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! }% % \end{macrocode} % \cmd\set@footnotewidth\ is the procedure for setting the width of a footnote. +% The default page grid, a single, full-width column, sets footnotes on the width of the text. +% \changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}% % \begin{macrocode} -\def\set@footnotewidth{% - \hsize\columnwidth - \linewidth\hsize -}% -% \end{macrocode} -% \begin{macrocode} -\def\set@footnotewidth@ii{% - \hsize\textwidth - \advance\hsize\columnsep - \divide\hsize\tw@ - \advance\hsize-\columnsep - \linewidth\hsize -}% +\def\set@footnotewidth{\set@footnotewidth@one}% % \end{macrocode} % \end{macro} % \end{macro} @@ -3927,14 +4018,23 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! \@nameuse{l@f@#2}% \ignorespaces#3\unskip\nobreak\hskip\skip@ \hb@xt@\rightskip{\hfil\unhbox\@tempboxa}\hskip-\rightskip\hskip\z@skip - \par - \expandafter\aftergroup\csname tocdim@#2\endcsname\expandafter - \endgroup\the\@tempdima\relax +% \end{macrocode} +% \changes{4.1n}{2009/12/13}{(AO, 574) protect against \classname{lineno.sty}, which forces a visit to the output routine, which appears to destroy the value of \cs{@tempdima}}% +% +% By side effect, set the value of, e.g., \cmd\tocdim@section. +% +% Note that the \cmd\par\ must not be executed before the value of \cmd\@tempdima\ is expanded (outside the current group). +% Otherwise, the \classname{lineno.sty} package may interfere (it unfortunately does a global assignment of \cmd\@tempdima). +% \begin{macrocode} + \expandafter\par + \expandafter\aftergroup\csname tocdim@#2% + \expandafter\endcsname + \expandafter\endgroup + \the\@tempdima\relax }% % \end{macrocode} % \changes{4.1a}{2008/01/19}{(AO, 479) Per: Dylan Thurston<dpt at math.harvard.edu>}% -% In the call to \cmd\set@tocdim@pagenum, I am now exposing the -% use of the particular box register. +% In the call to \cmd\set@tocdim@pagenum, I am now exposing the use of the particular box register. % \begin{macrocode} \def\set@tocdim@pagenum#1#2{% \setbox#1\hbox{\ignorespaces#2}% @@ -4026,26 +4126,36 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % \begin{macro}{\href} % \begin{macro}{\url} % \begin{macro}{\URL@prefix} +% \begin{macro}{\doi} +% \begin{macro}{\doibase} % \changes{4.1b}{2008/08/12}{(AO, 487) Support for video figures and the \cs{setfloatlink} command}% -% We provide support for the \cmd\href\ and \cmd\url\ commands. +% We provide support for the \cmd\href, \cmd\url, and \cmd\doi\ commands. % Packages, like \classname{hyperref}, may override these definitions % and provide better semantics. % \changes{4.1g}{2009/10/06}{(AO, 532) Both arguments of \cs{href} get sanitized}% +% \changes{4.1j}{2009/10/24}{(AO, 545) Provide definition for \cs{doi} that does hypertext}% % \begin{macrocode} -\providecommand\href[0]{\begingroup\@sanitize\@href}% -\def\@href#1{\@@startlink{#1}\@@href}% -\def\@@href#1{\endgroup#1\@@endlink}% -\providecommand \url [0]{\begingroup\@sanitize \@url }% +\providecommand\href[0]{\begingroup\@sanitize@url\@href}% +\def\@href#1{\@@startlink{#1}\endgroup\@@href}% +\def\@@href#1{#1\@@endlink}% +\providecommand \url [0]{\begingroup\@sanitize@url \@url }% \def \@url #1{\endgroup\@href {#1}{\URL@prefix#1}}% \providecommand \URL@prefix [0]{URL }% +\providecommand\doi[0]{\begingroup\@sanitize@url\@doi}% +\def\@doi#1{\endgroup\@@startlink{\doibase#1}doi:\discretionary {}{}{}#1\@@endlink }% +\providecommand \doibase [0]{http://dx.doi.org/}% +\providecommand \@sanitize@url[0]{\chardef\cat@space\the\catcode`\ \@sanitize\catcode`\ \cat@space}% % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}{\@@startlink} % \begin{macro}{\@@endlink} % \begin{macro}{\pdfstartlink@attr} +% \begin{macro}{\hypertext@enable@ltx} % How we define \cmd\@@startlink\ and \cmd\@@endlink\ will depend on % whether we are running under \textsc{pdflatex}. % If so, and if PDF output is requested, then we use its primitives @@ -4054,21 +4164,135 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! % and using the \classname{hyperref} defaults; % \cmd\pdfstartlink@attr\ can be redefined by a client package. % Otherwise we fall back the Hyper\TeX\ standard and leave things to the DVI translator. +% \changes{4.1j}{2009/10/25}{(AO, 545) hypertext capabilities off by default; enable with \classoption{hypertext}} +% +% A class or package that wishes to employ hypertext capabilities should +% execute the \cmd\hypertext@enable@ltx\ procedure. % \begin{macrocode} +\def\@@startlink#1{}% +\def\@@endlink{}% \@ifxundefined \pdfoutput {\true@sw}{\@ifnum{\z@=\pdfoutput}{\true@sw}{\false@sw}}% {% - \def\@@startlink#1{\leavevmode\special{html:<a href="#1">}}% - \def\@@endlink{\special{html:</a>}}% + \def\@@startlink@hypertext#1{\leavevmode\special{html:<a href="#1">}}% + \def\@@endlink@hypertext{\special{html:</a>}}% }{% - \def\@@startlink#1{% + \def\@@startlink@hypertext#1{% \leavevmode \pdfstartlink\pdfstartlink@attr user{/Subtype/Link/A<</Type/Action/S/URI/URI(#1)>>}% \relax }% - \def\@@endlink{\pdfendlink}% + \def\@@endlink@hypertext{\pdfendlink}% \def\pdfstartlink@attr{attr{/Border[0 0 1 ]/H/I/C[0 1 1]}}% }% +\def\hypertext@enable@ltx{% + \let\@@startlink\@@startlink@hypertext + \let\@@endlink\@@endlink@hypertext +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\href} +% \changes{4.1p}{2010/02/24}{(AO, 582) A patch of \classname{hyperref.sty} to provide backward compatibility to \TeX Live 2007's version 6.75r}% +% The \cmd\href\ command of \classname{hyperref} was extend somewhere +% between versions 6.75r and 6.80e. We apply a repair to the earlier +% version (if present) so that it works like the later version. +% +% The issue is the presence of whitespace, either following the \cmd\href\ token +% or following the first argument's closing brace character. +% +% \begin{macrocode} +\def\href@Hy{\hyper@normalise \href@ }% +\def\href@Hy@ltx{\@ifnextchar\bgroup\Hy@href{\hyper@normalise\href@}}% +\def\Hy@href#{\hyper@normalise\href@}% +\begingroup + \endlinechar=-1 % + \catcode`\^^A=14 % + \catcode`\^^M\active + \catcode`\%\active + \catcode`\#\active + \catcode`\_\active + \catcode`\$\active + \catcode`\&\active + \gdef\hyper@normalise@ltx{^^A + \begingroup + \catcode`\^^M\active + \def^^M{ }^^A + \catcode`\%\active + \let%\@percentchar + \let\%\@percentchar + \catcode`\#\active + \def#{\hyper@hash}^^A + \def\#{\hyper@hash}^^A + \@makeother\&^^A + \edef&{\string&}^^A + \edef\&{\string&}^^A + \edef\textunderscore{\string_}^^A + \let\_\textunderscore + \catcode`\_\active + \let_\textunderscore + \let~\hyper@tilde + \let\~\hyper@tilde + \let\textasciitilde\hyper@tilde + \let\\\@backslashchar + \edef${\string$}^^A + \Hy@safe@activestrue + \hyper@n@rmalise + }^^A + \catcode`\#=6 ^^A + \gdef\Hy@ActiveCarriageReturn@ltx{^^M}^^A + \gdef\hyper@n@rmalise@ltx#1#2{^^A + \def\Hy@tempa{#2}^^A + \ifx\Hy@tempa\Hy@ActiveCarriageReturn + \Hy@ReturnAfterElseFi{^^A + \hyper@@normalise{#1}^^A + }^^A + \else + \Hy@ReturnAfterFi{^^A + \hyper@@normalise{#1}{#2}^^A + }^^A + \fi + }^^A + \gdef\hyper@@normalise@ltx#1#2{^^A + \edef\Hy@tempa{^^A + \endgroup + \noexpand#1{\Hy@RemovePercentCr#2%^^M\@nil}^^A + }^^A + \Hy@tempa + }^^A + \gdef\Hy@RemovePercentCr@ltx#1%^^M#2\@nil{^^A + #1^^A + \ifx\limits#2\limits + \else + \Hy@ReturnAfterFi{^^A + \Hy@RemovePercentCr #2\@nil + }^^A + \fi + }^^A +\endgroup +\def\switch@hyperref@href{% + \expandafter\@ifx\expandafter{\csname href \endcsname\href@Hy}{ + \class@info{Repairing hyperref 6.75r \string\href}% + \let\hyper@normalise\hyper@normalise@ltx + \let\hyper@@normalise\hyper@@normalise@ltx + \let\hyper@n@rmalise\hyper@n@rmalise@ltx + \let\Hy@ActiveCarriageReturn\Hy@ActiveCarriageReturn@ltx + \let\Hy@RemovePercentCr\Hy@RemovePercentCr@ltx + \let\href\href@Hy@ltx + }{}% +}% +\appdef\document@inithook{\switch@hyperref@href}% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\typeout} +% We make the \cmd\typeout\ procedure of \LaTeX\ be \cmd\long, +% because sometimes we are talking about \cmd\par. +% \begin{macrocode} \def\typeout@org#1{% \begingroup \set@display@protect @@ -4087,8 +4311,6 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble! }{}% % \end{macrocode} % \end{macro} -% \end{macro} -% \end{macro} % % \subsection{End of the \file{kernel} {\sc docstrip} module} % Here ends the module. |