Debian Codegraph @

texmf-dist/source/latex-dev/base/latexrelease.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2026
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % https://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 %
28 % \fi
29 %
30 % \iffalse
31 %
32 %<*dtx>
33 \def\latexreleaseversion{<date only known in .sty file>}
34 \ProvidesFile{latexrelease.dtx}
35 %</dtx>
36 %<driver>\ProvidesFile{latexrelease.drv}
37 %<fixltx2e>\ProvidesPackage{fixltx2e}
38 %<fixltx2e> [2016/12/29 v2.1a fixes to LaTeX (obsolete)]
39 %<latexrelease>\ProvidesPackage{latexrelease}
40 %<*latexrelease>
41 % \fi
42 % \ProvidesFile{latexrelease.dtx}
43 [2026-03-13 v1.0s LaTeX release emulation and tests
44 (including releases up to \latexreleaseversion)]
45 % \iffalse
46 %</latexrelease>
47 %<*driver>
48 \documentclass{ltxdoc}
49 \newcommand\Lopt[1]{\textsf{#1}}
50 \let\Lpack\Lopt
51 \providecommand{\file}[1]{\texttt{#1}}
52 \providecommand{\MF}{\textsf{Metafont}}
53 \providecommand{\danger}{\marginpar[\hfill\protect\Huge!!]{\protect\Huge!!\hfill}}
54 \DeclareRobustCommand\cs[2][]{\texttt{\char`\\\detokenize{#2}}}
55 \DeclareRobustCommand\pkg[1]{\textsf{#1}}
56 \begin{document}
57 \DocInput{latexrelease.dtx}
58 \end{document}
59 %</driver>
60 % \fi
61 %
62 % \changes{v1.0i}{2017/12/17}{Add \cs{latexreleaseversion} info
63 % to \cs{ProvidesPackage} output}
64 %
65 %
66 % \let\package\textsf
67 %
68 %
69 % \GetFileInfo{latexrelease.dtx}
70 %
71 % \title{The \Lpack{latexrelease} package\thanks{This file
72 % has version number \fileversion, last
73 % revised \filedate.}}
74 % \author{The \LaTeX{} Project}
75 % \date{\filedate}
76 % \MaintainedByLaTeXTeam{latex}
77 % \maketitle
78 %
79 % \section{Introduction}
80 % Prior to the 2015 release of \LaTeX{}, essentially no changes had been
81 % made to the \LaTeX\ format code for some years, with all
82 % improvements being instead added to the package \Lpack{fixltx2e}.
83 %
84 % While this worked at a technical level it meant that you had to
85 % explicitly opt-in to bug fixes and improvements, and the vast
86 % majority of documents did not benefit.
87 %
88 % As described in \LaTeX\ News 22, a new policy is being implemented
89 % in which improvements will now be added to the format by default,
90 % and this \Lpack{latexrelease} package may be used to ensure
91 % stability where needed, either by making a new format use an older
92 % definition of some commands, or conversely may be used to supply the
93 % new definitions for use with an old format.
94 %
95 % The basic use is:
96 %\begin{verbatim}
97 % \RequirePackage[2015/01/01]{latexrelease}
98 % \documentclass{article}
99 % ....
100 %\end{verbatim}
101 %
102 % After such a declaration the document will use definitions current
103 % in the January 2015 \LaTeX{}, whether the actual format being used is
104 % older, or newer than that date. In the former case a copy of
105 % |latexrelease.sty| would need to be made available for use with the
106 % older format. This may be used, for example, to share a document
107 % between co-workers using different \LaTeX\ releases, or to protect a
108 % document from being affected by system updates. As well as the
109 % definitions within the format itself, individual packages may use
110 % the commands defined here to adjust their definitions to the
111 % specified date as described below.
112 %
113 % Note that the \Lpack{latexrelease} package is intended for use
114 % at the start of a \emph{document}. Package and class code should not
115 % include this package as loading a package should not normally globally
116 % reset the effective version of \LaTeX\ that is in force, so affecting all
117 % other packages used in the document.
118 %
119 %
120 % The bulk of this package, after some initial setup and option
121 % handling consists of a series of |\IncludeInRelease| commands
122 % which have been extracted from the main source files of the \LaTeX\
123 % format. These contain the old and new versions of any commands with
124 % modified definitions.
125 %
126 % \section{Package Options}
127 % \begin{itemize}
128 % \item \emph{yyyy/mm/dd} or \emph{yyyy-nn-dd}
129 % The package accepts any possible \LaTeX\ format date as argument,
130 % although dates in the future for which the current release of this
131 % package has no information will generate a warning. Dates
132 % earlier than 2015 will work but will roll back to some point in 2015
133 % when the method was introduced.
134 % The |\requestedLaTeXdate| is set to the normalized date argument
135 % so that package rollback defaults to the specified date.
136 %
137 % \item%
138 % |current| This is the default behaviour, it does not change the
139 % effective date of the format but does ensure that the
140 % |\IncludeInRelease| command is defined.
141 % The |\requestedLaTeXdate| macro is reset to 0 so that package rollback
142 % does not use the implicit date.
143 %
144 % \item
145 % |latest| sets the effective date of the format to the release date
146 % of this file, so in an older format applies all patches currently
147 % available.
148 % The |\requestedLaTeXdate| macro is reset to 0 so that package rollback
149 % does not use the implicit date.
150 % \end{itemize}
151 %
152 % In all cases, when the package is loaded, the |\sourceLaTeXdate| is
153 % defined to be the numerical representation of |\fmtversion| before the
154 % rollback/forward actually happens, so it is possible to test from which
155 % was the original \LaTeX{} version before \Lpack{latexrelease} was loaded.
156 % This is particularly useful when some code in a package has to be
157 % redefined differently if rolling backwards in time or forwards.
158 %
159 % \section{Release Specific Code}
160 %
161 % The |\IncludeInRelease| mechanism allows the kernel developer to
162 % associate code with a specific date to choose different versions of
163 % definitions depending on the date specified as an option to the
164 % \Lpack{latexrelease} package. Is also available for use by package
165 % authors (or even in a document if necessary).
166 %
167 % \medskip
168 %
169 % \noindent\DescribeMacro{\IncludeInRelease}
170 % \marg{code-date}^^A
171 % \oarg{format-date}%^^A
172 % \marg{label}^^A
173 % \marg{message}^^A
174 % \meta{code}^^A
175 % |\EndIncludeInRelease|
176 %
177 % \begin{description}
178 %
179 % \item[\marg{code-date}] This date is associated with the \marg{code}
180 % argument and will be compared to the requested date in the option to
181 % the \Lpack{latexrelease}.
182 %
183 % \item[\oarg{format-date}] This optional argument can be used to
184 % specify a format date with the code in addition to the mandatory
185 % \marg{code-date} argument. This can be useful for package developers
186 % as described below.
187 %
188 % \item[\marg{label}] The \marg{label} argument is an identifier
189 % (string) that within a given package must be a unique label for each
190 % related set of optional definitions. Per package at most one code
191 % block from all the |\IncludeInRelease| declarations with the same
192 % label will be executed.
193 %
194 % \item[\marg{message}]
195 % The \marg{message} is an informative string that is used in
196 % messages. It has no other function.
197 %
198 % \item[\meta{code}]
199 % Any \TeX\ code after the |\IncludeInRelease| arguments
200 % up until the and the following |\EndIncludeInRelease|
201 % is to be
202 % conditionally included depending on the date of the format as
203 % described below.
204 %
205 % \end{description}
206 %
207 % The |\IncludeInRelease| declarations with a given label should be in
208 % reverse chronological order in the file. The one chosen will depend
209 % on this order, the effective format version and the date options, as
210 % described below.
211 %
212 % If your package \Lpack{mypackage} defines a |\widget| command but
213 % has one definition using the features available in the 2015 \LaTeX\
214 % release, and a different definition is required for older formats
215 % then you can use:
216 %\begin{verbatim}
217 % \IncludeInRelease{2015/01/01}{\widget}{Widget Definition}
218 % \def\widget{new version}%
219 % \EndIncludeInRelease
220 %
221 % \IncludeInRelease{0000/00/00}{\widget}{Widget Definition}
222 % \def\widget{old version}%
223 % \EndIncludeInRelease
224 %\end{verbatim}
225 %
226 % If a document using this package is used with a format with
227 % effective release date of 2015/01/01 or later the new code will be
228 % used, otherwise the old code will be used. Note the \emph{effective
229 % release date} might be the original \LaTeX\ release date as shown at
230 % the start of every \LaTeX\ job, or it may be set by the
231 % \Lpack{latexrelease} package, so for example a document author who
232 % wants to ensure the new version is used could use
233 %\begin{verbatim}
234 % \RequirePackage[2015/01/01]{latexrelease}
235 % \documentclass{article}
236 % \usepackage{mypackage}
237 %\end{verbatim}
238 %
239 % If the document is used with a \LaTeX\ format from 2014 or before,
240 % then \Lpack{latexrelease} will not have been part of the original
241 % distribution, but it may be obtained from a later \LaTeX\ release or
242 % from CTAN and distributed with the document, it will make an older
243 % \LaTeX\ release act essentially like the 2015 release.
244 %
245 % \subsection{Intermediate Package Releases}
246 %
247 % The above example works well for testing against the latex format
248 % but is not always ideal for controlling code by the release date of
249 % the \emph{package}. Suppose \LaTeX\ is not updated but in March you
250 % update the \Lpack{mypackage} package and modify the definition of
251 % |\widget|. You could code the package as:
252 %\begin{verbatim}
253 % \IncludeInRelease{2015/03/01}{\widget}{Widget Definition}
254 % \def\widget{even newer improved March version}%
255 % \EndIncludeInRelease
256 %
257 % \IncludeInRelease{2015/01/01}{\widget}{Widget Definition}
258 % \def\widget{new version}%
259 % \EndIncludeInRelease
260 %
261 % \IncludeInRelease{0000/00/00}{\widget}{Widget Definition}
262 % \def\widget{old version}%
263 % \EndIncludeInRelease
264 %\end{verbatim}
265 %
266 % This would work and allow a document author to choose a date such as
267 %\begin{verbatim}
268 % \RequirePackage[2015/03/01]{latexrelease}
269 % \documentclass{article}
270 % \usepackage{mypackage}
271 %\end{verbatim}
272 %
273 % To use the latest version, however it would have disadvantage that
274 % until the next release of \LaTeX, by default, if the document does
275 % not use \Lpack{latexrelease} to specify a date, the new improved
276 % code will not be selected as the effective date will be 2015/01/01
277 % and so the first code block will be skipped.
278 %
279 % For this reason |\IncludeInRelease| has an optional argument that
280 % specifies an alternative date to use if a date option has not been
281 % specified to \Lpack{latexrelease}.
282 %\begin{verbatim}
283 % \IncludeInRelease{2015/03/01}[2015/01/01]{\widget}{Widget Definition}
284 % \def\widget{even newer improved March version}%
285 % \EndIncludeInRelease
286 %
287 % \IncludeInRelease{2015/01/01}{\widget}{Widget Definition}
288 % \def\widget{new version}%
289 % \EndIncludeInRelease
290 %
291 % \IncludeInRelease{0000/00/00}{\widget}{Widget Definition}
292 % \def\widget{old version}%
293 % \EndIncludeInRelease
294 %\end{verbatim}
295 %
296 % Now, by default on a 2015/01/01 \LaTeX\ format, the first code block
297 % will compare the format date to the optional argument 2015/01/01
298 % and so will execute the \emph{even newer improved} version. The
299 % remaining blocks using the |\widget| label argument will all then be
300 % skipped.
301 %
302 % If on the other hand the document requests an explicit release date
303 % using \Lpack{latexrelease} then this date will be used to decide what
304 % code block to include.
305 %
306 % \subsection{Using \cs{IncludeInRelease} in Packages}
307 %
308 % If |\IncludeInRelease| is used within a package then all such
309 % conditional code needs to be within such declarations, e.g., it is
310 % not possible in the above example to have the ``current'' definition
311 % of |\widget| somewhere in the main code and only the two older
312 % definitions inside |\IncludeInRelease| declarations. If you would do
313 % this then one of those |\IncludeInRelease| declarations would be
314 % included overwriting the even newer code in the main part of the
315 % package. As a result your package may get fragmented over time with
316 % various |\IncludeInRelease| declarations sprinkled throughout your
317 % code or you have to interrupt the reading flow by putting those
318 % declarations together but not necessarily in the place where they
319 % belong.
320 %
321 % To avoid this issue you can use the following coding
322 % strategy: place the current |\widget| definition in the main code
323 % where it correctly belongs.
324 % \begin{verbatim}
325 % ...
326 % \def\widget {even newer improved March version}
327 % \def\@widget{newly added helper command no defined in older releases}
328 % ...
329 %\end{verbatim}
330 % Then, near the end of your package place
331 % the following:
332 % \begin{verbatim}
333 % \IncludeInRelease{2015/03/01}[2015/01/01]{\widget}{Widget Definition}
334 % \EndIncludeInRelease
335 %
336 % \IncludeInRelease{2015/01/01}{\widget}{Widget Definition}
337 % \def\widget{new version}%
338 % \let\@widget\@undefined % this doesn't exist in earlier releases
339 % \EndIncludeInRelease
340 %
341 % \IncludeInRelease{0000/00/00}{\widget}{Widget Definition}
342 % \def\widget{old version}%
343 % \EndIncludeInRelease
344 %\end{verbatim}
345 % This way the empty code block hides the other |\IncludeInRelease|
346 % declarations unless there is an explicit request with a date
347 % 2015/01/01 or earlier.
348 %
349 % Now if you make a further change to |\widget| in the future you
350 % simply copy the current definition into the empty block and add a new
351 % empty declaration with today's date and the current format date. This
352 % way your main code stays readable and the old versions accumulate at
353 % the end of the package.\footnote{Of course there may be some cases
354 % in which the old code has to be in a specific place within the
355 % package as other code depends on it (e.g., if you
356 % \texttt{\string\let} something to it). In that case you have to
357 % place the code variations in the right place in your package rather
358 % than accumulating them at the very end.}
359 %
360 % The only other ``extra effort'' necessary when using this approach
361 % is that it may be advisable to undo new definitions in the code
362 % block for the previous release, e.g., in the above example we
363 % undefined |\@widget| as that isn't available in the 2015/01/01
364 % release but was defined in the main code. If all your conditional
365 % code is within |\IncludeInRelease| declarations that wouldn't been
366 % necessary as the new code only gets defined if that release is
367 % chosen.
368 %
369 % \section{Declaring entire modules}
370 %
371 % Sometimes a large chunk of code is added as a module to another larger
372 % code base. As example of that in the 2020-10-01 release \LaTeX{} got
373 % a new hook management system, \pkg{lthooks}, which was added in one go
374 % and, as with all changes to the kernel, it was added to
375 % \pkg{latexrelease}. However rolling back from a future date to the
376 % 2020-10-01 release didn't work because \pkg{latexrelease} would try to
377 % define again all those commands, which would result in many
378 % ``already defined'' errors and similar issues.
379 %
380 % To solve that problem, completely new modules can be defined in
381 % \pkg{latexrelease} using the commands:
382 % \begin{quote}
383 % \cs{NewModuleRelease}%^^A
384 % \verb|{|\meta{initial release date}%^^A
385 % \verb|}{|\meta{name}\verb|}{|\meta{message}\verb|}|\\
386 % \null\quad\meta{module code}\\
387 % \cs{IncludeInRelease}%^^A
388 % \verb|{0000/00/00}{|\meta{name}\verb|}{|\meta{message}\verb|}|\\
389 % \null\quad\meta{undefine module code}\\
390 % \cs{EndModuleRelease}
391 % \end{quote}
392 % With that setup, the module \meta{name} will be declared to exist only
393 % in releases equal or later \meta{initial release date}.
394 %
395 % If \pkg{latexrelease} is rolling backwards or forwards between dates
396 % after \meta{initial release date}, then all the \meta{module code} is
397 % skipped, except when inside \meta{IncludeInRelease} guards, in which
398 % case the code is applied or skipped as discussed above.
399 %
400 % If rolling forward from a date before the module's \meta{initial
401 % release date} to a date after that, then all the \meta{module code} is
402 % executed to define the module, and \cs{IncludeInRelease} guards are
403 % executed accordingly, depending on the date declared and the target
404 % date.
405 %
406 % If \pkg{latexrelease} is rolling back to a date before \meta{release
407 % date}, then the code in the \cs{IncludeInRelease} guard dated
408 % \verb|0000/00/00| is executed instead to undefine the module. This
409 % guard \emph{is not} ended by the usual \cs{EndIncludeInRelease}, but
410 % instead by \cs{EndModuleRelease}.
411 %
412 % Finally, if rolling backwards or forwards between dates both before
413 % \meta{initial release date}, the entire code between
414 % \meta{NewModuleRelease} and \meta{EndModuleRelease} is entirely
415 % skipped.
416 %
417 % \subsection{Example}
418 %
419 % Here is an example usage of the structure described above, as it would
420 % be used in the \LaTeX{} kernel, taking \pkg{lthooks} as example:
421 % \begin{verbatim}
422 % %<*2ekernel|latexrelease>
423 % \ExplSyntaxOn
424 % %<latexrelease>\NewModuleRelease{2020/10/01}{lthooks}%
425 % %<latexrelease> {The~hook~management~system}
426 % \NewDocumentCommand \NewHook { m }
427 % { \hook_new:n {#1} }
428 % %<latexrelease>\IncludeInRelease{2021/06/01}{\AddToHook}{Long~argument}
429 % \NewDocumentCommand \AddToHook { m o +m }
430 % { \hook_gput_code:nnn {#1} {#2} {#3} }
431 % %<latexrelease>\EndIncludeInRelease
432 % %<latexrelease>
433 % %<latexrelease>\IncludeInRelease{2020/10/01}{\AddToHook}{Long~argument}
434 % %<latexrelease>\NewDocumentCommand \AddToHook { m o m }
435 % %<latexrelease> { \hook_gput_code:nnn {#1} {#2} {#3} }
436 % %<latexrelease>\EndIncludeInRelease
437 % %<latexrelease>
438 % %<latexrelease>\IncludeInRelease{0000/00/00}{lthooks}{Undefine~lthooks}
439 % %<latexrelease>\cs_undefine:N \NewHook
440 % %<latexrelease>\cs_undefine:N \AddToHook
441 % %<latexrelease>\EndModuleRelease
442 % \ExplSyntaxOff
443 % %</2ekernel|latexrelease>
444 % \end{verbatim}
445 %
446 % In the example above, \cs{NewHook} is declared only once, and
447 % unchanged in the next release (2021/06/01 in the example), so it has
448 % no \cs{IncludeInRelease} guards, and will only be defined if needed.
449 % \cs{AddToHook}, on the other hand, changed between the two releases
450 % (made up for the example; it didn't really happen)
451 % and has an \cs{IncludeInRelease} block for the current release (off
452 % \pkg{docstrip} guards, so it goes into the kernel too), and another
453 % for the previous release (in \pkg{docstrip} guards so it goes only
454 % into \pkg{latexrelease}).
455 %
456 % Note that in the example above, \cs{ExplSyntaxOn} and
457 % \cs{ExplSyntaxOff} were added \emph{outside} the module code because,
458 % as discussed above, sometimes the code outside \cs{IncludeInRelease}
459 % guards may be skipped, but not the code inside them, and in that case
460 % the catcodes would be wrong when defining the code.
461 %
462 % \section{fixltx2e}
463 %
464 % As noted above, prior to the 2015 \LaTeX\ release updates to the
465 % \LaTeX\ kernel were not made in the format source files but were
466 % made available in the \Lpack{fixltx2e} package. That package is no
467 % longer needed but we generate a small package from this source
468 % that just makes a warning message but otherwise does nothing.
469 %
470 %
471 %
472 %
473 %
474 % \MaybeStop{}
475 %
476 % \section{Implementation}
477 %
478 % We require at least a somewhat sane version of \LaTeXe{}. Earlier
479 % ones where really quite different from one another.
480 % \begin{macrocode}
481 %<*latexrelease>
482 \NeedsTeXFormat{LaTeX2e}[1996/06/01]
483 % \end{macrocode}
484 %
485 % \changes{v1.0s}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type
486 % expansion in expl3 code}
487 %
488 % \subsection{Setup}
489 %
490 % \begin{macro}{\sourceLaTeXdate}
491 % \changes{v1.0l}{2021/01/23}{\cs{sourceLaTeXdate} added}
492 % \changes{v1.0m}{2021/03/18}{Define \cs{sourceLaTeXdate} conditionally}
493 % Store the original \LaTeX{} format version as a number in the format
494 % |YYYYMMDD |. This macro has to be defined conditionally, so that it
495 % isn't changed in case \file{latexrelease.sty} is reloaded, but it
496 % can't be defined in the kernel only, otherwise
497 % \file{latexrelease.sty} wouldn't work in older \LaTeX{} due
498 % to the missing macro.
499 % \begin{macrocode}
500 \@ifundefined{sourceLaTeXdate}{%
501 \edef\sourceLaTeXdate{%
502 \expandafter\@parse@version\fmtversion//00\@nil}}{}%
503 % \end{macrocode}
504 % \end{macro}
505 %
506 % \begin{macro}{\IncludeInRelease}
507 % \begin{macro}{\EndIncludeInRelease}
508 % These are defined in \file{ltvers.dtx}.
509 % \end{macro}
510 % \end{macro}
511 %
512 % \changes{v1.0c}{2015/02/19}{Swap argument order}
513 % \changes{v1.0k}{2018/05/08}{reset \cs{requestedLaTeXdate} for current
514 % and latest options, github issue 43}
515 % \begin{macrocode}
516 \DeclareOption*{%
517 \def\@IncludeInRelease#1[#2]{\@IncludeInRele@se{#1}}%
518 \let\requestedpatchdate\CurrentOption}
519 \DeclareOption{latest}{%
520 \let\requestedpatchdate\latexreleaseversion
521 \AtEndOfPackage{\def\requestedLaTeXdate{0}}}
522 \DeclareOption{current}{%
523 \let\requestedpatchdate\fmtversion
524 \AtEndOfPackage{\def\requestedLaTeXdate{0}}}
525 % \end{macrocode}
526 %
527 % \begin{macrocode}
528 \let\requestedpatchdate\fmtversion
529 \ProcessOptions\relax
530 % \end{macrocode}
531 %
532 % Sanity check options, it allows some non-legal dates but always
533 % ensures |requestedLaTeXdate| gets set to a number. Generate an
534 % error if there are any non digit tokens remaining after removing the
535 % |//|.
536 % \changes{v1.0j}{2018/01/30}{Explain both date formats in error message}
537 % \begin{macrocode}
538 \def\reserved@a{%
539 \edef\requestedLaTeXdate{\the\count@}%
540 \reserved@b}
541 \def\reserved@b#1\\{%
542 \def\reserved@b{#1}%
543 \ifx\reserved@b\@empty\else
544 \PackageError{latexrelease}%
545 {Unexpected option \requestedpatchdate}%
546 {The option must be of the form yyyy/mm/dd or yyyy-mm-dd}%
547 \fi}
548 \afterassignment\reserved@a
549 \count@\expandafter
550 \@parse@version\expandafter0\requestedpatchdate//00\@nil\\
551 % \end{macrocode}
552 %
553 % less precautions needed for |\fmtversion|
554 % \begin{macrocode}
555 \edef\currentLaTeXdate{%
556 \expandafter\@parse@version\fmtversion//00\@nil}
557 % \end{macrocode}
558 %
559 % \begin{macrocode}
560 \ifnum\requestedLaTeXdate=\currentLaTeXdate
561 \PackageWarningNoLine{latexrelease}{%
562 Current format date selected, no patches applied}
563 \expandafter\endinput
564 \fi
565 % \end{macrocode}
566 %
567 % A newer version of latexrelease should have been distributed with
568 % the later format.
569 % \begin{macrocode}
570 \ifnum\currentLaTeXdate
571 >\expandafter\@parse@version\latexreleaseversion//00\@nil
572 \PackageWarningNoLine{latexrelease}{%
573 The current package is for an older LaTeX format:\MessageBreak
574 LaTeX \latexreleaseversion\space\MessageBreak
575 Obtain a newer version of this package!}
576 \expandafter\endinput
577 \fi
578 % \end{macrocode}
579 % can't patch into the future, could make this an error
580 % but it has some uses to control package updates
581 % so allow for now.
582 % \begin{macrocode}
583 \ifnum\requestedLaTeXdate
584 >\expandafter\@parse@version\latexreleaseversion//00\@nil
585 \PackageWarningNoLine{latexrelease}{%
586 The current package is for LaTeX \latexreleaseversion:\MessageBreak
587 It has no patches beyond that date\MessageBreak
588 There may be an updated version\MessageBreak
589 of this package available from CTAN}
590 \expandafter\endinput
591 \fi
592 % \end{macrocode}
593 %
594 % Update the format version to the requested date.
595 % \begin{macrocode}
596 \let\fmtversion\requestedpatchdate
597 \let\currentLaTeXdate\requestedLaTeXdate
598 % \end{macrocode}
599 %
600 %
601 % \subsection{Ignoring \texttt{\string_new} errors when rolling back}
602 %
603 % Enforce \cs{ExplSyntaxOn} and \cs{ExplSyntaxOff} to be \cs{relax} in
604 % \pkg{latexrelease} if they are not yet defined. They are later
605 % restored to be undefined if needed.
606 % \begin{macrocode}
607 \csname ExplSyntaxOn\endcsname
608 \csname ExplSyntaxOff\endcsname
609 % \end{macrocode}
610 %
611 % \changes{v1.0m}{2021/03/18}
612 % {Make \texttt{\string_new} definitions harmless}
613 %
614 % Define a set of changes here, but we'll only use them later to make
615 % sure they are applied after \pkg{expl3} is loaded. If loading from a
616 % rather old format, we don't have \cs{ExplSyntaxOn} yet.
617 % \begin{macrocode}
618 \begingroup
619 \endlinechar=-1
620 \catcode95=11 % _
621 \catcode58=11 % :
622 \catcode126=10 % ~
623 \catcode32=09 % <space>
624 \xdef\latexrelease@postltexpl{\unexpanded{%
625 %<@@=latexrelease>
626 % \end{macrocode}
627 %
628 % First we'll define a \cs{declarecommand} that does \cs{renewcommand}
629 % if the command being defined already exists, and \cs{newcommand}
630 % otherwise.
631 % \begin{macrocode}
632 \cs_gset_protected:Npn \@@_declare_command:w
633 { \@star@or@long \@@_declare_command:Nw }
634 \cs_gset_protected:Npn \@@_declare_command:Nw #1
635 { \cs_if_exist:NTF #1 { \renew@command } { \new@command } #1 }
636 % \end{macrocode}
637 %
638 % Then define a version of \cs{e@alloc} that checks if the control
639 % sequence being defined already exists, and if so, checks if its
640 % meaning is the same as the one that would be defined with the call to
641 % \cs{e@alloc}. If both tests pass, nothing is defined to save a
642 % register. This version also takes care of setting
643 % \cs{allocationnumber} to the value it would have after the register is
644 % allocated.
645 % \begin{macrocode}
646 \cs_gset_protected:Npn \@@_e@alloc:NnnnnN #1 #2 #3 #4 #5 #6
647 {
648 \cs_if_free:NTF #6
649 { \use:n }
650 {
651 \exp_after:wN \@@_e@alloc:N
652 \token_to_meaning:N #6 \scan_stop: {#2} #6
653 }
654 { \@@_e@alloc #1 {#2} {#3} {#4} {#5} #6 }
655 }
656 % \end{macrocode}
657 % Walk through the meaning of the control sequence token by token,
658 % looking for the register allocation number.
659 % \begin{macrocode}
660 \cs_gset_protected:Npn \@@_e@alloc:N #1
661 {
662 \if_int_compare:w 0 < 0
663 \if_int_compare:w 10 < 9#1 ~ 1 \fi:
664 \if_charcode:w " #1 1 \fi: \exp_stop_f:
665 \tex_afterassignment:D \@@_e@alloc:w
666 \@tempcnta #1
667 \use_i:nnn
668 \fi:
669 \use:n
670 {
671 \if_meaning:w \scan_stop: #1
672 \exp_after:wN \use_iv:nnnn
673 \fi:
674 \@@_e@alloc:N
675 }
676 }
677 % \end{macrocode}
678 % When found, check if it is the exact same register as it would be
679 % allocated, and if it is, set \cs{allocationnumber} accordingly and
680 % exit, otherwise undefine the register and allocate from scratch.
681 % \begin{macrocode}
682 \cs_gset_protected:Npn \@@_e@alloc:w #1 \scan_stop: #2 #3
683 {
684 #2 \@@_tmp:w = \@tempcnta
685 \token_if_eq_meaning:NNTF #3 \@@_tmp:w
686 { \int_set_eq:NN \allocationnumber \@tempcnta \use_none:n }
687 { \cs_set_eq:NN #3 \tex_undefined:D \use:n }
688 }
689 % \end{macrocode}
690 %
691 % Now create a token list to hold the list of changed commands, and
692 % define a temporary macro that will loop through the command list,
693 % store each in \cs{l_@@_restores_tl}, save a copy, and redefine each.
694 % \begin{macrocode}
695 \tl_clear_new:N \l_@@_restores_tl
696 \cs_gset:Npn \@@_redefines:w #1 #2
697 {
698 \quark_if_recursion_tail_stop:N #1
699 \tl_put_right:Nn \l_@@_restores_tl {#1}
700 \cs_set_eq:cN { @@_ \cs_to_str:N #1 } #1
701 \cs_set_eq:NN #1 #2
702 \@@_redefines:w
703 }
704 % \end{macrocode}
705 %
706 % The redefinitions below are needed because:
707 % \begin{description}
708 % \def\makelabel#1{\cs{#1}}
709 % \item[__kernel_chk_if_free_cs:N] This function is used ubiquitously
710 % in the \pkg{l3kernel} to check if a control sequence is definable,
711 % and give an error otherwise (similar to \cs{@ifdefinable}).
712 % Making it a no-op is enough for most cases (except when defining
713 % new registers);
714 % \item[e@alloc] In the case of new registers, we waste an allocation
715 % number if we do \cs[no-index]{new\meta{thing}} in a register
716 % that's already allocated, so the redefinition of \cs{e@alloc}
717 % checks if the new register is really necessary. This code does
718 % not clear the register, which might cause problems in the future,
719 % if a register is allocated but not properly cleared before using;
720 % \item[__kernel_msg_error:nne] This command is used to error on
721 % already defined scan marks. Just making the error do nothing is
722 % enough, as no action is taken in that case;
723 % \item[msg_new:nnnn] Used to define new messages. Making it
724 % \texttt{\string_set} is enough. Other msg commands like
725 % \cs{msg_new:nnn} and \cs[no-index]{__kernel_msg_new:nnn(n)} are
726 % defined in terms of \cs{msg_new:nnnn}, so there is no need to
727 % change the other ones;
728 % \item[NewDocumentCommand] Used to define user-level commands in the
729 % kernel. Making it equal to \cs{DeclareDocumentCommand} solves the
730 % problem;
731 % \item[newcommand] Same as above.
732 % \end{description}
733 % And here we go:
734 % \changes{v1.0r}{2026/03/10}
735 % {Use \cs{msg_set:nnnn} instead of \cs{msg_gset:nnnn} in rollback}
736 % \changes{v1.0s}{2026-03-13}{Remove \cs{__kernel_msg_error:nnn} from
737 % definitions, as it's not used in the kernel anymore}
738 % \begin{macrocode}
739 \@@_redefines:w
740 \__kernel_chk_if_free_cs:N \use_none:n
741 \e@alloc \@@_e@alloc:NnnnnN
742 \__kernel_msg_error:nne \use_none:nnn
743 \msg_new:nnnn \msg_set:nnnn
744 % \NewDocumentCommand \DeclareDocumentCommand % after ltcmd.dtx
745 \newcommand \@@_declare_command:w
746 \q_recursion_tail \q_recursion_tail
747 \q_recursion_stop
748 % \end{macrocode}
749 %
750 % Finally, redirect the error thrown by \cs{NewHook} to nowhere so it
751 % can be safely reused (the hook isn't redeclared if it already exists).
752 % The same happens for \cs{NewMarkClass}.
753 % \changes{v1.0p}{2022/11/14}
754 % {Silence \cs{NewMarkClass} in rollback (gh/955)}
755 % \begin{macrocode}
756 \msg_redirect_name:nnn { hooks } { exists } { none }
757 \msg_redirect_name:nnn { mark } { class-already-defined }{ none }
758 % \end{macrocode}
759 %
760 % The same is also needed for \cs{NewSocket} and \cs{NewSocketPlug}.
761 % \changes{v1.0q}{2025/01/31}
762 % {Silence \cs{NewSocket} and \cs{NewSocketPlug} in rollback}
763 % \begin{macrocode}
764 \msg_redirect_name:nnn { socket } { already-declared } { none }
765 \msg_redirect_name:nnn { socket } { plug-already-declared } { none }
766 % \end{macrocode}
767 %
768 % Now a one-off for |ltcmd.dtx|: we need to make \cs{NewDocumentCommand}
769 % not complain on an already existing command, but it has to be done
770 % after \cs{NewDocumentCommand} is defined, so this is separate from
771 % the \cs{latexrelease@postltexpl} actions above:
772 % \changes{v1.0o}{2022/02/28}
773 % {Move most redefinitions to right after ltexpl.dtx}
774 % \begin{macrocode}
775 \cs_gset_protected:Npn \latexrelease@postltcmd
776 {
777 \@@_redefines:w
778 \NewDocumentCommand \DeclareDocumentCommand
779 \q_recursion_tail \q_recursion_tail
780 \q_recursion_stop
781 }
782 % \end{macrocode}
783 %
784 % \begin{macrocode}
785 }}%
786 \endgroup
787 %</latexrelease>
788 % \end{macrocode}
789 %
790 % \subsection{Undoing the temp modifications}
791 %
792 % If \cs{ExplSyntaxOn} exists (defined and not equal \cs{relax}), then
793 % use the \pkg{expl3} restore code, otherwise restore \cs{ExplSyntaxOn}
794 % and \cs{ExplSyntaxOff} to be undefined.
795 % \begin{macrocode}
796 %<*latexrelease-finish>
797 \@ifundefined{ExplSyntaxOn}%
798 {\let\ExplSyntaxOn\@undefined
799 \let\ExplSyntaxOff\@undefined
800 \@gobble}%
801 {\ExplSyntaxOn
802 \@firstofone}%
803 {%
804 % \end{macrocode}
805 %
806 % Now just loop through the list of redefined commands and restore their
807 % previous meanings.
808 % \begin{macrocode}
809 \tl_map_inline:Nn \l_@@_restores_tl
810 {
811 \cs_set_eq:Nc #1 { @@_ \cs_to_str:N #1 }
812 \cs_undefine:c { @@_ \cs_to_str:N #1 }
813 }
814 \tl_clear:N \l_@@_restores_tl
815 % \end{macrocode}
816 %
817 % And restore the silenced error messages.
818 % \changes{v1.0p}{2022/11/14}
819 % {Unsilence \cs{NewMarkClass} error message after rollback (gh/955)}
820 % \changes{v1.0q}{2025/01/31}
821 % {Unsilence \cs{NewSocket} and \cs{NewSocketPlug} error message
822 % after rollback}
823 % \begin{macrocode}
824 \msg_redirect_name:nnn { hooks } { exists } { }
825 \msg_redirect_name:nnn { mark } { class-already-defined } { }
826 \msg_redirect_name:nnn { socket } { already-declared } { }
827 \msg_redirect_name:nnn { socket } { plug-already-declared } { }
828 % \end{macrocode}
829 %
830 % \begin{macrocode}
831 %<@@=>
832 \ExplSyntaxOff}%
833 %</latexrelease-finish>
834 % \end{macrocode}
835 %
836 % \subsection{Individual Changes}
837 %
838 % The code for each change will be inserted at this point, extracted
839 % from the kernel source files.
840 %
841 %
842 % \subsection{fixltx2e}
843 %
844 % Generate a stub \Lpack{fixltx2e} package:
845 % \begin{macrocode}
846 %<*fixltx2e>
847 \IncludeInRelease{2015/01/01}{\fixltxe}{Old fixltx2e package}
848 \NeedsTeXFormat{LaTeX2e}
849 \PackageWarningNoLine{fixltx2e}{%
850 fixltx2e is not required with releases after 2015\MessageBreak
851 All fixes are now in the LaTeX kernel.\MessageBreak
852 See the latexrelease package for details}
853 \EndIncludeInRelease
854 \IncludeInRelease{0000/00/00}{\fixltxe}{Old fixltx2e package}
855 \def\@outputdblcol{%
856 \if@firstcolumn
857 \global\@firstcolumnfalse
858 \global\setbox\@leftcolumn\copy\@outputbox
859 \splitmaxdepth\maxdimen
860 \vbadness\maxdimen
861 \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%
862 \setbox\@outputbox\vsplit\@outputbox to\maxdimen
863 \toks@\expandafter{\topmark}%
864 \xdef\@firstcoltopmark{\the\toks@}%
865 \toks@\expandafter{\splitfirstmark}%
866 \xdef\@firstcolfirstmark{\the\toks@}%
867 \ifx\@firstcolfirstmark\@empty
868 \global\let\@setmarks\relax
869 \else
870 \gdef\@setmarks{%
871 \let\firstmark\@firstcolfirstmark
872 \let\topmark\@firstcoltopmark}%
873 \fi
874 \else
875 \global\@firstcolumntrue
876 \setbox\@outputbox\vbox{%
877 \hb@xt@\textwidth{%
878 \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
879 \hfil
880 {\normalcolor\vrule \@width\columnseprule}%
881 \hfil
882 \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
883 \@combinedblfloats
884 \@setmarks
885 \@outputpage
886 \begingroup
887 \@dblfloatplacement
888 \@startdblcolumn
889 \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}%
890 \endgroup
891 \fi}
892 \def\end@dblfloat{%
893 \if@twocolumn
894 \@endfloatbox
895 \ifnum\@floatpenalty <\z@
896 \@largefloatcheck
897 \global\dp\@currbox1sp %
898 \@cons\@currlist\@currbox
899 \ifnum\@floatpenalty <-\@Mii
900 \penalty -\@Miv
901 \@tempdima\prevdepth
902 \vbox{}%
903 \prevdepth\@tempdima
904 \penalty\@floatpenalty
905 \else
906 \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack
907 \fi
908 \fi
909 \else
910 \end@float
911 \fi
912 }
913 \def\@testwrongwidth #1{%
914 \ifdim\dp#1=\f@depth
915 \else
916 \global\@testtrue
917 \fi}
918 \let\f@depth\z@
919 \def\@dblfloatplacement{\global\@dbltopnum\c@dbltopnumber
920 \global\@dbltoproom \dbltopfraction\@colht
921 \@textmin \@colht
922 \advance \@textmin -\@dbltoproom
923 \@fpmin \dblfloatpagefraction\textheight
924 \@fptop \@dblfptop
925 \@fpsep \@dblfpsep
926 \@fpbot \@dblfpbot
927 \def\f@depth{1sp}}
928 \def \@doclearpage {%
929 \ifvoid\footins
930 \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
931 \setbox\@tempboxa\box\@cclv
932 \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
933 \global \let \@toplist \@empty
934 \global \let \@botlist \@empty
935 \global \@colroom \@colht
936 \ifx \@currlist\@empty
937 \else
938 \@latexerr{Float(s) lost}\@ehb
939 \global \let \@currlist \@empty
940 \fi
941 \@makefcolumn\@deferlist
942 \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
943 \if@twocolumn
944 \if@firstcolumn
945 \xdef\@deferlist{\@dbltoplist\@deferlist}%
946 \global \let \@dbltoplist \@empty
947 \global \@colht \textheight
948 \begingroup
949 \@dblfloatplacement
950 \@makefcolumn\@deferlist
951 \@whilesw\if@fcolmade \fi{\@outputpage
952 \@makefcolumn\@deferlist}%
953 \endgroup
954 \else
955 \vbox{}\clearpage
956 \fi
957 \fi
958 \ifx\@deferlist\@empty \else\clearpage \fi
959 \else
960 \setbox\@cclv\vbox{\box\@cclv\vfil}%
961 \@makecol\@opcol
962 \clearpage
963 \fi
964 }
965 \def \@startdblcolumn {%
966 \@tryfcolumn \@deferlist
967 \if@fcolmade
968 \else
969 \begingroup
970 \let \reserved@b \@deferlist
971 \global \let \@deferlist \@empty
972 \let \@elt \@sdblcolelt
973 \reserved@b
974 \endgroup
975 \fi
976 }
977 \def\@addtonextcol{%
978 \begingroup
979 \@insertfalse
980 \@setfloattypecounts
981 \ifnum \@fpstype=8
982 \else
983 \ifnum \@fpstype=24
984 \else
985 \@flsettextmin
986 \@reqcolroom \ht\@currbox
987 \advance \@reqcolroom \@textmin
988 \ifdim \@colroom>\@reqcolroom
989 \@flsetnum \@colnum
990 \ifnum\@colnum>\z@
991 \@bitor\@currtype\@deferlist
992 \@testwrongwidth\@currbox
993 \if@test
994 \else
995 \@addtotoporbot
996 \fi
997 \fi
998 \fi
999 \fi
1000 \fi
1001 \if@insert
1002 \else
1003 \@cons\@deferlist\@currbox
1004 \fi
1005 \endgroup
1006 }
1007 \def\@addtodblcol{%
1008 \begingroup
1009 \@insertfalse
1010 \@setfloattypecounts
1011 \@getfpsbit \tw@
1012 \ifodd\@tempcnta
1013 \@flsetnum \@dbltopnum
1014 \ifnum \@dbltopnum>\z@
1015 \@tempswafalse
1016 \ifdim \@dbltoproom>\ht\@currbox
1017 \@tempswatrue
1018 \else
1019 \ifnum \@fpstype<\sixt@@n
1020 \advance \@dbltoproom \@textmin
1021 \ifdim \@dbltoproom>\ht\@currbox
1022 \@tempswatrue
1023 \fi
1024 \advance \@dbltoproom -\@textmin
1025 \fi
1026 \fi
1027 \if@tempswa
1028 \@bitor \@currtype \@deferlist
1029 \@testwrongwidth\@currbox
1030 \if@test
1031 \else
1032 \@tempdima -\ht\@currbox
1033 \advance\@tempdima
1034 -\ifx \@dbltoplist\@empty \dbltextfloatsep \else
1035 \dblfloatsep \fi
1036 \global \advance \@dbltoproom \@tempdima
1037 \global \advance \@colht \@tempdima
1038 \global \advance \@dbltopnum \m@ne
1039 \@cons \@dbltoplist \@currbox
1040 \@inserttrue
1041 \fi
1042 \fi
1043 \fi
1044 \fi
1045 \if@insert
1046 \else
1047 \@cons\@deferlist\@currbox
1048 \fi
1049 \endgroup
1050 }
1051 \def \@addtocurcol {%
1052 \@insertfalse
1053 \@setfloattypecounts
1054 \ifnum \@fpstype=8
1055 \else
1056 \ifnum \@fpstype=24
1057 \else
1058 \@flsettextmin
1059 \advance \@textmin \@textfloatsheight
1060 \@reqcolroom \@pageht
1061 \ifdim \@textmin>\@reqcolroom
1062 \@reqcolroom \@textmin
1063 \fi
1064 \advance \@reqcolroom \ht\@currbox
1065 \ifdim \@colroom>\@reqcolroom
1066 \@flsetnum \@colnum
1067 \ifnum \@colnum>\z@
1068 \@bitor\@currtype\@deferlist
1069 \@testwrongwidth\@currbox
1070 \if@test
1071 \else
1072 \@bitor\@currtype\@botlist
1073 \if@test
1074 \@addtobot
1075 \else
1076 \ifodd \count\@currbox
1077 \advance \@reqcolroom \intextsep
1078 \ifdim \@colroom>\@reqcolroom
1079 \global \advance \@colnum \m@ne
1080 \global \advance \@textfloatsheight \ht\@currbox
1081 \global \advance \@textfloatsheight 2\intextsep
1082 \@cons \@midlist \@currbox
1083 \if@nobreak
1084 \nobreak
1085 \@nobreakfalse
1086 \everypar{}%
1087 \else
1088 \addpenalty \interlinepenalty
1089 \fi
1090 \vskip \intextsep
1091 \box\@currbox
1092 \penalty\interlinepenalty
1093 \vskip\intextsep
1094 \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
1095 \outputpenalty \z@
1096 \@inserttrue
1097 \fi
1098 \fi
1099 \if@insert
1100 \else
1101 \@addtotoporbot
1102 \fi
1103 \fi
1104 \fi
1105 \fi
1106 \fi
1107 \fi
1108 \fi
1109 \if@insert
1110 \else
1111 \@resethfps
1112 \@cons\@deferlist\@currbox
1113 \fi
1114 }
1115 \def\@xtryfc #1{%
1116 \@next\reserved@a\@trylist{}{}%
1117 \@currtype \count #1%
1118 \divide\@currtype\@xxxii
1119 \multiply\@currtype\@xxxii
1120 \@bitor \@currtype \@failedlist
1121 \@testfp #1%
1122 \@testwrongwidth #1%
1123 \ifdim \ht #1>\@colht
1124 \@testtrue
1125 \fi
1126 \if@test
1127 \@cons\@failedlist #1%
1128 \else
1129 \@ytryfc #1%
1130 \fi}
1131 \def\@ztryfc #1{%
1132 \@tempcnta\count #1%
1133 \divide\@tempcnta\@xxxii
1134 \multiply\@tempcnta\@xxxii
1135 \@bitor \@tempcnta {\@failedlist \@flfail}%
1136 \@testfp #1%
1137 \@testwrongwidth #1%
1138 \@tempdimb\@tempdima
1139 \advance\@tempdimb\ht #1%
1140 \advance\@tempdimb\@fpsep
1141 \ifdim \@tempdimb >\@colht
1142 \@testtrue
1143 \fi
1144 \if@test
1145 \@cons\@flfail #1%
1146 \else
1147 \@cons\@flsucceed #1%
1148 \@tempdima\@tempdimb
1149 \fi}
1150 \def\@{\spacefactor\@m{}}
1151 \def\@tempa#1#2{#1#2\relax}
1152 \ifx\setlength\@tempa
1153 \def\setlength#1#2{#1 #2\relax}
1154 \fi
1155 \def\addpenalty#1{%
1156 \ifvmode
1157 \if@minipage
1158 \else
1159 \if@nobreak
1160 \else
1161 \ifdim\lastskip=\z@
1162 \penalty#1\relax
1163 \else
1164 \@tempskipb\lastskip
1165 \begingroup
1166 \advance \@tempskipb
1167 \ifdim\prevdepth>\maxdepth\maxdepth\else
1168 \ifdim \prevdepth = -\@m\p@ \z@ \else \prevdepth \fi
1169 \fi
1170 \vskip -\@tempskipb
1171 \penalty#1%
1172 \vskip\@tempskipb
1173 \endgroup
1174 \vskip -\@tempskipb
1175 \vskip \@tempskipb
1176 \fi
1177 \fi
1178 \fi
1179 \else
1180 \@noitemerr
1181 \fi}
1182 \def\@fnsymbol#1{%
1183 \ifcase#1\or \TextOrMath\textasteriskcentered *\or
1184 \TextOrMath \textdagger \dagger\or
1185 \TextOrMath \textdaggerdbl \ddagger \or
1186 \TextOrMath \textsection \mathsection\or
1187 \TextOrMath \textparagraph \mathparagraph\or
1188 \TextOrMath \textbardbl \|\or
1189 \TextOrMath {\textasteriskcentered\textasteriskcentered}{**}\or
1190 \TextOrMath {\textdagger\textdagger}{\dagger\dagger}\or
1191 \TextOrMath {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}\else
1192 \@ctrerr \fi
1193 }
1194 \begingroup\expandafter\expandafter\expandafter\endgroup
1195 \expandafter\ifx\csname eTeXversion\endcsname\relax
1196 \DeclareRobustCommand\TextOrMath{%
1197 \ifmmode \expandafter\@secondoftwo
1198 \else \expandafter\@firstoftwo \fi}
1199 \protected@edef\TextOrMath#1#2{\TextOrMath{#1}{#2}}
1200 \else
1201 \protected\expandafter\def\csname TextOrMath\space\endcsname{%
1202 \ifmmode \expandafter\@secondoftwo
1203 \else \expandafter\@firstoftwo \fi}
1204 \edef\TextOrMath#1#2{%
1205 \expandafter\noexpand\csname TextOrMath\space\endcsname
1206 {#1}{#2}}
1207 \fi
1208 \def\@esphack{%
1209 \relax
1210 \ifhmode
1211 \spacefactor\@savsf
1212 \ifdim\@savsk>\z@
1213 \nobreak \hskip\z@skip % <------
1214 \ignorespaces
1215 \fi
1216 \fi}
1217 \def\@Esphack{%
1218 \relax
1219 \ifhmode
1220 \spacefactor\@savsf
1221 \ifdim\@savsk>\z@
1222 \nobreak \hskip\z@skip % <------
1223 \@ignoretrue
1224 \ignorespaces
1225 \fi
1226 \fi}
1227 \DeclareRobustCommand\em
1228 {\@nomath\em \ifdim \fontdimen\@ne\font >\z@
1229 \eminnershape \else \itshape \fi}
1230 \def\eminnershape{\upshape}
1231 \DeclareRobustCommand*\textsubscript[1]{%
1232 \@textsubscript{\selectfont#1}}
1233 \def\@textsubscript#1{%
1234 {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
1235 \def\@DeclareMathSizes #1#2#3#4#5{%
1236 \@defaultunits\dimen@ #2pt\relax\@nnil
1237 \if $#3$%
1238 \expandafter\let\csname S@\strip@pt\dimen@\endcsname\math@fontsfalse
1239 \else
1240 \@defaultunits\dimen@ii #3pt\relax\@nnil
1241 \@defaultunits\@tempdima #4pt\relax\@nnil
1242 \@defaultunits\@tempdimb #5pt\relax\@nnil
1243 \toks@{#1}%
1244 \expandafter\xdef\csname S@\strip@pt\dimen@\endcsname{%
1245 \gdef\noexpand\tf@size{\strip@pt\dimen@ii}%
1246 \gdef\noexpand\sf@size{\strip@pt\@tempdima}%
1247 \gdef\noexpand\ssf@size{\strip@pt\@tempdimb}%
1248 \the\toks@
1249 }%
1250 \fi
1251 }
1252 \providecommand*\MakeRobust[1]{%
1253 \@ifundefined{\expandafter\@gobble\string#1}{%
1254 \@latex@error{The control sequence `\string#1' is undefined!%
1255 \MessageBreak There is nothing here to make robust}%
1256 \@eha
1257 }%
1258 {%
1259 \@ifundefined{\expandafter\@gobble\string#1\space}%
1260 {%
1261 \expandafter\let\csname
1262 \expandafter\@gobble\string#1\space\endcsname=#1%
1263 \edef\reserved@a{\string#1}%
1264 \def\reserved@b{#1}%
1265 \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}%
1266 \edef#1{%
1267 \ifx\reserved@a\reserved@b
1268 \noexpand\x@protect\noexpand#1%
1269 \fi
1270 \noexpand\protect\expandafter\noexpand
1271 \csname\expandafter\@gobble\string#1\space\endcsname}%
1272 }%
1273 {\@latex@info{The control sequence `\string#1' is already robust}}%
1274 }%
1275 }
1276 \MakeRobust\(
1277 \MakeRobust\)
1278 \MakeRobust\[
1279 \MakeRobust\]
1280 \MakeRobust\makebox
1281 \MakeRobust\savebox
1282 \MakeRobust\framebox
1283 \MakeRobust\parbox
1284 \MakeRobust\rule
1285 \MakeRobust\raisebox
1286 \def\@xfloat #1[#2]{%
1287 \@nodocument
1288 \def \@captype {#1}%
1289 \def \@fps {#2}%
1290 \@onelevel@sanitize \@fps
1291 \def \reserved@b {!}%
1292 \ifx \reserved@b \@fps
1293 \@fpsadddefault
1294 \else
1295 \ifx \@fps \@empty
1296 \@fpsadddefault
1297 \fi
1298 \fi
1299 \ifhmode
1300 \@bsphack
1301 \@floatpenalty -\@Mii
1302 \else
1303 \@floatpenalty-\@Miii
1304 \fi
1305 \ifinner
1306 \@parmoderr\@floatpenalty\z@
1307 \else
1308 \@next\@currbox\@freelist
1309 {%
1310 \@tempcnta \sixt@@n
1311 \expandafter \@tfor \expandafter \reserved@a
1312 \expandafter :\expandafter =\@fps
1313 \do
1314 {%
1315 \if \reserved@a h%
1316 \ifodd \@tempcnta
1317 \else
1318 \advance \@tempcnta \@ne
1319 \fi
1320 \else\if \reserved@a t%
1321 \@setfpsbit \tw@
1322 \else\if \reserved@a b%
1323 \@setfpsbit 4%
1324 \else\if \reserved@a p%
1325 \@setfpsbit 8%
1326 \else\if \reserved@a !%
1327 \ifnum \@tempcnta>15
1328 \advance\@tempcnta -\sixt@@n\relax
1329 \fi
1330 \else
1331 \@latex@error{Unknown float option `\reserved@a'}%
1332 {Option `\reserved@a' ignored and `p' used.}%
1333 \@setfpsbit 8%
1334 \fi\fi\fi\fi\fi
1335 }%
1336 \@tempcntb \csname ftype@\@captype \endcsname
1337 \multiply \@tempcntb \@xxxii
1338 \advance \@tempcnta \@tempcntb
1339 \global \count\@currbox \@tempcnta
1340 }%
1341 \@fltovf
1342 \fi
1343 \global \setbox\@currbox
1344 \color@vbox
1345 \normalcolor
1346 \vbox \bgroup
1347 \hsize\columnwidth
1348 \@parboxrestore
1349 \@floatboxreset
1350 }
1351 \def\@stpelt#1{\global\csname c@#1\endcsname \m@ne\stepcounter{#1}}
1352 \EndIncludeInRelease
1353 %</fixltx2e>
1354 % \end{macrocode}
1355 %
1356 % \Finale
1357 %
1358 \endinput