1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
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 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
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
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.
30 % \ProvidesFile{ltdirchk.dtx}
31 % [2015/81/33 v1.2 LaTeX Kernel (System Dependent Parts)]
34 %%% From File: ltdirchk.dtx
37 \ifx\documentclass\undefined\let\next\relax\else\def\next{%
41 \ProvidesFile{ltdirchk.dtx}
42 [2015/10/02 v1.2a LaTeX Kernel (System Dependent Parts)]
44 \documentclass{ltxdoc}
45 \GetFileInfo{ltdirchk.dtx}
46 \title{\filename\thanks{%
47 this document also includes the source for
48 texsys.cfg and ltxcheck.tex}}
49 \author{David Carlisle}
52 \MaintainedByLaTeXTeam{latex}
62 % \changes{v0.2j}{1994/02/25}
63 % {Remove need for drv file}
64 % \changes{v0.2k}{1994/03/01}
65 % {Add unstripped module,
66 % so that dircheck.dtx may be used with initex}
67 % \changes{v1.0a}{1994/03/08}
68 % {Reorganise driver module into `new style'}
69 % \changes{v1.0b}{1994/03/12}
70 % {Change name from dircheck.dtx}
71 % \changes{v1.0b}{1994/03/12}
72 % {Minor edits to the typeouts in ltxcheck}
73 % \changes{v1.0d}{1994/03/28}
74 % {Improve documentation}
75 % \changes{v1.0i}{1994/11/03}
76 % {Generate an error if latex.ltx not used with clean initex}
77 % \changes{v1.0j}{1994/11/17}
78 % {\cs{@tempa} to \cs{reserved@a}}
79 % \changes{v1.0r}{1996/06/13}
80 % {documentation improvements mainly from internal/2174}
81 % \changes{v1.0v}{1997/06/16}
82 % {documentation improvements mainly from internal/2520}
83 % \changes{v1.0w}{1998/08/17}{(RmS) Documentation improvements.}
87 % \section{\LaTeX\ System Dependent Initialisations}
89 % \changes{v0.2g}{1994/01/21}
90 % {Improve documentation, reorganise docstrip module}
92 % This file implements the semi-automatic determination of various
93 % system dependent parts of the initialisation. The actual definitions
94 % may be placed in a file |texsys.cfg|. Thus for operating systems for
95 % which the tests here do not result in acceptable settings, a `hand
96 % written' |texsys.cfg| may be produced.
98 % The macros that must be defined are:
100 % \DescribeMacro{\@currdir}
101 % |\@currdir|\meta{filename}\meta{space} should expand to a form of the
102 % filename that uniquely refers to the `current directory' if this is
103 % possible. (The expansion should also end with a space.) on UNIX,
104 % this is |\def\@currdir{./}|. For more exotic operating systems you may
105 % want to make |\@currdir| a macro with arguments delimited by |.|
106 % and/or \meta{space}. If the operating system has no concept of
107 % directory structure, this macro should be defined to be empty.
110 % \DescribeMacro{\input@path}
111 % If the primitive |\openin| searches the same directories as the
112 % primitive |\input|, then it is possible to tell (using |\ifeof|)
113 % whether a file exists before trying to input it. For systems like
114 % this, |\input@path| should be left undefined.
116 % If |\openin| does not `follow' |\input| then |\input@path| must be
117 % defined to be a list of directories to search for input files. The
118 % format for each directory is as for |\@currdir|, normally just a
119 % prefix is required, but it may be a macro with space-delimited
120 % argument. That is, if \meta{dir} is an entry in the input path,
121 % \TeX\ will try to load the expansion of
122 % \meta{dir}\meta{filename}\meta{space}
124 % So either \meta{dir} should be defined as a macro with argument
125 % delimited by space, or it should just expand to a directory name,
126 % including the final directory separator, so that it may be
127 % concatenated with the \meta{filename}. This means that for UNIX-like
128 % syntax, each \meta{dir} should end with a slash, |/|.
130 % |\input@path| should expand to a list of such directories, each in a
133 % \DescribeMacro{\filename@parse}
134 % After a call of the form: |\filename@parse{|\meta{filename}|}|, the
135 % three macros |\filename@area|,|\filename@base|,|\filename@ext| should
136 % be defined to be the `area' (or directory), basename and
137 % extension respectively. If there was no extension specified in
138 % \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
139 % case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
140 % default extension substituted).
142 % Normally one would not need to define this macro in |texsys.cfg| as
143 % the automatic tests can supply parsers that work with UNIX and VMS and
144 % Macintosh syntax, as well as a basic parser that will cover many other
145 % cases. However some operating systems may need a `hand produced'
146 % parser in which case it should be defined in this file.
148 % The UNIX parser also works for most MSDOS \TeX\ versions.
149 % Currently if the UNIX, VMS or Macintosh parser is not used,
150 % |\filename@parse| is defined to always return an empty area, and to
151 % split the argument into basename and extension at the first `|.|'
152 % that occurs in the name.
153 % Parsers for other formats may be defined in |texsys.cfg|,
154 % in which case they will be used in preference to the default
157 % \DescribeMacro{\@TeXversion}
158 % \changes{v1.0f}{1994/05/23}{Document \cs{@TeXversion}}
159 % |\@TeXversion| is now set automatically by the initialisation tests
160 % in this file. You should not need to set it in |texsys.cfg|, however
161 % the following documentation is left for information. \LaTeX\ does
162 % not set this variable exactly, the automatic tests set it to:\\
163 % |2| for any version, $v$, $v < 3.0$\\
164 % |3| for any version, $v$, $3.0 \leq v \leq 3.14$\\
165 % \meta{undefined} otherwise.\\
166 % However these values are accurate enough for \LaTeX\ to take
167 % appropriate action for these old \TeX{}s.
169 % If your \TeX\ is older than version 3.141, then you should define
170 % |\@TeXversion| (using |\def|) to be the version number. If you do not
172 % {Actually if your \TeX\ is really old, version~2, \LaTeX\ can
173 % detect this, and sets \cs{@TeXversion} to~2 if it is not set in
174 % the \texttt{cfg} file.}
175 %, \LaTeX\ will not work around a bug in old \TeX\ versions, and
176 % so error messages will appear in a very strange format, with |^^J|
177 % appearing instead of line breaks:
178 % \begingroup\catcode`\==\active \def=#1#2{}\hfuzz\maxdimen
180 %! LaTeX Error: \rubbish undefined.^^J^^JSee the LaTeX manual or LaTeX=
182 % for explanation.^^JType H <return> for immediate help.
185 %l.3 \renewcommand{\rubbish}
190 % However if you put |\def\@TeXversion{3.14}| in \texttt{texsys.cfg}
191 % the following format will be used:
193 %! LaTeX Error: \rubbish undefined.
195 %See the LaTeX manual or LaTeX Companion for explanation.
196 %Type H <return> for immediate help.
200 %l.3 \renewcommand{\rubbish}
204 % Note that this has an extra line |! .| which does not appear in
205 % error messages that use the default settings with a current version of
206 % \TeX, but this should not cause any confusion we hope.
210 % \section{Initialisation}
211 % As this file is read at a very early stage, some definitions that
212 % are normally considered to be part of the format must be made here.
214 % \subsection{INITEX}
215 % \changes{v0.2i}{1994/01/25}
216 % {Protect against looping on \cs{@@input} and \cs{@@end}.}
220 %<initex>\ifnum\catcode`\{=1
221 %<initex> \errmessage
222 %<initex> {LaTeX must be made using an initex with no format preloaded}
227 % \changes{v1.1}{2015/01/03}{Enable extra primitives when Lua\TeX{} is used}
228 % \changes{v1.2}{2015/08/23}{Do not use luatex prefix}
229 % \changes{v1.2a}{2015/10/02}{Allow backing out of unprefixed names}
230 % If Lua\TeX{} is in use the extensions and other new primitives
231 % have to be activated: this is done as early as possible. Older
232 % versions of Lua\TeX{} do not hide the primitives: a version check is
233 % not needed as the version itself will be missing in the case where
236 \ifx\directlua\undefined
238 \ifx\luatexversion\undefined
240 % Enable e-TeX/pdfTeX/Umath primitives with their natural names
242 \directlua{tex.enableprimitives("",%
243 tex.extraprimitives('etex', 'pdftex', 'umath'))}
246 % In current formats enable primitives with unprefixed names.
247 % the \textsf{latexrelease} guards allow the primitives to be
248 % defined with a |\luatex| prefix if older formats are specified.
252 %<*initex,latexrelease>
253 %<latexrelease>\ifx\directlua\undefined\else
254 %<latexrelease>\IncludeInRelease{2015/10/01}{\luatexluafunction}
255 %<latexrelease> {LuaTeX (prefixed names)}%
256 \directlua{tex.enableprimitives("",%
257 tex.extraprimitives("omega", "aleph", "luatex"))}
258 %<latexrelease>\EndIncludeInRelease
259 %<latexrelease>\IncludeInRelease{0000/00/00}{\luatexluafunction}
260 %<latexrelease> {LuaTeX (prefixed names)}%
261 %<latexrelease>\directlua{
262 %<latexrelease> tex.enableprimitives(
263 %<latexrelease> "luatex",
264 %<latexrelease> tex.extraprimitives("core","omega", "aleph", "luatex")
266 %<latexrelease> local i
267 %<latexrelease> local t = { }
268 %<latexrelease> for _,i in pairs(tex.extraprimitives("luatex")) do
269 %<latexrelease> if not string.match(i,"^U") then
270 %<latexrelease> if not string.match(i, "^luatex") then
271 %<latexrelease> table.insert(t,i)
274 %<latexrelease> if string.match(i,"^Uchar$") then
275 %<latexrelease> table.insert(t,i)
279 %<latexrelease> for _,i in pairs(t) do
280 %<latexrelease> tex.print(
281 %<latexrelease> "\noexpand\\let\noexpand\\" .. i
282 %<latexrelease> .. "\noexpand\\undefined"
286 %<latexrelease>\EndIncludeInRelease
288 %</initex,latexrelease>
298 % That distraction over, back to the basics of a format.
305 \let\bgroup={ \let\egroup=}
306 \ifx\@@input\@undefined\let\@@input\input\fi
307 \ifx\@@end\@undefined\let\@@end\end\fi
308 \chardef\@inputcheck0
311 \def\typeout{\immediate\write17}
312 \def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&%
313 \do\#\do\^\do\_\do\%\do\~}
314 \def\@makeother#1{\catcode`#1=12\relax}
316 \def\@tempswafalse{\let\if@tempswa\iffalse}
317 \def\@tempswatrue{\let\if@tempswa\iftrue}
318 \let\if@tempswa\iffalse
319 \def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}%
320 \iterate \let\iterate\relax}
325 % \subsection{Some bits of 2e}
328 \def\two@digits#1{\ifnum#1<10 0\fi\number#1}
329 \long\def\@firstoftwo#1#2{#1}
330 \long\def\@secondoftwo#1#2{#2}
332 % \changes{v1.0e}{1994/05/11}
333 % {Add \cs{ProvidesFile} as used in fd files.}
334 % \changes{v1.0l}{1995/10/17}
335 % {Modify initex version of \cs{ProvidesFile}}
336 % \changes{v1.0n}{1995/11/01}
337 % {Initialise \cs{@addtofilelist} to \cs{@gobble}}
338 % This is a special version of |\ProvidesFile| for initex use.
339 % \changes{v1.0x}{2001/05/25}{Explicitly set catcode of
340 % \cs{endlinechar} to 10 (pr/3334)}
341 % \changes{v1.0y}{2001/06/04}{But only if it is a char (pr/3334)}
343 \def\ProvidesFile#1{%
346 \ifnum \endlinechar<256 %
347 \ifnum \endlinechar>\m@ne
348 \catcode\endlinechar 10 %
352 \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}}
353 \def\@providesfile#1[#2]{%
355 \@addtofilelist{ #2}%
357 \long\def\@addtofilelist#1{}
365 \let\@currdir\@undefined
366 \let\input@path\@undefined
367 \let\filename@parse\@undefined
369 % \begin{macro}{\strip@prefix}
370 % \changes{v0.2a}{1993/12/13}
371 % {modified, name changed from \cs{stripmeaning}.}
372 % \changes{v0.2e}{1994/01/19}
373 % {name changed from \cs{strip@meaning}, to match NFSS.}
375 \def\strip@prefix#1>{}
380 % \section{texsys.cfg}
381 % As mentioned above, any site specific definitions required to describe
382 % the filename handling must be entered into a file |texsys.cfg|. If
383 % |texsys.cfg| can not be located by |\openin|, we write a default
384 % version out. The default version only contains comments, so we do not
385 % actually input the file in that case. The automatic tests later will,
386 % hopefully, correctly define the required macros.
388 % The tricky code below checks to see if |texsys.cfg| exists. If it does
389 % not, all the text in this file between START and END is copied
390 % verbatim to a new file |texsys,cfg|. If |texsys.cfg| is found, then it
391 % is simply input. This is only done when this file is being used
397 \typeout{** Writing a default texsys.cfg}
398 \immediate\openout15=texsys.cfg
400 \catcode`\^^M\active%
402 \def\reserved@a#1^^M{%
404 \ifx\reserved@b\reserved@c\endgroup\else%
405 \immediate\write15{#1}%
406 \expandafter\reserved@a\fi}%
407 \def\reserved@d#1START^^M{\let\do\@makeother\dospecials\reserved@a}%
409 \def\reserved@c{%END}
413 % \subsection{texsys.cfg}
415 % This file contains the site specific definitions of the four macros\\
416 % |\@currdir|, |\input@path|, |\filename@parse| and |\@TeXversion|.
418 % As distributed it only contains comments, however this `empty'
419 % file will work on many systems because of the automatic tests built
420 % into |ltdirchk.dtx|. You \emph{are} allowed to edit this file to add
421 % definitions of these macros appropriate to your system.
424 % The macros that must be defined are:
426 % \DescribeMacro{\@currdir}
427 % |\@currdir|\meta{filename}\meta{space} should expand to a form of the
428 % filename that uniquely refers to the `current directory' if this is
429 % possible. (The expansion should also end with a space.) on UNIX,
430 % this is |\def\@currdir{./}|. For more exotic operating systems you may
431 % want to make |\@currdir| a macro with arguments delimited by |.|
432 % and/or \meta{space}. If the operating system has no concept of
433 % directory structure, this macro should be defined to be empty.
436 % \DescribeMacro{\input@path}
437 % If the primitive |\openin| searches the same directories as the
438 % primitive |\input|, then it is possible to tell (using |\ifeof|)
439 % whether a file exists before trying to input it. For systems like
440 % this, |\input@path| should be left undefined.
442 % If |\openin| does not `follow' |\input| then |\input@path| must be
443 % defined to be a list of directories to search for input files. The
444 % format for each directory is as for |\@currdir|, normally just a
445 % prefix is required, but it may be a macro with space-delimited
446 % argument. That is, if \meta{dir} is an entry in the input path,
447 % \TeX will try to load the expansion of
449 % \meta{dir}\meta{filename}\meta{space}
451 % So either \meta{dir} should be defined as a macro with argument
452 % delimited by space, or it should just expand to a directory name,
453 % including the final directory separator, so that it may be
454 % concatenated with the \meta{filename}. This means that for UNIX-like
455 % syntax, each \meta{dir} should end with a slash, |/|. One exception to
456 % this rule is that the input path should \emph{always} contain the
457 % empty directory |{}| as this will allow `full pathnames' to be used,
458 % and the `current directory' to be searched.
460 % |\input@path| should expand to a list of such directories, each in a
464 % \DescribeMacro{\filename@parse}
465 % After a call of the form: |\filename@parse{|\meta{filename}|}|, the
466 % three macros |\filename@area|,|\filename@base|,|\filename@ext| should
467 % be defined to be the `area' (or directory), basename and
468 % extension respectively. If there was no extension specified in
469 % \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
470 % case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
471 % default extension substituted).
473 % Normally one would not need to define this macro in |texsys.cfg| as
474 % the automatic tests can supply parsers that work with UNIX and VMS
475 % syntax, as well as a basic parser that willcover many other cases.
476 % However some operating systems may need a `hand produced' parser
477 % in which case it should be defined in this file.
479 % The UNIX parser also works for most MSDOS \TeX\ versions.
480 % Currently if the UNIX or VMS parser is not used, |\filename@parse| is
481 % defined to always return an empty area, and to split the argument into
482 % basename and extension at the first `|.|' that occurs in the name.
483 % Parsers for other formats may be defined in |texsys.cfg|,
484 % in which case they will be used in preference to the default
488 % \DescribeMacro{\@TeXversion}
489 % You should not need to set this macro in |texsys.cfg|. \LaTeX\
490 % tests to set this automatically. See the comments in the opening
491 % section of \texttt{ltdirchk.dtx}.
494 % The following sections give examples of definitions which might
495 % work on various systems. These are currently mainly untested as I only
496 % have access to a few systems, all of which do not need this file as
497 % the automatic tests work. All the code is commented out.
499 % \subsection{UNIX (web2c)}
500 % This implementation does make |\openin| and |\input| look in the same
501 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
502 % file may be empty. The definitions below are therefore just for
506 %\let\input@path\@undefined
509 % \subsection{UNIX (other)}
510 % Apparently some commercial UNIX implementations have different paths
511 % for |\openin| and |\input|. For these one could use definitions like
512 % the following (with whatever directories are used at your site):
513 % note that the directory names should end with |/|.
517 % {/usr/local/lib/tex/inputs/distrib/}%
518 % {/usr/local/lib/tex/inputs/contrib/}%
519 % {/usr/local/lib/tex/inputs/local/}%
523 % \subsection{MSDOS (emtex)}
524 % This implementation does make |\openin| and |\input| look in the same
525 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
526 % file may be empty. The definitions below are therefore just for
530 % \let\input@path\@undefined
533 % \subsection{MSDOS (other)}
534 % Some PC implementations have different paths
535 % for |\openin| and |\input|. For these one could use definitions like
536 % the following (with whatever directories are used at your site):
537 % note that the directory names should end with |/|.
538 % This assumes the implementation uses UNIX style |/| as the directory
543 % {c:/tex/inputs/distrib/}%
544 % {c:/tex/inputs/contrib/}%
545 % {c:/tex/inputs/local/}%
549 % \subsection{VMS (DECUS \TeX, PD VMS 3.6)}
550 % This implementation does make |\openin| and |\input| look in the same
551 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
552 % file may be empty. The definitions below are therefore just for
556 % \let\input@path\@undefined
559 % \subsection{VMS (???)}
560 % Some VMS implementations have different paths
561 % for |\openin| and |\input|. For these one could use definitions like
567 % {SOMEDISK:[SOME.TEX.DIRECTORY]}%
571 % \subsection{MACINTOSH (OzTeX 1.6)}
572 % This implementation does make |\openin| and |\input| look in the same
573 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
574 % file may be empty. The definitions below are therefore just for
578 % \let\input@path\@undefined
581 % \subsection{MACINTOSH (other)}
582 % Some Macintosh implementations have different paths
583 % for |\openin| and |\input|. For these one could use definitions like
584 % the following (with whatever folders are used on your machine):
585 % note that the directory names should end with |:|, and they should
586 % contain {\em no\/} spaces.
590 % {Hard-Disk:Applications:TeX:TeX-inputs:}%
591 % {Hard-Disk:Applications:TeX:My-inputs:}%
595 % \subsection{FAKE EXAMPLE}
596 % This example is for an operating system that has filenames of the
597 % form |<area>name| For maximum compatibility with macro sets,
598 % you want |name.ext| to be mapped to |<ext>name|.
599 % and |<area>name.ext| to be mapped to |<area.ext>name|.
600 % |\input| does this mapping automatically, but |\openin| does not, and
601 % does not look in the same places as |\input|.
602 % |<>name| is the desired `current directory' syntax.
604 % the following code would possibly work:
607 % \@d@r{#1}#2..\@nil}
608 % \def\@d@r#1#2.#3.#4\@nil{%
609 % <\ifx\@dir#1\@dir\else#1\ifx\@dir#3\@dir\else.\fi\fi#3>#2 }
611 % \def\@currdir{\@dir{}}
619 \immediate\closeout15
621 % If |texsys.cfg| did exist, then input it.
624 \typeout{** Using the existing texsys.cfg}
631 % If the stripped version of this file is being used (in latex2e.ltx)
632 % then texsys.cfg should be there, so just input it.
634 %<dircheck>\input texsys.cfg
637 % \changes{v0.2f}{1994/01/20}
638 % {\cs{@copytexsys} and the texsys.new file removed}
640 % \section{Setting \texttt{\cs{@currdir}}}
642 % \begin{macro}{\@currdir}
643 % \begin{macro}{\IfFileExists}
644 % \changes{v0.2e}{1994/01/19}
645 % {name changed from \cs{test}}
646 % This is a local definition of |\IfFileExists|. It tries to relocate
647 % |texsxys.aux|. If it succeeds, then the |\@currdir| syntax has been
648 % determined. If all the tests fail then |\@currdir| will be set to
649 % |\@empty|, and |ltxcheck| will warn of this when it checks the format.
656 \advance\count2 \time
659 % \begin{macro}{\today}
660 % The current date and time stamp.
661 % \changes{v0.2g}{1994/01/21}
662 % {Name changed from \cs{stamp}, to save memory}
665 \the\year/\two@digits{\the\month}/\two@digits{\the\day}:%
666 \two@digits{\the\count@}:\two@digits{\the\count2}}
670 % Create a file |texsys.aux| (hopefully in the current directory),
671 % then try to locate it again.
673 \immediate\openout15=texsys.aux
674 \immediate\write15{\today^^J}
675 \immediate\closeout15 %
678 % |#1| is the file to try, |#2| is what to do on success, |#3| on
681 \def\IfFileExists#1#2#3{%
682 \openin\@inputcheck#1 %
686 \read\@inputcheck to \reserved@a
687 \ifx\reserved@a\today
688 \typeout{#1 found}#2\relax
690 \typeout{BAD: old file \reserved@a (should be \today)}%
694 \closein\@inputcheck}
701 % If |\@currdir| has not been pre-defined in |texsys.cfg| then test for
702 % UNIX, VMS and Oz-\TeX-Mac. syntax.
703 % \changes{v0.2h}{1994/01/24}
704 % {Stop testing once texsys.aux has been found}
706 \ifx\@currdir\@undefined
707 \IfFileExists{./texsys.aux}{\gdef\@currdir{./}}%
708 {\IfFileExists{[]texsys.aux}{\gdef\@currdir{[]}}%
709 {\IfFileExists{:texsys.aux}{\gdef\@currdir{:}}{}}}
711 % If it is still undefined at this point, all the above tests failed.
712 % Earlier versions interactively prompted for a definition at this
713 % point, but it seems impossible to reliably obtain information from
714 % users at this point in the installation. This version of the file
715 % produces a format with no user-interaction. Later if the format is not
716 % suitable for the system, |texsys.cfg| may be edited and the format
718 % \changes{v0.2a}{1993/12/13}
719 % {Removed interactive prompting for current directory syntax}
720 % \changes{v0.2f}{1994/01/20}
721 % {\cs{@copytexsys} removed}
722 % \changes{v1.0u}{1996/12/06}
723 % {*** removed from various messages for GNU Make.
726 \ifx\@currdir\@undefined
727 \global\let\@currdir\@empty
729 !! No syntax for the current directory could be found^^J%
733 % Otherwise |\@currdir| was defined in |texsys.cfg|. In this case check
734 % that the syntax specified works on this system. (In case a complete
735 % \LaTeX\ system has been copied from one system to another.) If the
736 % test fails, give up. The installer should remove or correct the
737 % offending |texsys.cfg| and try again.
740 \IfFileExists{\@currdir texsys.aux}{}{%
741 \edef\reserved@a{\errhelp{%
742 texsys.cfg specifies the current directory syntax to be^^J%
743 \meaning\@currdir^^J%
744 but this does not work on this system.^^J%
745 Remove texsys.cfg and restart.}}\reserved@a
746 \errmessage{Bad texsys.cfg file: \noexpand\@currdir}\@@end}
748 % The version of |\@currdir| in |texsys.cfg| looks OK.
752 % \changes{v0.2d}{1994/01/14}
753 % {Close the texsys.aux output stream}
755 \immediate\closeout15 %
761 \noexpand\@currdir set to:
762 \expandafter\strip@prefix\meaning\@currdir.^^J%
769 % \changes{v0.2a}{1993/12/13}
770 % {on the `docstrip' pass, do not check openin path}
772 % Stop here if the file is being used unstripped.
779 % \section{Setting \texttt{\cs{input@path}}}
781 % Earlier versions of this file attempted to automatically test whether
782 % |\input@path| was required, and interactively prompt for a path if
783 % necessary. This was not found to be very reliable The first-time
784 % installer of \LaTeXe\ can not be expected to have enough information
785 % to supply the correct information to the prompts. Now the interaction
786 % is omitted. After the format is made the installer can attempt to run
787 % the test document |ltxcheck.tex| through \LaTeXe. This will check,
788 % amongst other things, whether |texsys.cfg| will need to be edited and
791 % \begin{macro}{\input@path}
792 % Now set up the |\input@path|.
794 % |\input@path| should either be undefined, or a list of directories as
795 % described in the introduction.
796 % \changes{v0.2e}{1994/01/19}
797 % {No longer check that an empty group is in the path}
800 Assuming \noexpand\openin and \noexpand\input^^J%
801 \ifx\input@path\@undefined
803 % |\input@path| has not been pre-defined.
805 have the same search path.^^J%
808 % |\input@path| has been defined in |texsys.cfg|.
810 have different search paths.^^J%
811 LaTeX will use the path specified by \noexpand\input@path:^^J%
817 % \section{Filename Parsing}
819 % \begin{macro}{\filename@parse}
820 % Split a filename into its components.
821 % \changes{v0.2g}{1994/01/21}
822 % {Minor changes, and add Mac version (:)}
824 \ifx\filename@parse\@undefined
825 \def\reserved@a{./}\ifx\@currdir\reserved@a
827 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
828 % looks like UNIX\ldots
830 \typeout{^^JDefining UNIX/DOS style filename parser.^^J}
831 \def\filename@parse#1{%
832 \let\filename@area\@empty
833 \expandafter\filename@path#1/\\}
836 % Search for the last |/|.
838 \def\filename@path#1/#2\\{%
840 \def\reserved@a{\filename@simple#1.\\}%
842 \edef\filename@area{\filename@area#1/}%
843 \def\reserved@a{\filename@path#2\\}%
849 \else\def\reserved@a{[]}\ifx\@currdir\reserved@a
851 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
852 % looks like VMS\ldots
854 \typeout{^^JDefining VMS style filename parser.^^J}
855 \def\filename@parse#1{%
856 \let\filename@area\@empty
857 \expandafter\filename@path#1]\\}
860 % Search for the last |]|.
862 \def\filename@path#1]#2\\{%
864 \def\reserved@a{\filename@simple#1.\\}%
866 \edef\filename@area{\filename@area#1]}%
867 \def\reserved@a{\filename@path#2\\}%
873 \else\def\reserved@a{:}\ifx\@currdir\reserved@a
875 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
876 % looks like Macintosh\ldots
878 \typeout{^^JDefining Mac style filename parser.^^J}
879 \def\filename@parse#1{%
880 \let\filename@area\@empty
881 \expandafter\filename@path#1:\\}
884 % Search for the last |:|.
885 % \changes{v1.0g}{1994/05/25}
886 % {Mac parser had " typo for :}
888 \def\filename@path#1:#2\\{%
890 \def\reserved@a{\filename@simple#1.\\}%
892 \edef\filename@area{\filename@area#1:}%
893 \def\reserved@a{\filename@path#2\\}%
901 % |\filename@parse| was not specified in |texsys.cfg|.
902 % So just make a simple parser that always sets |\filename@area| to
905 \typeout{^^JDefining generic filename parser.^^J}
906 \def\filename@parse#1{%
907 \let\filename@area\@empty
908 \expandafter\filename@simple#1.\\}
912 % |\filename@simple| is used by all three versions.
913 % Finally we can split off the extension.
915 \def\filename@simple#1.#2\\{%
917 \let\filename@ext\relax
919 \edef\filename@ext{\filename@dot#2\\}%
921 \edef\filename@base{#1}}
924 % Remove a final dot, added earlier.
926 \def\filename@dot#1.\\{#1}
932 % Otherwise, |\filename@parse| was specified in |texsys.cfg|.
935 \noexpand\filename@parse was defined in texsys.cfg:^^J%
936 \expandafter\strip@prefix\meaning\filename@parse.^^J%
942 % \section{\TeX\ Versions}
944 % \begin{macro}{\@TeXversion}
945 % \TeX\ versions older than than 3.141 require |\@TeXversion| to be
946 % set. This can be determined automatically due to a trick suggested
947 % by Bernd Raichle. (Actually this will not always get the correct
948 % version number, eg \TeX3.14 would be detected as \TeX3, but \LaTeX\
949 % only needs to take account of \TeX's older than 3, or between 3 and
951 % \changes{v1.0h}{1994/10/11}
952 % {Check for TeX3.14}
954 \ifx\@TeXversion\@undefined
955 \ifx\@undefined\inputlineno
958 {\catcode`\^^J=\active
959 \def\reserved@a#1#2\@@{\if#1\string^3\fi}
960 \edef\reserved@a{\expandafter\reserved@a\string^^J\@@}
961 \ifx\reserved@a\@empty\else\gdef\@TeXversion{3}\fi}
971 % \section{ltxcheck.tex}
972 % After the format has been made, and article.cls moved with the
973 % other files to the `standard input directory' as specified in
974 % |install.txt|, the format may be checked by running the file
976 % \changes{v0.2f}{1994/01/20}
977 % {Modify all of ltxcheck}
978 % \changes{v1.0h}{1994/10/11}
979 % {Modify all of ltxcheck again}
980 % \changes{v1.0t}{1996/09/25}
981 % {Move ltxcheck to separate file}