[latex3-commits] [git/LaTeX3-latex3-latex2e] adapt-new-or: move output patches from pdfresource, number new-or files (ccc6ee89)

Ulrike Fischer fischer at troubleshooting-tex.de
Fri Nov 4 11:20:03 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : adapt-new-or
Link       : https://github.com/latex3/latex2e/commit/ccc6ee89e1a02c5596555c8d980909bc7413eed3

>---------------------------------------------------------------

commit ccc6ee89e1a02c5596555c8d980909bc7413eed3
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Fri Nov 4 11:20:03 2022 +0100

    move output patches from pdfresource, number new-or files


>---------------------------------------------------------------

ccc6ee89e1a02c5596555c8d980909bc7413eed3
 required/latex-lab/latex-lab-new-or-1.dtx          | 164 +++++++++++++++++++++
 ...latex-lab-new-or.dtx => latex-lab-new-or-2.dtx} |   6 +-
 required/latex-lab/latex-lab.ins                   |   5 +-
 3 files changed, 170 insertions(+), 5 deletions(-)

diff --git a/required/latex-lab/latex-lab-new-or-1.dtx b/required/latex-lab/latex-lab-new-or-1.dtx
new file mode 100644
index 00000000..c22ce79b
--- /dev/null
+++ b/required/latex-lab/latex-lab-new-or-1.dtx
@@ -0,0 +1,164 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2022 Frank Mittelbach
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%<*driver>
+\documentclass{l3doc}
+
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-new-or-1.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \providecommand\hook[1]{\texttt{#1}}
+%
+%
+%
+% \title{Temporary output patches for tagging and better link support}
+% \author{Frank Mittelbach \and Ulrike Fischer}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+%    This package contains a few patches of internal \LaTeX{} needed
+%    to support paragraph tagging across
+%    page boundaries (in \pdfTeX) and improve the behaviour of links across page breaks.
+%
+%    Until this get properly integrated with the kernel code this has
+%    to be taken as a prototype and code, interfaces as well as
+%    behavior may change without notice and certainly without any
+%    backwards compatibility!
+%
+%
+% \StopEventually{\setlength\IndexMin{200pt}  \PrintIndex  }
+%
+%
+% \section{The Implementation}
+%    \begin{macrocode}
+%<*code>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\ProvidesPackage{latex-lab-testphase-new-or-1}
+        [2022-10-29 v0.96 Temporary output patches for tagging and better link support]
+\RequirePackage{etoolbox}
+%    \end{macrocode}
+%
+%
+%  \subsection{Patching the OR}
+%  This add hooks around header and footer, in \cs{@makecol} and in multicol.
+%  At first initialize some of the hooks. We use providecommand to avoid problems if
+%  the kernel changes here and provides them directly.
+%    \begin{macrocode}
+\providecommand\@kernel at before@head{}
+\providecommand\@kernel at before@foot{}
+\providecommand\@kernel at after@head{}
+\providecommand\@kernel at after@foot{}
+\providecommand\@mult at ptagging@hook{}% multicol
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+
+\patchcmd\@outputpage
+ {\vfil\color at hbox\normalcolor\hb at xt@\textwidth{\@thehead}\color at endbox}
+ {\vfil\@kernel at before@head\color at hbox\normalcolor\hb at xt@\textwidth{\@thehead}\color at endbox\@kernel at after@head}
+ {\typeout{Patching header in \string\@outputpage}}{\PATCHerror }
+
+
+\patchcmd\@outputpage
+ {\color at hbox\normalcolor\hb at xt@\textwidth{\@thefoot}\color at endbox}
+ {\@kernel at before@foot\color at hbox\normalcolor\hb at xt@\textwidth{\@thefoot}\color at endbox\@kernel at after@foot}
+ {\typeout{Patching footer in \string\@outputpage}}{\PATCHerror }
+%    \end{macrocode}
+%
+%  \begin{macro}{\@makecol}
+%    We have to patch \cs{@makecol} in two places:
+%    \begin{itemize}
+%    \item
+%      update 255 up front to add missing tmb/tme if necessary
+%    \item
+%      update the \cs{footins} stream if that one got split
+%    \end{itemize}
+%
+%   If the new latex-lab file for the output routine is loaded it will do the right thing.
+%   In the other case we patch \cs{@makecol} manually.
+%    \begin{macrocode}
+\@ifpackageloaded{latex-lab-testphase-new-or}
+   {}
+   {
+    \providecommand\@kernel at before@footins{}
+    \providecommand\@kernel at before@cclv{}
+
+    \patchcmd\@makecol
+      {\vskip\skip\footins}
+      {\vskip\skip\footins\@kernel at before@footins}
+      {\typeout{Patching \string\@makecol\space for tagging}}{\PATCHerror }
+
+% for some reason patching with etoolbox only works in this order ...
+
+    \pretocmd\@makecol{\@kernel at before@cclv}
+     {\typeout{Patching \string\@makecol\space for tagging}}{\PATCHerror }
+   }
+%    \end{macrocode}
+%  \end{macro}
+%
+% \subsection{\pkg{multicol} adjustments}
+%
+%    The patches for pkg{multicol} are fairly minimal:
+%    \begin{itemize}
+%    \item At the start of the environment anything already on the
+%    page is picked up and stored in \cs{partial at page}, we may need to add
+%    a TMB to that (it should have a proper TME). This has to happen
+%    in the \enquote{main} stream context.
+%    \item
+%    \item
+%    \end{itemize}
+%
+%    \begin{macrocode}
+\AddToHook{package/multicol/after}
+    {% multicol needs later loading
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+  \patchcmd\page at sofar
+      {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}%
+      {%
+        \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@
+        \@mult at ptagging@hook
+      }%
+      {\typeout{Patching \string\page at sofar\space for tagging}}{\PATCHerror}%
+}
+%    \end{macrocode}
+%
+% \subsection{Interrupt hooks}
+% This requires the l3pdfannot module!
+% We add the code here and not in hyperref, as it should also work with links
+% created directly with the l3pdfannot commands. The file is only
+% loaded by the pdfmanagement, so no need to test if the commands exist.
+%    \begin{macrocode}
+\ExplSyntaxOn
+\def\@kernel at before@head{\pdfannot_link_off:}
+\def\@kernel at before@foot{\pdfannot_link_off:}
+\def\@kernel at after@head {\pdfannot_link_on:}
+\def\@kernel at after@foot {\pdfannot_link_on:}
+\ExplSyntaxOff
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</code>
+%    \end{macrocode}
+%
+% \Finale
+%
diff --git a/required/latex-lab/latex-lab-new-or.dtx b/required/latex-lab/latex-lab-new-or-2.dtx
similarity index 99%
rename from required/latex-lab/latex-lab-new-or.dtx
rename to required/latex-lab/latex-lab-new-or-2.dtx
index 08b58a72..51ec79ff 100644
--- a/required/latex-lab/latex-lab-new-or.dtx
+++ b/required/latex-lab/latex-lab-new-or-2.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-%% File: latex-lab-new-or.dtx
+%% File: latex-lab-new-or-2.dtx
 % Copyright (C) 2022 The LaTeX Project
 %
 % It may be distributed and/or modified under the conditions of the
@@ -22,14 +22,14 @@
 \EnableCrossrefs
 \CodelineIndex
 \begin{document}
-  \DocInput{latex-lab-new-or.dtx}
+  \DocInput{latex-lab-new-or-2.dtx}
 \end{document}
 %</driver>
 %
 % \fi
 %
 %
-% \title{The \texttt{latex-lab-new-or} code\thanks{}}
+% \title{The \texttt{latex-lab-new-or-2} code\thanks{}}
 % \author{Frank Mittelbach, \LaTeX{} Project}
 %
 % \maketitle
diff --git a/required/latex-lab/latex-lab.ins b/required/latex-lab/latex-lab.ins
index bc668a71..2f387ef9 100644
--- a/required/latex-lab/latex-lab.ins
+++ b/required/latex-lab/latex-lab.ins
@@ -71,10 +71,11 @@ where one can also log issues in case there are any.
 
 \generate{\file{tagpdf-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{tagpdf}}}
 \generate{\file{new-or-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{new-or}}}
-
+\generate{\file{new-or-1-latex-lab-testphase.ltx}{\from{latex-lab-testphase.dtx}{new-or-1}}}
 % support files (the new-or code is a private package to make life easier)
 
-\generate{\file{latex-lab-testphase-new-or.sty}{\from{latex-lab-new-or.dtx}{code}}}
+\generate{\file{latex-lab-testphase-new-or-2.sty}{\from{latex-lab-new-or-2.dtx}{code}}}
+\generate{\file{latex-lab-testphase-new-or-1.sty}{\from{latex-lab-new-or-1.dtx}{code}}}
 \generate{\file{latex-lab-footmisc.ltx}{\from{latex-lab-footnotes.dtx}{footmisc}}}
 \generate{\file{latex-lab-footnotes.ltx}{\from{latex-lab-footnotes.dtx}{kernel}}}
 





More information about the latex3-commits mailing list.