Debian Codegraph @

texmf-dist/source/latex/base/ltexpl.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2019-2025
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 %%% From File: ltexpl.dtx
32 %
33 %<*driver>
34 % \fi
35 \ProvidesFile{ltexpl.dtx}
36 [2025/06/05 v1.3l LaTeX Kernel (expl3-dependent code)]
37 % \iffalse
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltexpl.dtx}
40 \title{\filename}
41 \date{\filedate}
42 \author{%
43 Joseph Wright}
44
45 \providecommand\pkg[1]{\texttt{#1}}
46
47 \begin{document}
48 \MaintainedByLaTeXTeam{latex}
49 \maketitle
50 \DocInput{ltexpl.dtx}
51 \end{document}
52 %</driver>
53 % \fi
54 %
55 %
56 % \changes{v1.2d}{2020/08/21}{Dropped unused command}
57 %
58 % \section{\pkg{expl3}-dependent code}
59 %
60 % \MaybeStop{}
61 %
62 % \changes{v0.0}{2019-10-02}{Initial version}
63 %
64 % \subsection{Loader}
65 %
66 % \changes{v1.0a}{2020/03/02}
67 % {Don't load expl3 if already in the format (gh/295)}
68 % \changes{v1.1}{2020/03/05}
69 % {Load xparse.ltx if \cs{NewDocumentCommand} is not defined
70 % by expl3.ltx}
71 % \changes{v1.2c}{2020/06/04}
72 % {Define a local version of some \LaTeXe{} basic macros to support
73 % package loading}
74 %
75 % \begin{macro}{\@kernel@after@enddocument,
76 % \@kernel@before@enddocument@afterlastpage,
77 % \@kernel@after@enddocument@afterlastpage}
78 % These three kernel hooks are used by the shipout code. They are
79 % defined early (i.e., here) because the \pkg{lthooks} code adds material
80 % to them.
81 % \changes{v1.2h}{2020/12/18}
82 % {Define kernel \cs{enddocument} hooks early}
83 % \begin{macrocode}
84 %<*2ekernel|latexrelease>
85 %<latexrelease>\IncludeInRelease{2020/10/01}%
86 %<latexrelease> {kernel@enddocument hooks}{Define several kernel hooks}
87 % \end{macrocode}
88 % We initialize these kernel hooks only when they do not already
89 % exist. Otherwise they would be set to \cs{@empty} on rollback,
90 % which would be wrong because code that has been added to them
91 % may still have to be executed in the rollback situation. Instead
92 % code that writes to them needs to handle the rollback as needed.
93 % It is likely that we have to change that approach in the future,
94 % but for now it should do.
95 % (It is enough to test only for the existence of one hook, as all
96 % got added at the same time.)
97 % \changes{v1.3c}{2021/04/20}{Don't empty kernel hooks on rollback}
98 % \begin{macrocode}
99 \ifx\@kernel@after@enddocument\@undefined
100 \let \@kernel@after@enddocument \@empty
101 \let \@kernel@after@enddocument@afterlastpage \@empty
102 % \end{macrocode}
103 %
104 % \begin{macro}{\@kernel@before@begindocument,\@kernel@after@begindocument}
105 % For the similar reasons we also define those that are used in
106 % \cs{document} because they too get material added to in early modules.
107 % \begin{macrocode}
108 \let \@kernel@before@begindocument \@empty
109 \let \@kernel@after@begindocument \@empty
110 \fi
111 % \end{macrocode}
112 % This one actually came later so we need to have a separate check,
113 % but otherwise we don't bother with a separate rollback.
114 % \changes{v1.3j}{2025/03/05}{Add \cs{@kernel@before@enddocument@afterlastpage}}
115 % \begin{macrocode}
116 \ifx\@kernel@before@enddocument@afterlastpage\@undefined
117 \let \@kernel@before@enddocument@afterlastpage \@empty
118 \fi
119 %<latexrelease>\EndIncludeInRelease
120 % \end{macrocode}
121 %
122 % \begin{macrocode}
123 %<latexrelease>\IncludeInRelease{0000/00/00}%
124 %<latexrelease> {kernel@enddocument hooks}{Define several kernel hooks}
125 %<latexrelease>\let\@kernel@after@enddocument\@undefined
126 %<latexrelease>\let\@kernel@before@enddocument@afterlastpage\@undefined
127 %<latexrelease>\let\@kernel@after@enddocument@afterlastpage\@undefined
128 %<latexrelease>\let\@kernel@before@begindocument\@undefined
129 %<latexrelease>\let\@kernel@after@begindocument\@undefined
130 %</2ekernel|latexrelease>
131 %<latexrelease>\EndIncludeInRelease
132 % \end{macrocode}
133 % \end{macro}
134 % \end{macro}
135 %
136 %
137 %
138 %
139 %
140 %
141 % First define some blank commands, so that in case something goes wrong while
142 % loading \textsf{expl3}, we won't get strange \texttt{Undefined control
143 % sequence} errors.
144 % \changes{v1.3a}{2021/01/24}{Define \pkg{expl3} hooks conditionally}
145 % \begin{macrocode}
146 %<*2ekernel|latexrelease>
147 %<latexrelease>\IncludeInRelease{2020/10/01}%
148 %<latexrelease> {\@expl@sys@load@backend@@}{Roll forward support}%
149 \def\reserved@a#1{\ifdefined#1\else\def#1{}\fi}
150 \reserved@a\@expl@sys@load@backend@@
151 \reserved@a\@expl@push@filename@@
152 \reserved@a\@expl@push@filename@aux@@
153 \reserved@a\@expl@pop@filename@@
154 %<latexrelease>\EndIncludeInRelease
155 %</2ekernel|latexrelease>
156 % \end{macrocode}
157 %
158 % \changes{v1.2d}{2020/07/08}
159 % {Add a last-minute hook for \textsf{expl3}}
160 % Create a hook for last-minute \pkg{expl3} material.
161 % \begin{macrocode}
162 %<*2ekernel>
163 \def\@expl@finalise@setup@@{}
164 %</2ekernel>
165 % \end{macrocode}
166 %
167 % Now define some basics to support loading \textsf{expl3}. These macros can
168 % be defined here safely, because they are redefined later on by the kernel,
169 % so we define simpler versions just to suit our needs.
170 % \begin{macrocode}
171 %<*2ekernel>
172 \long\def\@gobble#1{}
173 \long\def\@firstofone#1{#1}
174 \long\def\@firstoftwo#1#2{#1}
175 \long\def\@secondoftwo#1#2{#2}
176 \long\def\IfFileExists#1{%
177 \openin\@inputcheck"#1" %
178 \ifeof\@inputcheck
179 \expandafter\@secondoftwo
180 \else
181 \closein\@inputcheck
182 \expandafter\@firstoftwo
183 \fi}
184 \long\def\@ifnextchar#1#2#3{%
185 \let\reserved@d=#1%
186 \def\reserved@a{#2}%
187 \def\reserved@b{#3}%
188 \futurelet\@let@token\@ifnch}
189 \def\@ifnch{%
190 \ifx\@let@token\reserved@d
191 \expandafter\reserved@a
192 \else
193 \expandafter\reserved@b
194 \fi}
195 %</2ekernel>
196 % \end{macrocode}
197 %
198 % If we are doing a rollback with a format containing expl3 we
199 % aren't reloading it as that creates havoc. This may need a
200 % refined version!
201 % \begin{macrocode}
202 %<*2ekernel|latexrelease>
203 %<latexrelease>\IncludeInRelease{2020/10/01}%
204 %<latexrelease> {expl3}{Pre-load expl3}%
205 \expandafter\ifx\csname tex\string _let:D\endcsname\relax
206 \expandafter\@firstofone
207 \else
208 \GenericInfo{}{Skipping: expl3 code already part of the format}%
209 %<2ekernel> \expandafter\endinput
210 %<latexrelease> \expandafter\@gobble
211 \fi
212 % \end{macrocode}
213 %
214 % Check for the required primitive/engine support and the existence of
215 % a loader.
216 % \begin{macrocode}
217 {%
218 \IfFileExists{expl3.ltx}
219 {%
220 \ifnum0%
221 \ifdefined\pdffilesize 1\fi
222 \ifdefined\filesize 1\fi
223 \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi
224 \ifdefined\kanjiskip 1\fi
225 >0 %
226 \expandafter\@firstofone
227 \else
228 % \end{macrocode}
229 %
230 % In \texttt{2ekernel} mode, an error is fatal and building the format
231 % is aborted. Use \verb=\batchmode \read -1 to \tokenlist=, which errors
232 % with
233 %\begin{verbatim}
234 % ! Emergency stop. (cannot \read from terminal in nonstop modes)
235 %\end{verbatim}
236 % and aborts the \TeX{} run. In \texttt{latexrelease} mode, raise an
237 % error and do nothing. Both ways, the error message shows the minimum
238 % \textsf{expl3} engine requirements.
239 % \begin{macrocode}
240 %<2ekernel> \def~{ }\def\MessageBreak{^^J~~~~~~~~~~~~~~~}%
241 %<2ekernel> \errmessage{LaTeX Error:
242 %<latexrelease> \@latex@error{%
243 LaTeX requires the e-TeX primitives and additional\MessageBreak
244 functionality available in the engines:\MessageBreak
245 - pdfTeX v1.40\MessageBreak
246 - XeTeX v0.99992\MessageBreak
247 - LuaTeX v0.95\MessageBreak
248 - e-(u)pTeX mid-2012\MessageBreak
249 or later%
250 %<latexrelease> }\@ehd \expandafter\@gobble
251 %<2ekernel> }\batchmode \read -1 to \reserved@a
252 \fi
253 }
254 {%
255 %<*2ekernel>
256 \errmessage{LaTeX requires expl3}%
257 \batchmode \read -1 to \reserved@a
258 %</2ekernel>
259 % \end{macrocode}
260 % We do not support a roll forward across 2019. You need to start
261 % with 2019 if you want to get to 2020 or beyond.
262 % \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)}
263 % \begin{macrocode}
264 %<*latexrelease>
265 \@latex@warning@no@line
266 {You need a format that already contains a recent\MessageBreak
267 expl3 as part of the kernel, e.g. at least a kernel\MessageBreak
268 from 2019 to roll forward to that date!\MessageBreak
269 --- I'm giving up!\MessageBreak\MessageBreak
270 Note that manually loading the expl3 package\MessageBreak
271 from your distribution is not enough}%
272 \batchmode \read -1 to \reserved@a
273 %</latexrelease>
274 }%
275 {\input expl3.ltx }%
276 }
277 %<latexrelease>\EndIncludeInRelease
278 %<latexrelease>
279 % \end{macrocode}
280 % To support roll-forward for the case where \textsf{xparse} is fully
281 % integrated into the kernel, we do not need to repeat the complex test
282 % above as we can simply look for the marker command.
283 % \begin{macrocode}
284 %<latexrelease>\IncludeInRelease{2020/02/02}%
285 %<latexrelease> {expl3}{Pre-load expl3}%
286 %<latexrelease>\IfFileExists{expl3.ltx}
287 %<latexrelease> {%
288 %<latexrelease> \ifnum0%
289 %<latexrelease> \ifdefined\pdffilesize 1\fi
290 %<latexrelease> \ifdefined\filesize 1\fi
291 %<latexrelease> \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi
292 %<latexrelease> >0 %
293 %<latexrelease> \else
294 %<latexrelease> \message{Skipping expl3-dependent extensions}
295 %<latexrelease> \expandafter\@gobbletwo
296 %<latexrelease> \fi
297 %<latexrelease> }
298 %<latexrelease> {%
299 %<latexrelease> \message{Skipping expl3-dependent extensions}%
300 %<latexrelease> \@gobbletwo
301 %<latexrelease> }%
302 %<latexrelease>\input{expl3.ltx}
303 %<latexrelease>\EndIncludeInRelease
304 % \end{macrocode}
305 %
306 % Now in |latexrelease| mode, redefine a few commands to avoid ``already
307 % defined'' errors.
308 % \changes{v1.3f}{2022/02/28}
309 % {Move latexrelease redefinitions from ltcmd.dtx}
310 % \begin{macrocode}
311 %<latexrelease>\@ifundefined{ExplSyntaxOff}{}{\latexrelease@postltexpl}
312 % \end{macrocode}
313 %
314 % \changes{v1.3a}{2021/01/21}
315 % {Move \pkg{xparse} rollback code to \texttt{ltcmd.dtx}}
316 %
317 % \subsection{Using expl3 code}
318 %
319 % In order to ease the implementation of some new features in
320 % \LaTeXe\ we may (temporarily) use some coding based on the
321 % \pkg{expl3}-code.
322 % Such macros will eventually vanish and may be changed
323 % unannounced. They are there for internal use in the \LaTeXe\
324 % kernel and are not meant to be used in third-party
325 % packages. These macros will always have the \verb|@expl@|
326 % prefix in their name.
327 %
328 % The rest of the name matches the \pkg{expl3} name but with all
329 % underscores replaced by \texttt{@}s and the \texttt{:} replaced
330 % by \texttt{@@}, e.g.,
331 %\begin{verbatim}
332 % \cs_new_eq:NN \@expl@tl@trim@spaces@apply@@nN \tl_trim_spaces_apply:nN
333 %\end{verbatim}
334 % if that \pkg{expl3} command is needed in places that are others
335 % coded in \LaTeXe{} conventions.
336 %
337 %
338 % In this file, each release of LaTeX adds an \cs{IncludeInRelease}
339 % block, in which the macros copied for that release were defined.
340 % In case a rollback is requested, the entire block is changed.
341 %
342 % Each macro copied has a \cs{changes} entry to explain when and why
343 % it was copied, so that further to that may spot it easily.
344 %
345 % Here \cs{cs\string_gset\string_eq:NN} is used, instead of the |new|
346 % variant because if different releases use that same name for
347 % different purposes, each can copy the macro without worrying about
348 % redefinitions.
349 %
350 % \begin{macrocode}
351 %<latexrelease>\IncludeInRelease{2020/10/01}{\@expl@cs@to@str@@N}%
352 %<latexrelease> {expl3 macros added for the 2020-10-01 release}%
353 % \end{macrocode}
354 %
355 % The expl3 activation needs to be inside the release guards as
356 % otherwise rolling forward is broken in old kernels that do not
357 % have expl3 loaded.
358 % \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)}
359 % \begin{macrocode}
360 \ExplSyntaxOn
361 % \end{macrocode}
362 %
363 % \changes{v1.2e}{2020/08/19}
364 % {Add \cs{@expl@cs@to@str@@N} and \cs{@expl@str@if@eq@@nnTF}
365 % for \cs{NewCommandCopy} (gh/239)}
366 % \begin{macrocode}
367 \cs_gset_eq:NN \@expl@cs@to@str@@N \cs_to_str:N
368 \cs_gset_eq:NN \@expl@str@if@eq@@nnTF \str_if_eq:nnTF
369 % \end{macrocode}
370 %
371 % \changes{v1.2e}{2020/08/19}
372 % {Add \cs{@expl@cs@\meta{thing}@spec@@N}
373 % for \cs{ShowCommand} (gh/373)}
374 % \changes{v1.3h}{2024/04/17}
375 % {Rename \cs{@expl@cs@argument@spec@@N} to
376 % \cs{@expl@cs@parameter@spec@@N} (gh/1014)}
377 % \changes{v1.3h}{2024/04/17}
378 % {Update name of \pkg{expl3} function}
379 % \changes{v1.3h}{2024/04/17}
380 % {Add a kernel-level copy of \cs{cs_parameter_spec:N}}
381 % \begin{macrocode}
382 \cs_gset_eq:NN \@expl@cs@prefix@spec@@N \cs_prefix_spec:N
383 \cs_if_exist:NTF \cs_parameter_spec:N
384 { \cs_gset_eq:NN \@expl@cs@parameter@spec@@N \cs_parameter_spec:N }
385 { \cs_gset_eq:NN \@expl@cs@parameter@spec@@N \cs_argument_spec:N }
386 \cs_gset_eq:NN \__kernel_cs_parameter_spec:N \@expl@cs@parameter@spec@@N
387 \cs_gset_eq:NN \@expl@cs@replacement@spec@@N \cs_replacement_spec:N
388 % \end{macrocode}
389 %
390 % \changes{v1.2f}{2020/09/06}
391 % {Add \cs{@expl@str@map@function@@NN
392 % and \cs{@expl@char@generate@@nn}}
393 % for \cs{string@makeletter} (gh/386)}
394 % \begin{macrocode}
395 \cs_gset_eq:NN \@expl@str@map@function@@NN \str_map_function:NN
396 \cs_gset_eq:NN \@expl@char@generate@@nn \char_generate:nn
397 % \end{macrocode}
398 %
399 % \begin{macrocode}
400 \ExplSyntaxOff
401 % \end{macrocode}
402 %
403 %
404 % Here we can't assume that expl3 is available. It will be if we
405 % roll back but if this code is executed rolling forward it needs
406 % to be pure 2e.
407 % \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)}
408 % \begin{macrocode}
409 %<latexrelease>\EndIncludeInRelease
410 %<latexrelease>\IncludeInRelease{0000/00/00}{\@expl@cs@to@str@@N}%
411 %<latexrelease> {expl3 macros added for the 2020-10-01 release}%
412 %<latexrelease>\let \@expl@cs@to@str@@N \@undefined
413 %<latexrelease>\let \@expl@str@if@eq@@nnTF \@undefined
414 %<latexrelease>\let \@expl@cs@prefix@spec@@N \@undefined
415 %<latexrelease>\let \@expl@cs@parameter@spec@@N \@undefined
416 %<latexrelease>\let \@expl@cs@replacement@spec@@N \@undefined
417 %<latexrelease>\let \@expl@str@map@function@@NN \@undefined
418 %<latexrelease>\EndIncludeInRelease
419 %</2ekernel|latexrelease>
420 % \end{macrocode}
421 %
422 %
423 %
424 %
425 %
426 %
427 % \section{Document-level command names for \pkg{expl3} functions}
428 %
429 % Current home for L3 programming layer functions that we make
430 % directly available at the document level. This section may need
431 % to be moved later (after \cs{NewDocumentCommand} is defined in
432 % case we want to use that in the setup).
433 %
434 %
435 % \DescribeMacro\fpeval
436 % The expandable command \cs{fpeval} takes as its argument a
437 % floating point expression and produces a result using the normal
438 % rules of mathematics. As this command is expandable it can be
439 % used where \TeX{} requires a number and for example within a
440 % low-level \cs{edef} operation to give a purely numerical
441 % result. See \texttt{usrguide3} for further explanation.
442 %
443 % \DescribeMacro\inteval
444 % \DescribeMacro\dimeval
445 % \DescribeMacro\skipeval
446 % The expandable command \cs{inteval} takes as its argument an
447 % integer expression and produces a result using the normal rules
448 % of mathematics. The operations recognised are |+|, |-|, |*| and
449 % |/| plus parentheses. Division occurs with \emph{rounding}, and
450 % ties are rounded away from zero. As this command is expandable it
451 % can be used where \TeX{} requires a number and for example within
452 % a low-level \cs{edef} operation to give a purely numerical
453 % result. See \texttt{usrguide3} for further explanation.
454 % \cs{dimeval} and \cs{skipeval} are similar, but generate fixed and
455 % rubber length values, respectively.
456 %
457 %
458 %
459 % \begin{macro}{\fpeval,\inteval,\dimeval,\skipeval}
460 % A document level wrapper around the code level function for
461 % floating point calculations.
462 % \changes{v1.3d}{2021/11/30}{Moved over from \texttt{xfp} package (gh/711)}
463 % \begin{macrocode}
464 %<*2ekernel|latexrelease>
465 %<latexrelease>\IncludeInRelease{2022/06/01}%
466 %<latexrelease> {\fpeval}{fp and int calculations}%
467 \ExplSyntaxOn
468 \cs_new_eq:NN \fpeval \fp_eval:n
469 % \end{macrocode}
470 % And a few more, this time wrappers around the e\TeX{} primitives.
471 % \begin{macrocode}
472 \cs_new_eq:NN \inteval \int_eval:n
473 % \end{macrocode}
474 %
475 % \changes{v1.3d}{2021/12/07}{Added \cs{dimeval} and \cs{skipeval} (gh/711)}
476 % \begin{macrocode}
477 \cs_new_eq:NN \dimeval \dim_eval:n
478 \cs_new_eq:NN \skipeval \skip_eval:n
479 \ExplSyntaxOff
480 % \end{macrocode}
481 % \end{macro}
482 %
483 % \begin{macrocode}
484 %</2ekernel|latexrelease>
485 %<latexrelease>\EndIncludeInRelease
486 %<latexrelease>\IncludeInRelease{0000/00/00}%
487 %<latexrelease> {\fpeval}{fp and int calculations}%
488 %<latexrelease>
489 %<latexrelease>\let\fpeval\@undefined
490 %<latexrelease>\let\inteval\@undefined
491 %<latexrelease>\let\dimeval\@undefined
492 %<latexrelease>\let\skipeval\@undefined
493 %<latexrelease>\EndIncludeInRelease
494 % \end{macrocode}
495 %
496 %
497 % \DescribeMacro\UseName
498 % \DescribeMacro\ExpandArgs
499 % When declaring new commands with \cs{NewDocumentCommand} or
500 % \cs{NewCommandCopy} or similar, it is sometimes necessary to
501 % ``construct'' the csname. As a general mechanism the L3
502 % programming layer has \cs{exp\_args:N...} for this, but there is
503 % no mechanism for it if \cs{ExplSyntaxOn} is not active. We
504 % therefore offer a few of these commands also with CamelCase names.
505 %
506 %
507 % \begin{macro}{\UseName,\ExpandArgs}
508 % A document wrapper for changing arguments to cs names for use
509 % with \cs{NewDocumentCommand} and similar functions.
510 %
511 % \changes{v1.3d}{2021/12/28}{Added document level names for \cs{exp\_args:Nc} and the like (gh/735)}
512 % \changes{v1.3e}{2022/01/06}{Adjust document level names for \cs{exp\_args:Nc} and the like (gh/735)}
513 % \begin{macrocode}
514 %<*2ekernel|latexrelease>
515 %<latexrelease>\IncludeInRelease{2022/06/01}%
516 %<latexrelease> {\ExpandArgs}{Some pre-expansion commands}%
517 \ExplSyntaxOn
518 \cs_new_eq:NN \UseName \use:c
519 % \end{macrocode}
520 %
521 % \begin{macrocode}
522 \cs_new:Npn \ExpandArgs #1
523 {
524 \cs_if_exist_use:cF { exp_args:N #1 }
525 { \msg_expandable_error:nnn { kernel } { unknown-arg-expansion } {#1} }
526 }
527 \msg_new:nnn { kernel } { unknown-arg-expansion }
528 { Unknown~arg~expansion~"#1" }
529 \ExplSyntaxOff
530 % \end{macrocode}
531 % \end{macro}
532 %
533 % \begin{macrocode}
534 %</2ekernel|latexrelease>
535 %<latexrelease>\EndIncludeInRelease
536 %<latexrelease>\IncludeInRelease{0000/00/00}%
537 %<latexrelease> {\ExpandArgs}{Some pre-expansion commands}%
538 %<latexrelease>
539 %<latexrelease>\let\UseName\@undefined
540 %<latexrelease>\let\ExpandArgs\@undefined
541 %<latexrelease>\EndIncludeInRelease
542 % \end{macrocode}
543 %
544 % \DescribeMacro\IfExplAtLeastTF
545 % \DescribeMacro\IfExplAtLeastT
546 % \DescribeMacro\IfExplAtLeastF
547 % A pretty simple set of wrappers. \cs{IfExplAtLeastTF} was already
548 % introduced in 2023 but since we pretend that these commands were
549 % always there, even in rollback, things can be kept simple and we
550 % just alter the rollback date.
551 %
552 % \begin{macro}{\IfExplAtLeastTF}
553 % \changes{v1.3g}{2023/10/13}{Provide a test for \pkg{expl3} date (gh/1004)}
554 % \changes{v1.3i}{2025/03/01}{Also provide T and F variants of
555 % \cs{IfExplAtLeastTF} (gh/1522)}
556 % \changes{v1.3l}{2025/06/05}{Provide T and F variants of
557 % \cs{IfExplAtLeastTF} with a correct implementation (gh/1752)}
558 % \begin{macrocode}
559 %<*2ekernel|latexrelease>
560 %<latexrelease>\IncludeInRelease{2025/06/01}%
561 %<latexrelease> {\IfExplAtLeastTF}{Test for expl3 date}%
562 \def\IfExplAtLeastTF{\@ifl@t@r\ExplLoaderFileDate}
563 \def\IfExplAtLeastT#1#2{\IfExplAtLeastTF{#1}{#2}\@firstofone\@gobble}
564 \def\IfExplAtLeastF#1{\IfExplAtLeastTF{#1}{}}
565 % \end{macrocode}
566 % \end{macro}
567 % We make sure the commands are always available.
568 % \begin{macrocode}
569 %</2ekernel|latexrelease>
570 %<latexrelease>\EndIncludeInRelease
571 %<latexrelease>\IncludeInRelease{0000/00/00}%
572 %<latexrelease> {\IfExplAtLeastTF}{Test for expl3 date}%
573 %<latexrelease>
574 %<latexrelease>\def\IfExplAtLeastTF{\@ifl@t@r\ExplLoaderFileDate}
575 %<latexrelease>\def\IfExplAtLeastT#1#2{\IfExplAtLeastTF{#1}{#2}\@firstofone\@gobble}
576 %<latexrelease>\def\IfExplAtLeastF#1{\IfExplAtLeastTF{#1}{}}
577 %<latexrelease>\EndIncludeInRelease
578 % \end{macrocode}
579 %
580 % \begin{macro}{\expandableinput}
581 % \changes{v1.3k}{2025/03/40}{Added document level name for \cs{file_input_raw:n} (gh/514)}
582 % \begin{macrocode}
583 %<*2ekernel|latexrelease>
584 %<latexrelease>\IncludeInRelease{2025/06/01}%
585 %<latexrelease> {\expandableinput}{Expandable input}%
586 \ExplSyntaxOn
587 \cs_new_eq:NN \expandableinput \file_input_raw:n
588 \ExplSyntaxOff
589 % \end{macrocode}
590 % \end{macro}
591 %
592 % \begin{macrocode}
593 %</2ekernel|latexrelease>
594 %<latexrelease>\EndIncludeInRelease
595 %<latexrelease>\IncludeInRelease{0000/00/00}%
596 %<latexrelease> {\expandableinput}{Expandable input}%
597 %<latexrelease>
598 %<latexrelease>\let\expandableinput\@undefined
599 %<latexrelease>\EndIncludeInRelease
600 % \end{macrocode}
601 %
602 % \Finale