summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx
blob: 5e726298b26053dcfce368717f1150c5be3724d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
% \iffalse meta-comment
%
% Copyright (C) 2019-2020
% The LaTeX3 Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%    https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
% \fi
%
% \iffalse
%%% From File: ltexpl.dtx
%
%<*driver>
% \fi
\ProvidesFile{ltexpl.dtx}
             [2020-05-03 v1.2b LaTeX Kernel (expl3-dependent code)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltfinal.dtx}
\title{\filename}
\date{\filedate}
\author{%
  Joseph Wright}
\begin{document}
 \MaintainedByLaTeXTeam{latex}
 \maketitle
 \DocInput{ltfinal.dtx}
\end{document}
%</driver>
% \fi
%
% \section{\pkg{expl3}-dependent code}
%
% \StopEventually{}
%
% \changes{v0.0}{2019-10-02}{Initial version}
%
%    \begin{macrocode}
%<*2ekernel>
%    \end{macrocode}
%
% \subsection{Loader}
%
%  Check for the required primitive/engine support and the existence of
%  a loader.
%    \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/02/02}%
%<latexrelease>                 {expl3}{Pre-load expl3}%
%    \end{macrocode}
%    If we are doing a rollback with a format containing expl3 we
%    aren't reloading it as that creates havoc. This may need a
%    refined version!
% \changes{v1.0a}{2020/03/02}
%         {Don't load expl3 if already in the format (gh/295)}
% \changes{v1.1}{2020/03/05}
%         {Load xparse.ltx if \cs{NewDocumentCommand} is not defined
%         by expl3.ltx}
%    \begin{macrocode}
\expandafter\ifx\csname tex\string _let:D\endcsname\relax
  \IfFileExists{expl3.ltx}
    {%
      \ifnum0%
        \ifdefined\pdffilesize 1\fi
        \ifdefined\filesize 1\fi
        \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi
        >0 %
        \expandafter\@firstofone
      \else
        \message{Skipping expl3-dependent extensions}
%<2ekernel>      \expandafter\endinput
%<latexrelease>      \expandafter\@gobble
      \fi
    }
    {%
      \message{Skipping expl3-dependent extensions}%
%<2ekernel>    \endinput
%<latexrelease>    \@gobble
    }%
    {%
      \input{expl3.ltx}
      \ifdefined\NewDocumentCommand
      \else
        \IfFileExists{xparse.ltx}
          {\input{xparse.ltx}}
          {}%
       \fi
    }%
\else
  \GenericInfo{}{Skipping: expl3 code already part of the format}
\fi
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%    \end{macrocode}
%
%    \subsection{Using expl3 code}
%
%    \begin{macrocode}
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease>                 {\@expl@tl@trim@spaces@apply@@nN}
%<latexrelease>                 {l3 macro for use in include}%
%    \end{macrocode}
%    In order to ease the implemantation of some new features in
%    \LaTeXe\ we may (temporarily) use some coding based on the
%    \pkg{expl3}-code.
%    Such macros will eventually vanish and may be changed
%    unannounced. They are there for internal use in the \LaTeXe\
%    kernel and are not meant to be used in third-party
%    packages. These macros will always have the \verb|@expl@|
%    prefix in their name.
%
% \changes{v1.2a}{2020/05/02}
%         {Define a macro based on l3 language to support inclusion of
%         files with space in the name (gh/217)}
%    \begin{macrocode}
\ExplSyntaxOn
\cs_new_eq:NN \@expl@tl@trim@spaces@apply@@nN \tl_trim_spaces_apply:nN
\ExplSyntaxOff
%    \end{macrocode}
%
%    \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease>                 {\@expl@tl@trim@spaces@apply@@nN}
%<latexrelease>                 {l3 macro for use in include}%
%<latexrelease>
%<latexrelease>\let\@expl@tl@trim@spaces@apply@@nN\@undefined
%<latexrelease>
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
%    \end{macrocode}
%
%    \begin{macrocode}
%</2ekernel>
%    \end{macrocode}
%
% \Finale