summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/revtex/ltxgrid.dtx')
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxgrid.dtx129
1 files changed, 88 insertions, 41 deletions
diff --git a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
index e391f9f2eb9..6d0c659db79 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
@@ -15,7 +15,8 @@
% installation, typeset this document with \LaTeX.
% Maintenance Status
% This work has the LPPL maintenance status "maintained";
-% Current Maintainer of this work is Arthur Ogawa.
+% Current Maintainer of this work is Arthur Ogawa
+% changes for version 4.2d and 4.2e by Phelype Oleinik.
%
% This work consists of the main source file ltxgrid.dtx
% and the derived files
@@ -108,17 +109,16 @@ License
%</ignore>
% \fi
%
-% \GetFileInfo{ltxgrid.dtx}\CheckSum{5898}
+% \GetFileInfo{ltxgrid.dtx}
%
% \iffalse ltxdoc klootch
%<*package>
%%% @LaTeX-file{
%%% filename = "ltxgrid.dtx",
-%%% version = "4.2c",
-%%% date = "2019/01/18",
-%%% time = "14:29:48 UT-5",
-%%% checksum = "5462",
+%%% version = "4.2e",
+%%% date = "2020/10/03",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
+%%% Phelype Oleinik (mailto:phelype.oleinik at latex-project.org),
%%% commissioned by the American Physical Society.
%%% ",
%%% copyright = "Copyright (C) 1999, 2009 Arthur Ogawa,
@@ -135,7 +135,6 @@ License
%%% keywords = "latex, page grid, main vertical list",
%%% supported = "yes",
%%% abstract = "package to change page grid, MVL",
-%%% docstring = "The checksum field above generated by ltxdoc",
%%% }
%</package>
% \fi
@@ -231,7 +230,7 @@ ltxgrid%
% \begin{macrocode}
%<*doc|package|kernel>
%<version>
- [2019/01/18/14:29:48 4.2c page grid package (portions licensed from W. E. Baxter web at superscript.com)]% \fileversion
+ [2020/10/03 4.2e page grid package (portions licensed from W. E. Baxter web at superscript.com)]% \fileversion
%</doc|package|kernel>
%<kernel&!package&!doc>}%
% \end{macrocode}
@@ -321,7 +320,7 @@ ltxgrid%
last revised \filedate.%
}%
\thanks{%
- Version \fileversion\ \copyright\ 2019 American Physical Society
+ Version \fileversion\ \copyright\ 2019--2020 American Physical Society
}%
}%
\author{%
@@ -453,7 +452,8 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\changes{4.1o}{2010/02/02}{(AO, 576) Allow \classname{lscape} to act on \cs{@outputbox} at the right time}%
\changes{4.1p}{2010/02/24}{(AO, 583) Provide setup code also for footnotes in a one-column document}%
\changes{4.2a}{2018/12/12}{(MD) Updated name of README file and use standard fonts when typesetting}%
-
+\changes{4.2d}{2020/09/19}{(PHO) Adapt \cs{document} and \cs{enddocument} hooks to the 2020-10-01 \LaTeX{} release.}%
+\changes{4.2d}{2020/09/30}{(PHO) Correct \cs{@normalcr} patch for \LaTeX{} 2020-02-02 and later.}%
\end{filecontents*}
% \end{macrocode}
%
@@ -5127,12 +5127,22 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% FIXME: it should be the job of the page grid to determine the procedure to execute at
% the start of the job. Make this a hook.
% \begin{macrocode}
-\prepdef\@begindocumenthook{%
- \open@column@one\@ne
- \set@colht
- \@floatplacement
- \@dblfloatplacement
-}%
+\rvtx@ifformat@geq{2020-10-01}%
+ {%
+ \AddToHook{begindocument}{%
+ \open@column@one\@ne
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+ }%
+ }{%
+ \prepdef\@begindocumenthook{%
+ \open@column@one\@ne
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+ }%
+ }
% \end{macrocode}
% \end{macro}
%
@@ -6206,6 +6216,14 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% Next, we provide for line-wise processing by patching the procedures associated with these same three commands.
%
+% Depending on the running version of \LaTeX, these commands use \cs{vskip} (before 2020-10-01), or
+% \cs{@vspace@calcify} to add \textsf{calc}-like support in the kernel. To avoid duplicating the tests,
+% define a macro \cs{@tempa} that takes the right form of the primitive spacing command and defines \LaTeX's
+% spacing macros accordingly.
+% \begin{macrocode}
+\def\@tempa#1{%
+% \end{macrocode}
+%
% There are exactly four core \LaTeX\ procedures that use \cmd\vadjust\ to insert vertical mode material
% into the main vertical list: \cmd\vspace, \cmd\pagebreak, \cmd\nopagebreak, and \cmd\\.
% Other commands may use \cmd\vadjust, but they are inserting an interrupt (via a penalty${}<10000$),
@@ -6217,29 +6235,32 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% The first procedure is \cmd\@vspace, here shown in original form and in the patched alternative form.
% This procedure and \cmd\@vspacer\ implement the \cmd\vspace\ command.
+%
% \begin{macrocode}
-\def\@vspace@org #1{%
+\def\@vspace@org ##1{%
\ifvmode
- \vskip #1
+ #1% \vskip #1
\vskip\z@skip
\else
\@bsphack
\vadjust{\@restorepar
- \vskip #1
+ #1% \vskip #1
\vskip\z@skip
}%
\@esphack
\fi
}%
-\def\@vspace@ltx#1{%
+\def\@vspace@ltx##1{%
\@ifvmode{%
- \vskip#1\vskip\z@skip
+ #1% \vskip #1
+ \vskip\z@skip
}{%
\@bsphack
\ex@vadjust@ltx{%
\@restorepar
\nobreak
- \vskip#1\vskip\z@skip
+ #1% \vskip #1
+ \vskip\z@skip
}%
\@esphack
}%
@@ -6248,12 +6269,12 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% The second procedure is \cmd\@vspacer.
% \begin{macrocode}
-\def\@vspacer@org#1{%
+\def\@vspacer@org##1{%
\ifvmode
\dimen@\prevdepth
\hrule \@height\z@
\nobreak
- \vskip #1
+ #1%\vskip #1
\vskip\z@skip
\prevdepth\dimen@
\else
@@ -6261,17 +6282,18 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\vadjust{\@restorepar
\hrule \@height\z@
\nobreak
- \vskip #1
+ #1%\vskip #1
\vskip\z@skip}%
\@esphack
\fi
}%
-\def\@vspacer@ltx#1{%
+\def\@vspacer@ltx##1{%
\@ifvmode{%
\dimen@\prevdepth
\hrule\@height\z@
\nobreak
- \vskip#1\vskip\z@skip
+ #1%\vskip#1
+ \vskip\z@skip
\prevdepth\dimen@
}{%
\@bsphack
@@ -6279,13 +6301,22 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\@restorepar
\hrule\@height\z@
\nobreak
- \vskip#1\vskip\z@skip
+ #1%\vskip#1
+ \vskip\z@skip
}%
\@esphack
}%
}%
% \end{macrocode}
%
+% Now define the macros above conditionally depending on the \LaTeX version.
+% \begin{macrocode}
+}
+\rvtx@ifformat@geq{2020/10/01}%
+ {\@tempa{\@vspace@calcify{#1}}}%
+ {\@tempa{\vskip #1 }}%
+% \end{macrocode}
+%
% The procedure \cmd\@no@pgbk\ implements both \cmd\pagebreak\ and \cmd\nopagebreak.
% \begin{macrocode}
\def\@no@pgbk@org #1[#2]{%
@@ -6319,8 +6350,10 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% Here is the original core \LaTeX\ definition for
% the procedure involved, along with our revised version.
+% \changes{2020/09/30}{4.2d}{Conditionally use \cs{protected} or \cs{long} to track \LaTeX{} changes.}
% \begin{macrocode}
-\long\def\end@line@org{%
+\rvtx@ifformat@geq{2020/02/02}%
+{\protected}{\long}\def\end@line@org{%
\let\reserved@e\relax
\let\reserved@f\relax
\@ifstar{%
@@ -6330,7 +6363,8 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
\@xnewline
}%
-\long\def\end@line@ltx{%
+\rvtx@ifformat@geq{2020/02/02}%
+{\protected}{\long}\def\end@line@ltx{%
\let\reserved@e\relax
\let\reserved@f\relax
\@ifstar{%
@@ -6345,14 +6379,19 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% An additional procedure requiring patching has the following original core \LaTeX\
% definition; we modify it correspondingly.
% \begin{macrocode}
-\def\@newline@org[#1]{%
- \let\reserved@e\vadjust
- \@gnewline{\vskip#1}%
-}%
-\def\@newline@ltx[#1]{%
- \let\reserved@e\ex@vadjust@ltx
- \@gnewline{\vskip#1}%
-}%
+\def\@tempa#1{%
+ \def\@newline@org[##1]{%
+ \let\reserved@e\vadjust
+ \@gnewline{#1}% \vskip#1
+ }%
+ \def\@newline@ltx[##1]{%
+ \let\reserved@e\ex@vadjust@ltx
+ \@gnewline{#1}% \vskip#1
+ }%
+}
+\rvtx@ifformat@geq{2020/10/01}%
+ {\@tempa{\@vspace@calcify{#1}}}%
+ {\@tempa{\vskip #1}}%
% \end{macrocode}
% We now install our patches.
% If some package overrides these macros, we will detect and complain.
@@ -6362,8 +6401,13 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\@ifx{\@vspacer\@vspacer@org}{%
\@ifx{\@no@pgbk\@no@pgbk@org}{%
\@ifx{\@newline\@newline@org}{%
- \expandafter\@ifx\expandafter{\csname\expandafter\@gobble\string\\ \endcsname\end@line@org}{%
- \true@sw
+ \expandafter\@ifx\expandafter{%
+ \csname\rvtx@ifformat@geq{2020/02/02}%
+ {\expandafter\@gobble\string\\}%
+ {\expandafter\@gobble\string\\ }\endcsname
+ \end@line@org
+ }{%
+ \true@sw
}{\false@sw}%
}{\false@sw}%
}{\false@sw}%
@@ -6372,7 +6416,10 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
{%
\class@info{Overriding \string\@vspace, \string\@vspacer, \string\@no@pgbk, \string\@newline, and \string\\ }%
\let\@normalcr\end@line@ltx
- \expandafter\let\csname\expandafter\@gobble\string\\ \endcsname\@normalcr
+ \expandafter\let
+ \csname\rvtx@ifformat@geq{2020/02/02}%
+ {\expandafter\@gobble\string\\}%
+ {\expandafter\@gobble\string\\ }\endcsname\@normalcr
\let\@newline\@newline@ltx
\let\@vspace\@vspace@ltx
\let\@vspacer\@vspacer@ltx