summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltpage.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-05-20 03:01:51 +0000
committerNorbert Preining <norbert@preining.info>2022-05-20 03:01:51 +0000
commit33fe673e1a4a678f76e23a91da0f449998af9c47 (patch)
tree54a9486c6ec7621c31e33af6e6f111666585b56a /macros/latex-dev/base/ltpage.dtx
parent049d8c10a2be69e330d26efa5116b5ec451b8eab (diff)
CTAN sync 202205200301
Diffstat (limited to 'macros/latex-dev/base/ltpage.dtx')
-rw-r--r--macros/latex-dev/base/ltpage.dtx61
1 files changed, 58 insertions, 3 deletions
diff --git a/macros/latex-dev/base/ltpage.dtx b/macros/latex-dev/base/ltpage.dtx
index 9c0ed1fee6..1d514fc7c7 100644
--- a/macros/latex-dev/base/ltpage.dtx
+++ b/macros/latex-dev/base/ltpage.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltpage.dtx}
- [2020/12/05 v1.0m LaTeX Kernel (page style setup)]
+ [2022/04/03 v1.0n LaTeX Kernel (page style setup)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltpage.dtx}
@@ -180,10 +180,11 @@
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2019/10/01}%
-%<latexrelease> {\markboth}{Make commands robust}%
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease> {\markboth}{New mark support}%
% \end{macrocode}
%
+%
% \begin{macro}{\markboth}
% \begin{macro}{\markright}
% \changes{v1.0d}{1994/05/20}{Changed setting for \cs{protect}.}
@@ -202,18 +203,37 @@
% \changes{v1.0j}{2000/05/26}{Reimplementation to fix expansion
% error (pr/3203).}
% \changes{v1.0m}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
+% \changes{v1.0n}{2022/04/04}{Interface with new mark mechanism}
% \begin{macrocode}
+\ExplSyntaxOn
\DeclareRobustCommand*\markboth[2]{%
\begingroup
\let\label\relax \let\index\relax \let\glossary\relax
\unrestored@protected@xdef\@themark {{#1}{#2}}%
\@temptokena \expandafter{\@themark}%
+% \end{macrocode}
+% In addition to generating the legacy mark we output the
+% individual ones as well at the very same point.
+% The legacy mark is kept unchanged in order to work with packages
+% that expect that mark in exactly the way it is right now.
+%
+% We might want to think about how to improve this in one-side
+% documents, see comments below.
+%
+% We have not changed all of the code to L3 prog layer convention,
+% in case packages attempt to do some patching and expect the 2e
+% names being around. Eventually this should and will change.
+% \begin{macrocode}
+ \mark_insert:nn{2e-left}{#1}
+ \mark_insert:nn{2e-right}{#2}
+ \tl_if_empty:nF{#2}{ \mark_insert:nn{2e-right-nonempty}{#2} }
\mark{\the\@temptokena}%
\endgroup
\if@nobreak\ifvmode\nobreak\fi\fi}
% \end{macrocode}
%
% \changes{v1.0m}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
+% \changes{v1.0n}{2022/04/04}{Interface with new mark mechanism}
% \begin{macrocode}
\DeclareRobustCommand*\markright[1]{%
\begingroup
@@ -223,9 +243,23 @@
% \begin{macrocode}
\expandafter\@markright\@themark {#1}%
\@temptokena \expandafter{\@themark}%
+% \end{macrocode}
+% Same game with \cs{markright} more or less \ldots
+% \begin{macrocode}
+ \mark_insert:nn{2e-right}{#1}
+ \tl_if_empty:nF{#1}{ \mark_insert:nn{2e-right-nonempty}{#1} }
+% \end{macrocode}
+% The legacy \LaTeX{} mechanism always sets left and right mark,
+% i.e., if a sub-mark (i.e., right mark) is set the corresponding main
+% mark also is getting a mark with the same value it had previously.
+% However, for the individual mark classes this means we are losing
+% information so for them that is not done.
+% \begin{macrocode}
+% \mark_insert:nn{2e-left}{\exp_after:wN \use_i:nn \@themark }
\mark{\the\@temptokena}%
\endgroup
\if@nobreak\ifvmode\nobreak\fi\fi}
+\ExplSyntaxOff
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -233,6 +267,27 @@
% \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease> {\markboth}{Make commands robust}%
+%<latexrelease>
+%<latexrelease>\DeclareRobustCommand*\markboth[2]{%
+%<latexrelease> \begingroup
+%<latexrelease> \let\label\relax \let\index\relax \let\glossary\relax
+%<latexrelease> \unrestored@protected@xdef\@themark {{#1}{#2}}%
+%<latexrelease> \@temptokena \expandafter{\@themark}%
+%<latexrelease> \mark{\the\@temptokena}%
+%<latexrelease> \endgroup
+%<latexrelease> \if@nobreak\ifvmode\nobreak\fi\fi}
+%<latexrelease>\DeclareRobustCommand*\markright[1]{%
+%<latexrelease> \begingroup
+%<latexrelease> \let\label\relax \let\index\relax \let\glossary\relax
+%<latexrelease> \expandafter\@markright\@themark {#1}%
+%<latexrelease> \@temptokena \expandafter{\@themark}%
+%<latexrelease> \mark{\the\@temptokena}%
+%<latexrelease> \endgroup
+%<latexrelease> \if@nobreak\ifvmode\nobreak\fi\fi}
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\markboth}{Make commands robust}%
%<latexrelease>