Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-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: ltvers.dtx
32 %
33 %<*driver>
34 % \fi
35 \ProvidesFile{ltvers.dtx}
36 [2022/11/06 v1.1j LaTeX Kernel (Version Info)]
37 % \iffalse
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltvers.dtx}
40 \title{\filename}
41 \date{\filedate}
42 \author{%
43 Johannes Braams\and
44 David Carlisle\and
45 Alan Jeffrey\and
46 Leslie Lamport\and
47 Frank Mittelbach\and
48 Chris Rowley\and
49 Rainer Sch\"opf}
50 \begin{document}
51 \MaintainedByLaTeXTeam{latex}
52 \maketitle
53 \DocInput{\filename}
54 \end{document}
55 %</driver>
56 % \fi
57 %
58 %
59 % \section{Version Identification}
60 % First we identify the date and version number of this release of
61 % \LaTeX, and set |\everyjob| so that it is printed at the start of
62 % every \LaTeX\ run.
63 %
64 % \MaybeStop{}
65 %
66 % \changes{v1.0g}{1996/11/28}
67 % {Check for old format modified /2319}
68 % \changes{v1.0f}{1996/11/20}
69 % {Check for old format modified /2319}
70 % \changes{v1.0e}{1995/05/12}
71 % {Add autoload docstrip guards}
72 % \changes{v1.0e}{1995/05/12}
73 % {Check for format older than 1 year}
74 % \changes{v1.0d}{1994/05/25}
75 % {Remove PRELIMINARY TEST RELEASE from startup banner
76 % (spring is here)}
77 % \changes{v1.0b}{1994/04/12}
78 % {Have version info generated automatically.}
79 % \changes{v1.0a}{1994/03/04}
80 % {Initial version, split from latex.dtx}
81 % \changes{v1.0r}{2015/02/21}{Removed autoload code}
82 % \changes{v1.0t}{2015/06/23}
83 % {set \cs{patch@level} in ltvers rather than in ltfinal/ltpatch}
84 %
85 % \begin{macro}{\fmtname}
86 % \begin{macro}{\fmtversion}
87 % \begin{macro}{\latexreleaseversion}
88 % \begin{macro}{\patch@level}
89 % A |\patch@level| of \texttt{0} or higher denotes an official
90 % public release. A negative value indicates a candidate release
91 % that is not distributed.
92 %
93 % If we put code updates into the kernel that are supposed to go
94 % into the next release we set the |\patch@level| to \texttt{-1}
95 % and the |\fmtversion| / |\latexreleaseversion| to the dated of
96 % the next release (guessed, the real value is not so important and
97 % will get corrected when we make the release official).
98 %
99 % If the |\patch@level| is already at \texttt{-1} we do nothing
100 % here and use the |\fmtversion| date for any new|\IncludeInRelease|
101 % line when we add further code.
102 %
103 % Finally, if we do make a public release we either just set the
104 % |\patch@level| to zero (if our initial guess was good) or we also
105 % change the date and then have to additionally change to that date
106 % on all the |\IncludeInRelease| statements that used the
107 % ``guessed'' date.
108 % \begin{macrocode}
109 %<*2ekernel>
110 \def\fmtname{LaTeX2e}
111 \edef\fmtversion
112 %</2ekernel>
113 %<latexrelease>\edef\latexreleaseversion
114 %<*2ekernel|latexrelease>
115 {2025-11-01}
116 %</2ekernel|latexrelease>
117 %<*2ekernel>
118 \def\patch@level{0}
119 % \end{macrocode}
120 %
121 % \begin{macro}{\development@branch@name}
122 % For more fine grain control there is the possibility to name the
123 % current development branch. This is only used when the
124 % \cs{patch@level} is negative (i.e., a pre-release format) and is
125 % intended to help us internally when we locally install a
126 % format out of some development branch.
127 % \begin{macrocode}
128 \edef\development@branch@name{}
129 % \end{macrocode}
130 % \end{macro}
131 % \end{macro}
132 % \end{macro}
133 % \end{macro}
134 % \end{macro}
135 %
136 % Check that the format being made is not too old.
137 % The error message complains about `more than 5 years'
138 % but in fact the error is not triggered until 65 months.
139 %
140 % This code is currently not activated as we don't know if we already
141 % got to the last official 2e version (due to staff shortage or due to
142 % a successor (think positive:-)).
143 % \changes{v1.0i}{2001/06/04}{Check for old format disabled}
144 % \changes{v1.0k}{2004/01/28}{Check for old format made 5 years (pr/3601)}
145 % \changes{v1.0l}{2009/09/24}{Stop checking for old format}
146 % \begin{macrocode}
147 \iffalse
148 \def\reserved@a#1/#2/#3\@nil{%
149 \count@\year
150 \advance\count@-#1\relax
151 \multiply\count@ by 12\relax
152 \advance\count@\month
153 \advance\count@-#2\relax}
154 \expandafter\reserved@a\fmtversion\@nil
155 % \end{macrocode}
156 % |\count@| is now the age of this file in months. Take a generous
157 % definition of `year' so this message is not generated too often.
158 % \begin{macrocode}
159 \ifnum\count@>65
160 \typeout{^^J%
161 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
162 ! You are attempting to make a LaTeX format from a source file^^J%
163 ! That is more than five years old.^^J%
164 !^^J%
165 ! If you enter <return> to scroll past this message then the format^^J%
166 ! will be built, but please consider obtaining newer source files^^J%
167 ! before continuing to build LaTeX.^^J%
168 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
169 }
170 \errhelp{To avoid this error message, obtain new LaTeX sources.}
171 \errmessage{LaTeX source files more than 5 years old!}
172 \fi
173 \let\reserved@a\relax
174 \fi
175 % \end{macrocode}
176 %
177 % \changes{v1.0p}{2015/01/22}{Preserve any \cs{everyjob} material inserted
178 % by a loader (\texttt{.ini} file)}
179 % \changes{v1.0v}{2015/08/23}{Allow negative patchlevel for pre-release}
180 % \changes{v1.1e}{2020/01/31}{Allow for upcoming format as pre-release 0}
181 % \changes{v1.1j}{2022/11/06}{Repeat release info at the end (gh/944)}
182 %
183 % We store release info in the toks \cs{LaTeXReleaseInfo} to be
184 % used in \cs{everyjob} but also when \verb=\end{document}= is
185 % executed.
186 % Instead of using \cs{typeout} we use \cs{show@release@info} so
187 % that we can write to the log only by changing that to \cs{wlog}.
188 % \begin{macrocode}
189 \newtoks\LaTeXReleaseInfo
190 \everyjob\expandafter{\the\everyjob\the\LaTeXReleaseInfo}
191 \let\show@release@info\typeout
192 % \end{macrocode}
193 %
194 % \begin{macrocode}
195 \ifnum0\ifnum\patch@level=0 \ifx\development@branch@name\@empty 1\fi\fi>0 %
196 \LaTeXReleaseInfo\expandafter{\the\LaTeXReleaseInfo
197 \show@release@info{\fmtname\space <\fmtversion>}}
198 \immediate
199 \write16{\fmtname \space<\fmtversion>}
200 \else\ifnum\patch@level>0
201 \LaTeXReleaseInfo\expandafter{\the\LaTeXReleaseInfo
202 \show@release@info{\fmtname\space <\fmtversion> patch level \patch@level}}
203 \immediate
204 \write16{\fmtname\space <\fmtversion> patch level \patch@level}
205 \else
206 \LaTeXReleaseInfo\expandafter{\the\LaTeXReleaseInfo
207 \show@release@info{\fmtname\space <\fmtversion>
208 pre-release-\number-\patch@level\space
209 \ifx\development@branch@name\@undefined \else
210 \ifx\development@branch@name\@empty \else
211 \space (\development@branch@name\space branch)%
212 \fi
213 \fi
214 }}
215 \immediate
216 \write16{\fmtname\space <\fmtversion>
217 pre-release-\number-\patch@level\space
218 \ifx\development@branch@name\@undefined \else
219 \ifx\development@branch@name\@empty \else
220 \space (\development@branch@name\space branch)%
221 \fi
222 \fi
223 }
224 \fi
225 \fi
226 %</2ekernel>
227 % \end{macrocode}
228 %
229 % \begin{macro}{\IncludeInRelease}
230 % \begin{macro}{\EndIncludeInRelease}
231 % \begin{macro}{\@IncludeInRelease}
232 % \begin{macro}{\@IncludeInRele@se}
233 % \begin{macro}{\@gobble@IncludeInRelease}
234 % \begin{macro}{\@check@IncludeInRelease}
235 % \changes{v1.0w}{2015/02/21}
236 % {set \cs{@currname} empty here (in case \cs{IncludeInRelease} input early)}
237 % \begin{macrocode}
238 %<2ekernel>\let\@currname\@empty
239 % \end{macrocode}
240 %
241 % \changes{v1.0n}{2015/01/07}{macro added}
242 % \changes{v1.0m}{2015/01/17}{modified with \cs{@currname}}
243 % \changes{v1.0o}{2015/01/19}{Optional argument}
244 % \changes{v1.0q}{2015/02/19}{Swap argument order}
245 % \changes{v1.1f}{2021/03/18}{Add support for usage in \cs{NewModuleRelease}}
246 % \changes{v1.1h}{2021/08/10}{Add error to aid debugging}
247 %
248 % \begin{macrocode}
249 %<*2ekernel|latexrelease>
250 %<latexrelease>\newif\if@includeinrelease
251 %<latexrelease>\@includeinreleasefalse
252 % \end{macrocode}
253 % \begin{macrocode}
254 \def\IncludeInRelease#1{%
255 \if@includeinrelease
256 \PackageError{latexrelease}{mis-matched IncludeInRelease}%
257 {There is an \string\EndIncludeRelease\space missing}%
258 \@includeinreleasefalse
259 \fi
260 \ifnum0%
261 \ifx\new@moduledate\@empty\else 1\fi
262 \ifnum \expandafter\@parse@version#1//00\@nil=0 1\fi
263 =11
264 \expandafter\@firstoftwo
265 \else
266 \expandafter\@secondoftwo
267 \fi
268 {\finish@module@release{#1}}%
269 {\kernel@ifnextchar[%
270 {\@IncludeInRelease{#1}}
271 {\@IncludeInRelease{#1}[#1]}}}
272 \def\finish@module@release#1#2#3{%
273 \toks@{[#1] #3}%
274 \begingroup
275 \edef\x{\detokenize\expandafter{\new@modulename}}%
276 \edef\y{\detokenize{#2}}%
277 \expandafter\endgroup
278 \ifx\x\y \else
279 \@latex@error{\noexpand\IncludeInRelease dated #1 in a module is not
280 allowed.\MessageBreak Use a date at least equal to \new@moduledate
281 \space for complete rollback}\@ehd
282 \fi
283 \ifnum\expandafter\@parse@version\new@moduledate//00\@nil
284 >\expandafter\@parse@version\fmtversion//00\@nil
285 \GenericInfo{}{Applying: \the\toks@}%
286 \else
287 \GenericInfo{}{Skipping: \the\toks@}%
288 \expandafter\gobble@finish@module@release
289 \fi}
290 \long\def\gobble@finish@module@release#1\EndModuleRelease{%
291 \EndModuleRelease}
292 % \end{macrocode}
293 %
294 % If a specific date has not been specified in |latexrelease|
295 % use `|#1|`.
296 % \begin{macrocode}
297 \def\@IncludeInRelease#1[#2]{\@IncludeInRele@se{#2}}
298 % \end{macrocode}
299 %
300 % \begin{macrocode}
301 \def\@IncludeInRele@se#1#2#3{%
302 \toks@{[#1] #3}%
303 \expandafter\ifx\csname\string#2+\@currname+IIR\endcsname\relax
304 % \end{macrocode}
305 % If we roll back and the first patch already match then applying
306 % that is actually reapplying what is already in the format, i.e.,
307 % it is useless and possibly allocating new registers. However, it
308 % makes the logic simpler so this is the way it is for now. In
309 % theory we could always jump over the first patch because that is
310 % only really needed for rolling forward. So maybe one day \dots
311 % \begin{macrocode}
312 \ifnum\expandafter\@parse@version#1//00\@nil
313 >\expandafter\@parse@version\fmtversion//00\@nil
314 \GenericInfo{}{Skipping: \the\toks@}%
315 \expandafter\expandafter\expandafter\@gobble@IncludeInRelease
316 \else
317 \GenericInfo{}{Applying: \the\toks@}%
318 \@includeinreleasetrue
319 \expandafter\let\csname\string#2+\@currname+IIR\endcsname\@empty
320 \fi
321 \else
322 \GenericInfo{}{Already applied: \the\toks@}%
323 \expandafter\@gobble@IncludeInRelease
324 \fi
325 }
326 % \end{macrocode}
327 %
328 % \begin{macrocode}
329 \def\EndIncludeInRelease{%
330 \if@includeinrelease
331 \@includeinreleasefalse
332 \else
333 \PackageError{latexrelease}{mis-matched EndIncludeInRelease}{}%
334 \fi
335 \if@skipping@module
336 \expandafter\new@module@skip
337 \fi}
338 % \end{macrocode}
339 %
340 % \begin{macrocode}
341 \long\def\@gobble@IncludeInRelease#1\EndIncludeInRelease{%
342 \@includeinreleasefalse
343 \@check@IncludeInRelease#1\IncludeInRelease\@check@IncludeInRelease
344 \@end@check@IncludeInRelease}
345 % \end{macrocode}
346 % \begin{macrocode}
347 \long\def\@check@IncludeInRelease#1\IncludeInRelease
348 #2#3\@end@check@IncludeInRelease{%
349 \ifx\@check@IncludeInRelease#2\else
350 \PackageError{latexrelease}{skipped IncludeInRelease for tag \string#2}{}%
351 \fi
352 \if@skipping@module
353 \expandafter\new@module@skip
354 \fi}
355 % \end{macrocode}
356 % \end{macro}
357 % \end{macro}
358 % \end{macro}
359 % \end{macro}
360 % \end{macro}
361 % \end{macro}
362 %
363 % \subsection{Declaring an all-new module}
364 %
365 % \begin{macro}{\if@skipping@module}
366 % \begin{macro}{\NewModuleRelease}
367 % \begin{macro}{\EndModuleRelease}
368 % \begin{macro}{\new@module@skip}
369 % \begin{macro}{\new@modulename}
370 % \begin{macro}{\new@moduledate}
371 %
372 % When we have a whole new module, we can't roll back to a date where
373 % such module exists, otherwise hundreds of \enquote{command already
374 % defined} errors will pop up. But we can't skip it altogether
375 % either, because the module might have changes we still want applied,
376 % so a more detailed cherry-picking of code chunks have to be done.
377 %
378 % \changes{v1.1f}{2021/03/18}{Added \cs{NewModuleRelease}.}
379 % \changes{v1.1g}{2021/04/16}
380 % {\cs{NewModuleRelease} with the same arguments as \cs{IncludeInRelease}.}
381 % \changes{v1.1i}{2022/02/28}
382 % {Detect a missing \cs{IncludeInRelease}\texttt{\{0000/00/00\}}.}
383 % \begin{macrocode}
384 \let\if@skipping@module\iffalse
385 \def\@skipping@moduletrue{\let\if@skipping@module\iftrue}
386 \def\@skipping@modulefalse{\let\if@skipping@module\iffalse}
387 \let\new@modulename\@empty
388 \let\new@moduledate\@empty
389 \def\NewModuleRelease#1#2#3{%
390 \ifx\new@modulename\@empty \else
391 \@latex@error{Nested \noexpand\NewModuleRelease forbidden.}\@ehd \fi
392 \edef\new@moduledate{#1}%
393 \edef\new@modulename{#2}%
394 \GenericInfo{}{BEGIN module: \new@modulename\space (\new@moduledate)}%
395 \GenericInfo{}{ \@spaces\@spaces\@spaces\space#3\@gobble}%
396 \ifnum\sourceLaTeXdate<%
397 \expandafter\@parse@version\new@moduledate//00\@nil\relax
398 \ifnum\expandafter\@parse@version\fmtversion//00\@nil<%
399 \expandafter\@parse@version\new@moduledate//00\@nil\relax
400 \GenericInfo{}{Skipping module \new@modulename}%
401 \expandafter\expandafter
402 \expandafter\gobble@finish@module@release
403 \else
404 \GenericInfo{}{Applying module \new@modulename}
405 \@skipping@modulefalse
406 \fi
407 \else
408 \GenericInfo{}{Skipping module \new@modulename}
409 \@skipping@moduletrue
410 \expandafter\new@module@skip
411 \fi}
412 \long\def\new@module@skip#1\IncludeInRelease{%
413 \long\def\reserved@a##1\EndModuleRelease{}%
414 \if\relax\detokenize\expandafter{\reserved@a#1{}{}\EndModuleRelease}\relax
415 \else
416 \@latex@error{Missing mandatory \string\IncludeInRelease{0000/00/00}}\@ehc
417 \expandafter\@secondoftwo
418 \fi
419 \@gobble
420 {\@expandtwoargs\IncludeInRelease
421 {0000/00/00}{\new@modulename}%
422 {ERROR! Emergency recovery}%
423 #1}%
424 \IncludeInRelease}
425 \def\EndModuleRelease{%
426 \ifx\new@modulename\@empty
427 \@latex@error{Extra \string\EndModuleRelease.}\@eha
428 \else
429 \GenericInfo{}{END module: \new@modulename\space (\new@moduledate)}%
430 \let\new@modulename\@empty
431 \let\new@moduledate\@empty
432 \@skipping@modulefalse
433 \fi}
434 % \end{macrocode}
435 % \end{macro}
436 % \end{macro}
437 % \end{macro}
438 % \end{macro}
439 % \end{macro}
440 % \end{macro}
441 %
442 % \begin{macrocode}
443 %</2ekernel|latexrelease>
444 % \end{macrocode}
445 %
446 % \Finale
447 %
448 \endinput