Debian Codegraph @

texmf-dist/source/latex/latex-lab/latex-lab-new-or-2.dtx

raw
1 % \iffalse meta-comment
2 %
3 %% File: latex-lab-new-or-2.dtx
4 % Copyright (C) 2022-2025 The LaTeX Project
5 %
6 % It may be distributed and/or modified under the conditions of the
7 % LaTeX Project Public License (LPPL), either version 1.3c of this
8 % license or (at your option) any later version. The latest version
9 % of this license is in the file
10 %
11 % https://www.latex-project.org/lppl.txt
12 %
13 %
14 % The development version of the bundle can be found below
15 %
16 % https://github.com/latex3/latex2e/required/latex-lab
17 %
18 % for those people who are interested or want to report an issue.
19 %
20 \def\ltlabneworIIdate{2025-05-10}
21 \def\ltlabneworIIversion{0.86d}
22
23 %<*driver>
24 \DocumentMetadata{tagging=on,pdfstandard=ua-2}
25 \documentclass[kernel]{l3doc}
26 \usepackage{latex-lab-testphase-l3doc}
27 \EnableCrossrefs
28 \CodelineIndex
29 \begin{document}
30 \DocInput{latex-lab-new-or-2.dtx}
31 \end{document}
32 %</driver>
33 %
34 % \fi
35 %
36 %
37 % \title{The \texttt{latex-lab-testphase-new-or-2} code}
38 % \author{Frank Mittelbach, \LaTeX{} Project}
39 % % \date{v\ltlabneworIIversion\ \ltlabneworIIdate}
40 % \maketitle
41 %
42 % \newcommand\fmi[1]{\begin{quote} TODO: \itshape #1\end{quote}}
43 % \newcommand\NEW[1]{\marginpar{\mbox{}\hfill\fbox{New: #1}}}
44 % \providecommand\pkg[1]{\texttt{#1}}
45 %
46 % \providecommand\hook[1]{\texttt{#1\DescribeHook[noprint]{#1}}}
47 % \providecommand\socket[1]{\texttt{#1\DescribeSocket[noprint]{#1}}}
48 % \providecommand\plug[1]{\texttt{#1\DescribePlug[noprint]{#1}}}
49 %
50 % \NewDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl}
51 % \NewDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
52 % \NewDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}
53 %
54 %
55 % \begin{abstract}
56 % This code implements changes to the output routine intended to be
57 % moved in the \LaTeX{} kernel at some point in the future.
58 % \end{abstract}
59 %
60 %
61 %
62 %
63 % \section{Introduction}
64 %
65 %
66 %
67 %
68 % \StopEventually{\setlength\IndexMin{200pt} \PrintIndex }
69 %
70 %
71 % \section{The Implementation}
72 %
73 % \begin{macrocode}
74 %<*package>
75 % \end{macrocode}
76 %
77 % \subsection{File declaration}
78 % \begin{macrocode}
79 \ProvidesPackage{latex-lab-testphase-new-or-2}
80 [\ltlabneworIIdate\space v\ltlabneworIIversion\space
81 Changes to the output routine]
82 % \end{macrocode}
83 %
84 % \subsection{\cs{@makecol} reimplementation}
85 %
86 % \begin{plugdecl}{footnote-floats}
87 % If \cs{DocumentMetadata} is used we use \plug{footnotes-floats}
88 % as the default. In 2e compatibility mode this should be changed to
89 % \plug{footnotes-floats-legacy}.
90 % \begin{macrocode}
91 \AssignSocketPlug {build/column/outputbox}{footnotes-floats}
92 % \end{macrocode}
93 % \end{plugdecl}
94 %
95 %
96 %
97 % \begin{macro}[no-user-doc]{\@makecol@handlesplitfootnotes}
98 % \begin{macro}[no-user-doc]{\@makecol@splitfootnotemessagehook}
99 % This is only an early draft and doesn't do much.
100 % Contains incomplete preparation for tagging commented out.
101 % \fmi{Interfaces and code will change in the future}
102 % \begin{macrocode}
103 \def\@makecol@handlesplitfootnotes {%
104 % \ifx\splitfootnote@continuation\@empty \else
105 % \setbox\footins\vbox{\splitfootnote@continuation\unvbox\footins}%
106 % \global\let\splitfootnote@continuation\@empty
107 % \fi
108 \ifnum\insertpenalties>\z@
109 \@makecol@splitfootnotemessagehook
110 % \setbox\footins\vbox{\unvbox\footins --- END at split}%
111 % \gdef\splitfootnote@continuation {--- START after split}%
112 \fi
113 }
114 %\def\splitfootnote@continuation{}
115 % \end{macrocode}
116 % This could issue warning if split footnotes are encountered.
117 % \begin{macrocode}
118 \let \@makecol@splitfootnotemessagehook \@empty
119 % \end{macrocode}
120 % \end{macro}
121 % \end{macro}
122 %
123 %
124 %
125 %
126 %
127 %
128 % \subsection{\cs{@outputpage} reimplementation}
129 %
130 % We still have to deal with various plug setting for tagging:
131 % This needs documentation and moving.
132 %
133 % \begin{plugdecl}{default}
134 % \begin{macrocode}
135 \ExplSyntaxOn
136 % \end{macrocode}
137 % \fmi{where should these plug declarations go? tagpdf?}
138 % \begin{macrocode}
139 \NewTaggingSocketPlug{build/page/header}{default}
140 {
141 \__tag_hook_kernel_before_head:
142 #2
143 \__tag_hook_kernel_after_head:
144 }
145 % \end{macrocode}
146 %
147 % \begin{macrocode}
148 \AssignTaggingSocketPlug{build/page/header}{default}
149 % \end{macrocode}
150 %
151 % \end{plugdecl}
152 %
153 % \begin{plugdecl}{default}
154 % \begin{macrocode}
155 \NewTaggingSocketPlug{build/page/footer}{default}
156 {
157 \__tag_hook_kernel_before_foot:
158 #2
159 \__tag_hook_kernel_after_foot:
160 }
161 % \end{macrocode}
162 %
163 % \begin{macrocode}
164 \AssignTaggingSocketPlug{build/page/footer}{default}
165 % \end{macrocode}
166 %
167 % \end{plugdecl}
168 %
169 % \begin{plugdecl}{default}
170 % \begin{macrocode}
171 \NewTaggingSocketPlug{build/column/outputbox}{default}
172 {
173 \__tag_check_typeout_v:n { ====>~In~\token_to_str:N \@makecol
174 \c_space_tl\the\c@page }
175 \tag_mc_add_missing_to_stream:Nn \@outputbox {main}
176 }
177 % \end{macrocode}
178 % % \end{plugdecl}
179 % \begin{plugdecl}{default}
180 % \begin{macrocode}
181 \NewTaggingSocketPlug{build/column/footins}{default}
182 { \tag_mc_add_missing_to_stream:Nn \footins {footnote} }
183 % \end{macrocode}
184 % The two sockets do nothing (default \plug{noop}) if we
185 % are in lua mode. If not they get the \plug{default} assigned
186 % \begin{macrocode}
187 \sys_if_engine_luatex:F
188 {
189 \AssignTaggingSocketPlug{build/column/outputbox}{default}
190 \AssignTaggingSocketPlug{build/column/footins}{default}
191 }
192 \ExplSyntaxOff
193 % \end{macrocode}
194 % \end{plugdecl}
195 %
196 %
197 %
198 %
199 %
200 % \section {Replacement for the \pkg{footmisc} package}
201 %
202 % The replacement for \pkg{footmisc}. If the new code is used, we must replace
203 % the package if it is loaded by the user:
204 % \begin{macrocode}
205 \declare@file@substitution{footmisc.sty}{latex-lab-footmisc.ltx}
206 % \end{macrocode}
207 % This can be removed the moment the remaining hooks and sockets
208 % have been integrated into footmisc, which will probably not
209 % happen before the 2025/11 release.
210 %
211 %
212 %
213 % \section {Temp stuff that is related but should go to the kernel}
214 %
215 % This is the code from \texttt{latex-lab-footnotes.dtx}.
216 % \begin{macrocode}
217 \input{latex-lab-footnotes.ltx}
218 % \end{macrocode}
219 %
220 %
221 % \begin{macrocode}
222 %</package>
223 % \end{macrocode}
224 %
225 % \Finale
226 %