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/10/02 v1.2a 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 [2016/10/15 v1.2b 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.}
86 % \section{\LaTeX\ System Dependent Initialisations}
88 % \changes{v0.2g}{1994/01/21}
89 % {Improve documentation, reorganise docstrip module}
91 % This file implements the semi-automatic determination of various
92 % system dependent parts of the initialisation. The actual definitions
93 % may be placed in a file |texsys.cfg|. Thus for operating systems for
94 % which the tests here do not result in acceptable settings, a `hand
95 % written' |texsys.cfg| may be produced.
97 % The macros that must be defined are:
99 % \DescribeMacro{\@currdir}
100 % |\@currdir|\meta{filename}\meta{space} should expand to a form of the
101 % filename that uniquely refers to the `current directory' if this is
102 % possible. (The expansion should also end with a space.) on UNIX,
103 % this is |\def\@currdir{./}|. For more exotic operating systems you may
104 % want to make |\@currdir| a macro with arguments delimited by |.|
105 % and/or \meta{space}. If the operating system has no concept of
106 % directory structure, this macro should be defined to be empty.
109 % \DescribeMacro{\input@path}
110 % If the primitive |\openin| searches the same directories as the
111 % primitive |\input|, then it is possible to tell (using |\ifeof|)
112 % whether a file exists before trying to input it. For systems like
113 % this, |\input@path| should be left undefined.
115 % If |\openin| does not `follow' |\input| then |\input@path| must be
116 % defined to be a list of directories to search for input files. The
117 % format for each directory is as for |\@currdir|, normally just a
118 % prefix is required, but it may be a macro with space-delimited
119 % argument. That is, if \meta{dir} is an entry in the input path,
120 % \TeX\ will try to load the expansion of
121 % \meta{dir}\meta{filename}\meta{space}
123 % So either \meta{dir} should be defined as a macro with argument
124 % delimited by space, or it should just expand to a directory name,
125 % including the final directory separator, so that it may be
126 % concatenated with the \meta{filename}. This means that for UNIX-like
127 % syntax, each \meta{dir} should end with a slash, |/|.
129 % |\input@path| should expand to a list of such directories, each in a
132 % \DescribeMacro{\filename@parse}
133 % After a call of the form: |\filename@parse{|\meta{filename}|}|, the
134 % three macros |\filename@area|,|\filename@base|,|\filename@ext| should
135 % be defined to be the `area' (or directory), basename and
136 % extension respectively. If there was no extension specified in
137 % \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
138 % case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
139 % default extension substituted).
141 % Normally one would not need to define this macro in |texsys.cfg| as
142 % the automatic tests can supply parsers that work with UNIX and VMS and
143 % Macintosh syntax, as well as a basic parser that will cover many other
144 % cases. However some operating systems may need a `hand produced'
145 % parser in which case it should be defined in this file.
147 % The UNIX parser also works for most MSDOS \TeX\ versions.
148 % Currently if the UNIX, VMS or Macintosh parser is not used,
149 % |\filename@parse| is defined to always return an empty area, and to
150 % split the argument into basename and extension at the first `|.|'
151 % that occurs in the name.
152 % Parsers for other formats may be defined in |texsys.cfg|,
153 % in which case they will be used in preference to the default
156 % \DescribeMacro{\@TeXversion}
157 % \changes{v1.0f}{1994/05/23}{Document \cs{@TeXversion}}
158 % |\@TeXversion| is now set automatically by the initialisation tests
159 % in this file. You should not need to set it in |texsys.cfg|, however
160 % the following documentation is left for information. \LaTeX\ does
161 % not set this variable exactly, the automatic tests set it to:\\
162 % |2| for any version, $v$, $v < 3.0$\\
163 % |3| for any version, $v$, $3.0 \leq v \leq 3.14$\\
164 % \meta{undefined} otherwise.\\
165 % However these values are accurate enough for \LaTeX\ to take
166 % appropriate action for these old \TeX{}s.
168 % If your \TeX\ is older than version 3.141, then you should define
169 % |\@TeXversion| (using |\def|) to be the version number. If you do not
171 % {Actually if your \TeX\ is really old, version~2, \LaTeX\ can
172 % detect this, and sets \cs{@TeXversion} to~2 if it is not set in
173 % the \texttt{cfg} file.}
174 %, \LaTeX\ will not work around a bug in old \TeX\ versions, and
175 % so error messages will appear in a very strange format, with |^^J|
176 % appearing instead of line breaks:
177 % \begingroup\catcode`\==\active \def=#1#2{}\hfuzz\maxdimen
179 %! LaTeX Error: \rubbish undefined.^^J^^JSee the LaTeX manual or LaTeX=
181 % for explanation.^^JType H <return> for immediate help.
184 %l.3 \renewcommand{\rubbish}
189 % However if you put |\def\@TeXversion{3.14}| in \texttt{texsys.cfg}
190 % the following format will be used:
192 %! LaTeX Error: \rubbish undefined.
194 %See the LaTeX manual or LaTeX Companion for explanation.
195 %Type H <return> for immediate help.
199 %l.3 \renewcommand{\rubbish}
203 % Note that this has an extra line |! .| which does not appear in
204 % error messages that use the default settings with a current version of
205 % \TeX, but this should not cause any confusion we hope.
209 % \section{Initialisation}
210 % As this file is read at a very early stage, some definitions that
211 % are normally considered to be part of the format must be made here.
213 % \subsection{INITEX}
214 % \changes{v0.2i}{1994/01/25}
215 % {Protect against looping on \cs{@@input} and \cs{@@end}.}
219 %<initex>\ifnum\catcode`\{=1
220 %<initex> \errmessage
221 %<initex> {LaTeX must be made using an initex with no format preloaded}
226 % \changes{v1.1}{2015/01/03}{Enable extra primitives when Lua\TeX{} is used}
227 % \changes{v1.2}{2015/08/23}{Do not use luatex prefix}
228 % \changes{v1.2a}{2015/10/02}{Allow backing out of unprefixed names}
229 % If Lua\TeX{} is in use the extensions and other new primitives
230 % have to be activated: this is done as early as possible. Older
231 % versions of Lua\TeX{} do not hide the primitives: a version check is
232 % not needed as the version itself will be missing in the case where
235 \ifx\directlua\undefined
237 \ifx\luatexversion\undefined
239 % Enable e-TeX/pdfTeX/Umath primitives with their natural names
241 \directlua{tex.enableprimitives("",%
242 tex.extraprimitives('etex', 'pdftex', 'umath'))}
245 % In current formats enable primitives with unprefixed names.
246 % the \textsf{latexrelease} guards allow the primitives to be
247 % defined with a |\luatex| prefix if older formats are specified.
251 %<*initex,latexrelease>
252 %<latexrelease>\ifx\directlua\undefined\else
253 %<latexrelease>\IncludeInRelease{2015/10/01}{\luatexluafunction}
254 %<latexrelease> {LuaTeX (prefixed names)}%
255 \directlua{tex.enableprimitives("",%
256 tex.extraprimitives("omega", "aleph", "luatex"))}
257 %<latexrelease>\EndIncludeInRelease
258 %<latexrelease>\IncludeInRelease{0000/00/00}{\luatexluafunction}
259 %<latexrelease> {LuaTeX (prefixed names)}%
260 %<latexrelease>\directlua{
261 %<latexrelease> tex.enableprimitives(
262 %<latexrelease> "luatex",
263 %<latexrelease> tex.extraprimitives("core","omega", "aleph", "luatex")
265 %<latexrelease> local i
266 %<latexrelease> local t = { }
267 %<latexrelease> for _,i in pairs(tex.extraprimitives("luatex")) do
268 %<latexrelease> if not string.match(i,"^U") then
269 %<latexrelease> if not string.match(i, "^luatex") then
270 %<latexrelease> table.insert(t,i)
273 %<latexrelease> if string.match(i,"^Uchar$") then
274 %<latexrelease> table.insert(t,i)
278 %<latexrelease> for _,i in pairs(t) do
279 %<latexrelease> tex.print(
280 %<latexrelease> "\noexpand\\let\noexpand\\" .. i
281 %<latexrelease> .. "\noexpand\\undefined"
285 %<latexrelease>\EndIncludeInRelease
287 %</initex,latexrelease>
297 % \changes{v1.2b}{2016/10/15}{Require e\TeX{}}
298 % A test can now be made for e\TeX{}.
300 %<initex>\ifx\eTeXversion\undefined
301 %<initex> \errmessage
302 %<initex> {LaTeX requires e-TeX}
303 %<initex> \expandafter\endinput
307 % That distraction over, back to the basics of a format.
314 \let\bgroup={ \let\egroup=}
315 \ifx\@@input\@undefined\let\@@input\input\fi
316 \ifx\@@end\@undefined\let\@@end\end\fi
317 \chardef\@inputcheck0
320 \def\typeout{\immediate\write17}
321 \def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&%
322 \do\#\do\^\do\_\do\%\do\~}
323 \def\@makeother#1{\catcode`#1=12\relax}
325 \def\@tempswafalse{\let\if@tempswa\iffalse}
326 \def\@tempswatrue{\let\if@tempswa\iftrue}
327 \let\if@tempswa\iffalse
328 \def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}%
329 \iterate \let\iterate\relax}
334 % \subsection{Some bits of 2e}
337 \def\two@digits#1{\ifnum#1<10 0\fi\number#1}
338 \long\def\@firstoftwo#1#2{#1}
339 \long\def\@secondoftwo#1#2{#2}
341 % \changes{v1.0e}{1994/05/11}
342 % {Add \cs{ProvidesFile} as used in fd files.}
343 % \changes{v1.0l}{1995/10/17}
344 % {Modify initex version of \cs{ProvidesFile}}
345 % \changes{v1.0n}{1995/11/01}
346 % {Initialise \cs{@addtofilelist} to \cs{@gobble}}
347 % This is a special version of |\ProvidesFile| for initex use.
348 % \changes{v1.0x}{2001/05/25}{Explicitly set catcode of
349 % \cs{endlinechar} to 10 (pr/3334)}
350 % \changes{v1.0y}{2001/06/04}{But only if it is a char (pr/3334)}
352 \def\ProvidesFile#1{%
355 \ifnum \endlinechar<256 %
356 \ifnum \endlinechar>\m@ne
357 \catcode\endlinechar 10 %
361 \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}}
362 \def\@providesfile#1[#2]{%
364 \@addtofilelist{ #2}%
366 \long\def\@addtofilelist#1{}
374 \let\@currdir\@undefined
375 \let\input@path\@undefined
376 \let\filename@parse\@undefined
378 % \begin{macro}{\strip@prefix}
379 % \changes{v0.2a}{1993/12/13}
380 % {modified, name changed from \cs{stripmeaning}.}
381 % \changes{v0.2e}{1994/01/19}
382 % {name changed from \cs{strip@meaning}, to match NFSS.}
384 \def\strip@prefix#1>{}
389 % \section{texsys.cfg}
390 % As mentioned above, any site specific definitions required to describe
391 % the filename handling must be entered into a file |texsys.cfg|. If
392 % |texsys.cfg| can not be located by |\openin|, we write a default
393 % version out. The default version only contains comments, so we do not
394 % actually input the file in that case. The automatic tests later will,
395 % hopefully, correctly define the required macros.
397 % The tricky code below checks to see if |texsys.cfg| exists. If it does
398 % not, all the text in this file between START and END is copied
399 % verbatim to a new file |texsys,cfg|. If |texsys.cfg| is found, then it
400 % is simply input. This is only done when this file is being used
406 \typeout{** Writing a default texsys.cfg}
407 \immediate\openout15=texsys.cfg
409 \catcode`\^^M\active%
411 \def\reserved@a#1^^M{%
413 \ifx\reserved@b\reserved@c\endgroup\else%
414 \immediate\write15{#1}%
415 \expandafter\reserved@a\fi}%
416 \def\reserved@d#1START^^M{\let\do\@makeother\dospecials\reserved@a}%
418 \def\reserved@c{%END}
422 % \subsection{texsys.cfg}
424 % This file contains the site specific definitions of the four macros\\
425 % |\@currdir|, |\input@path|, |\filename@parse| and |\@TeXversion|.
427 % As distributed it only contains comments, however this `empty'
428 % file will work on many systems because of the automatic tests built
429 % into |ltdirchk.dtx|. You \emph{are} allowed to edit this file to add
430 % definitions of these macros appropriate to your system.
433 % The macros that must be defined are:
435 % \DescribeMacro{\@currdir}
436 % |\@currdir|\meta{filename}\meta{space} should expand to a form of the
437 % filename that uniquely refers to the `current directory' if this is
438 % possible. (The expansion should also end with a space.) on UNIX,
439 % this is |\def\@currdir{./}|. For more exotic operating systems you may
440 % want to make |\@currdir| a macro with arguments delimited by |.|
441 % and/or \meta{space}. If the operating system has no concept of
442 % directory structure, this macro should be defined to be empty.
445 % \DescribeMacro{\input@path}
446 % If the primitive |\openin| searches the same directories as the
447 % primitive |\input|, then it is possible to tell (using |\ifeof|)
448 % whether a file exists before trying to input it. For systems like
449 % this, |\input@path| should be left undefined.
451 % If |\openin| does not `follow' |\input| then |\input@path| must be
452 % defined to be a list of directories to search for input files. The
453 % format for each directory is as for |\@currdir|, normally just a
454 % prefix is required, but it may be a macro with space-delimited
455 % argument. That is, if \meta{dir} is an entry in the input path,
456 % \TeX will try to load the expansion of
458 % \meta{dir}\meta{filename}\meta{space}
460 % So either \meta{dir} should be defined as a macro with argument
461 % delimited by space, or it should just expand to a directory name,
462 % including the final directory separator, so that it may be
463 % concatenated with the \meta{filename}. This means that for UNIX-like
464 % syntax, each \meta{dir} should end with a slash, |/|. One exception to
465 % this rule is that the input path should \emph{always} contain the
466 % empty directory |{}| as this will allow `full pathnames' to be used,
467 % and the `current directory' to be searched.
469 % |\input@path| should expand to a list of such directories, each in a
473 % \DescribeMacro{\filename@parse}
474 % After a call of the form: |\filename@parse{|\meta{filename}|}|, the
475 % three macros |\filename@area|,|\filename@base|,|\filename@ext| should
476 % be defined to be the `area' (or directory), basename and
477 % extension respectively. If there was no extension specified in
478 % \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
479 % case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
480 % default extension substituted).
482 % Normally one would not need to define this macro in |texsys.cfg| as
483 % the automatic tests can supply parsers that work with UNIX and VMS
484 % syntax, as well as a basic parser that willcover many other cases.
485 % However some operating systems may need a `hand produced' parser
486 % in which case it should be defined in this file.
488 % The UNIX parser also works for most MSDOS \TeX\ versions.
489 % Currently if the UNIX or VMS parser is not used, |\filename@parse| is
490 % defined to always return an empty area, and to split the argument into
491 % basename and extension at the first `|.|' that occurs in the name.
492 % Parsers for other formats may be defined in |texsys.cfg|,
493 % in which case they will be used in preference to the default
497 % \DescribeMacro{\@TeXversion}
498 % You should not need to set this macro in |texsys.cfg|. \LaTeX\
499 % tests to set this automatically. See the comments in the opening
500 % section of \texttt{ltdirchk.dtx}.
503 % The following sections give examples of definitions which might
504 % work on various systems. These are currently mainly untested as I only
505 % have access to a few systems, all of which do not need this file as
506 % the automatic tests work. All the code is commented out.
508 % \subsection{UNIX (web2c)}
509 % This implementation does make |\openin| and |\input| look in the same
510 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
511 % file may be empty. The definitions below are therefore just for
515 %\let\input@path\@undefined
518 % \subsection{UNIX (other)}
519 % Apparently some commercial UNIX implementations have different paths
520 % for |\openin| and |\input|. For these one could use definitions like
521 % the following (with whatever directories are used at your site):
522 % note that the directory names should end with |/|.
526 % {/usr/local/lib/tex/inputs/distrib/}%
527 % {/usr/local/lib/tex/inputs/contrib/}%
528 % {/usr/local/lib/tex/inputs/local/}%
532 % \subsection{MSDOS (emtex)}
533 % This implementation does make |\openin| and |\input| look in the same
534 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
535 % file may be empty. The definitions below are therefore just for
539 % \let\input@path\@undefined
542 % \subsection{MSDOS (other)}
543 % Some PC implementations have different paths
544 % for |\openin| and |\input|. For these one could use definitions like
545 % the following (with whatever directories are used at your site):
546 % note that the directory names should end with |/|.
547 % This assumes the implementation uses UNIX style |/| as the directory
552 % {c:/tex/inputs/distrib/}%
553 % {c:/tex/inputs/contrib/}%
554 % {c:/tex/inputs/local/}%
558 % \subsection{VMS (DECUS \TeX, PD VMS 3.6)}
559 % This implementation does make |\openin| and |\input| look in the same
560 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
561 % file may be empty. The definitions below are therefore just for
565 % \let\input@path\@undefined
568 % \subsection{VMS (???)}
569 % Some VMS implementations have different paths
570 % for |\openin| and |\input|. For these one could use definitions like
576 % {SOMEDISK:[SOME.TEX.DIRECTORY]}%
580 % \subsection{MACINTOSH (OzTeX 1.6)}
581 % This implementation does make |\openin| and |\input| look in the same
582 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
583 % file may be empty. The definitions below are therefore just for
587 % \let\input@path\@undefined
590 % \subsection{MACINTOSH (other)}
591 % Some Macintosh implementations have different paths
592 % for |\openin| and |\input|. For these one could use definitions like
593 % the following (with whatever folders are used on your machine):
594 % note that the directory names should end with |:|, and they should
595 % contain {\em no\/} spaces.
599 % {Hard-Disk:Applications:TeX:TeX-inputs:}%
600 % {Hard-Disk:Applications:TeX:My-inputs:}%
604 % \subsection{FAKE EXAMPLE}
605 % This example is for an operating system that has filenames of the
606 % form |<area>name| For maximum compatibility with macro sets,
607 % you want |name.ext| to be mapped to |<ext>name|.
608 % and |<area>name.ext| to be mapped to |<area.ext>name|.
609 % |\input| does this mapping automatically, but |\openin| does not, and
610 % does not look in the same places as |\input|.
611 % |<>name| is the desired `current directory' syntax.
613 % the following code would possibly work:
616 % \@d@r{#1}#2..\@nil}
617 % \def\@d@r#1#2.#3.#4\@nil{%
618 % <\ifx\@dir#1\@dir\else#1\ifx\@dir#3\@dir\else.\fi\fi#3>#2 }
620 % \def\@currdir{\@dir{}}
628 \immediate\closeout15
630 % If |texsys.cfg| did exist, then input it.
633 \typeout{** Using the existing texsys.cfg}
640 % If the stripped version of this file is being used (in latex2e.ltx)
641 % then texsys.cfg should be there, so just input it.
643 %<dircheck>\input texsys.cfg
646 % \changes{v0.2f}{1994/01/20}
647 % {\cs{@copytexsys} and the texsys.new file removed}
649 % \section{Setting \texttt{\cs{@currdir}}}
651 % \begin{macro}{\@currdir}
652 % \begin{macro}{\IfFileExists}
653 % \changes{v0.2e}{1994/01/19}
654 % {name changed from \cs{test}}
655 % This is a local definition of |\IfFileExists|. It tries to relocate
656 % |texsxys.aux|. If it succeeds, then the |\@currdir| syntax has been
657 % determined. If all the tests fail then |\@currdir| will be set to
658 % |\@empty|, and |ltxcheck| will warn of this when it checks the format.
665 \advance\count2 \time
668 % \begin{macro}{\today}
669 % The current date and time stamp.
670 % \changes{v0.2g}{1994/01/21}
671 % {Name changed from \cs{stamp}, to save memory}
674 \the\year/\two@digits{\the\month}/\two@digits{\the\day}:%
675 \two@digits{\the\count@}:\two@digits{\the\count2}}
679 % Create a file |texsys.aux| (hopefully in the current directory),
680 % then try to locate it again.
682 \immediate\openout15=texsys.aux
683 \immediate\write15{\today^^J}
684 \immediate\closeout15 %
687 % |#1| is the file to try, |#2| is what to do on success, |#3| on
690 \def\IfFileExists#1#2#3{%
691 \openin\@inputcheck#1 %
695 \read\@inputcheck to \reserved@a
696 \ifx\reserved@a\today
697 \typeout{#1 found}#2\relax
699 \typeout{BAD: old file \reserved@a (should be \today)}%
703 \closein\@inputcheck}
710 % If |\@currdir| has not been pre-defined in |texsys.cfg| then test for
711 % UNIX, VMS and Oz-\TeX-Mac. syntax.
712 % \changes{v0.2h}{1994/01/24}
713 % {Stop testing once texsys.aux has been found}
715 \ifx\@currdir\@undefined
716 \IfFileExists{./texsys.aux}{\gdef\@currdir{./}}%
717 {\IfFileExists{[]texsys.aux}{\gdef\@currdir{[]}}%
718 {\IfFileExists{:texsys.aux}{\gdef\@currdir{:}}{}}}
720 % If it is still undefined at this point, all the above tests failed.
721 % Earlier versions interactively prompted for a definition at this
722 % point, but it seems impossible to reliably obtain information from
723 % users at this point in the installation. This version of the file
724 % produces a format with no user-interaction. Later if the format is not
725 % suitable for the system, |texsys.cfg| may be edited and the format
727 % \changes{v0.2a}{1993/12/13}
728 % {Removed interactive prompting for current directory syntax}
729 % \changes{v0.2f}{1994/01/20}
730 % {\cs{@copytexsys} removed}
731 % \changes{v1.0u}{1996/12/06}
732 % {*** removed from various messages for GNU Make.
735 \ifx\@currdir\@undefined
736 \global\let\@currdir\@empty
738 !! No syntax for the current directory could be found^^J%
742 % Otherwise |\@currdir| was defined in |texsys.cfg|. In this case check
743 % that the syntax specified works on this system. (In case a complete
744 % \LaTeX\ system has been copied from one system to another.) If the
745 % test fails, give up. The installer should remove or correct the
746 % offending |texsys.cfg| and try again.
749 \IfFileExists{\@currdir texsys.aux}{}{%
750 \edef\reserved@a{\errhelp{%
751 texsys.cfg specifies the current directory syntax to be^^J%
752 \meaning\@currdir^^J%
753 but this does not work on this system.^^J%
754 Remove texsys.cfg and restart.}}\reserved@a
755 \errmessage{Bad texsys.cfg file: \noexpand\@currdir}\@@end}
757 % The version of |\@currdir| in |texsys.cfg| looks OK.
761 % \changes{v0.2d}{1994/01/14}
762 % {Close the texsys.aux output stream}
764 \immediate\closeout15 %
770 \noexpand\@currdir set to:
771 \expandafter\strip@prefix\meaning\@currdir.^^J%
778 % \changes{v0.2a}{1993/12/13}
779 % {on the `docstrip' pass, do not check openin path}
781 % Stop here if the file is being used unstripped.
788 % \section{Setting \texttt{\cs{input@path}}}
790 % Earlier versions of this file attempted to automatically test whether
791 % |\input@path| was required, and interactively prompt for a path if
792 % necessary. This was not found to be very reliable The first-time
793 % installer of \LaTeXe\ can not be expected to have enough information
794 % to supply the correct information to the prompts. Now the interaction
795 % is omitted. After the format is made the installer can attempt to run
796 % the test document |ltxcheck.tex| through \LaTeXe. This will check,
797 % amongst other things, whether |texsys.cfg| will need to be edited and
800 % \begin{macro}{\input@path}
801 % Now set up the |\input@path|.
803 % |\input@path| should either be undefined, or a list of directories as
804 % described in the introduction.
805 % \changes{v0.2e}{1994/01/19}
806 % {No longer check that an empty group is in the path}
809 Assuming \noexpand\openin and \noexpand\input^^J%
810 \ifx\input@path\@undefined
812 % |\input@path| has not been pre-defined.
814 have the same search path.^^J%
817 % |\input@path| has been defined in |texsys.cfg|.
819 have different search paths.^^J%
820 LaTeX will use the path specified by \noexpand\input@path:^^J%
826 % \section{Filename Parsing}
828 % \begin{macro}{\filename@parse}
829 % Split a filename into its components.
830 % \changes{v0.2g}{1994/01/21}
831 % {Minor changes, and add Mac version (:)}
833 \ifx\filename@parse\@undefined
834 \def\reserved@a{./}\ifx\@currdir\reserved@a
836 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
837 % looks like UNIX\ldots
839 \typeout{^^JDefining UNIX/DOS style filename parser.^^J}
840 \def\filename@parse#1{%
841 \let\filename@area\@empty
842 \expandafter\filename@path#1/\\}
845 % Search for the last |/|.
847 \def\filename@path#1/#2\\{%
849 \def\reserved@a{\filename@simple#1.\\}%
851 \edef\filename@area{\filename@area#1/}%
852 \def\reserved@a{\filename@path#2\\}%
858 \else\def\reserved@a{[]}\ifx\@currdir\reserved@a
860 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
861 % looks like VMS\ldots
863 \typeout{^^JDefining VMS style filename parser.^^J}
864 \def\filename@parse#1{%
865 \let\filename@area\@empty
866 \expandafter\filename@path#1]\\}
869 % Search for the last |]|.
871 \def\filename@path#1]#2\\{%
873 \def\reserved@a{\filename@simple#1.\\}%
875 \edef\filename@area{\filename@area#1]}%
876 \def\reserved@a{\filename@path#2\\}%
882 \else\def\reserved@a{:}\ifx\@currdir\reserved@a
884 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
885 % looks like Macintosh\ldots
887 \typeout{^^JDefining Mac style filename parser.^^J}
888 \def\filename@parse#1{%
889 \let\filename@area\@empty
890 \expandafter\filename@path#1:\\}
893 % Search for the last |:|.
894 % \changes{v1.0g}{1994/05/25}
895 % {Mac parser had " typo for :}
897 \def\filename@path#1:#2\\{%
899 \def\reserved@a{\filename@simple#1.\\}%
901 \edef\filename@area{\filename@area#1:}%
902 \def\reserved@a{\filename@path#2\\}%
910 % |\filename@parse| was not specified in |texsys.cfg|.
911 % So just make a simple parser that always sets |\filename@area| to
914 \typeout{^^JDefining generic filename parser.^^J}
915 \def\filename@parse#1{%
916 \let\filename@area\@empty
917 \expandafter\filename@simple#1.\\}
921 % |\filename@simple| is used by all three versions.
922 % Finally we can split off the extension.
924 \def\filename@simple#1.#2\\{%
926 \let\filename@ext\relax
928 \edef\filename@ext{\filename@dot#2\\}%
930 \edef\filename@base{#1}}
933 % Remove a final dot, added earlier.
935 \def\filename@dot#1.\\{#1}
941 % Otherwise, |\filename@parse| was specified in |texsys.cfg|.
944 \noexpand\filename@parse was defined in texsys.cfg:^^J%
945 \expandafter\strip@prefix\meaning\filename@parse.^^J%
951 % \section{\TeX\ Versions}
953 % \begin{macro}{\@TeXversion}
954 % \TeX\ versions older than than 3.141 require |\@TeXversion| to be
955 % set. This can be determined automatically due to a trick suggested
956 % by Bernd Raichle. (Actually this will not always get the correct
957 % version number, eg \TeX3.14 would be detected as \TeX3, but \LaTeX\
958 % only needs to take account of \TeX's older than 3, or between 3 and
960 % \changes{v1.0h}{1994/10/11}
961 % {Check for TeX3.14}
963 \ifx\@TeXversion\@undefined
964 \ifx\@undefined\inputlineno
967 {\catcode`\^^J=\active
968 \def\reserved@a#1#2\@@{\if#1\string^3\fi}
969 \edef\reserved@a{\expandafter\reserved@a\string^^J\@@}
970 \ifx\reserved@a\@empty\else\gdef\@TeXversion{3}\fi}
980 % \section{ltxcheck.tex}
981 % After the format has been made, and article.cls moved with the
982 % other files to the `standard input directory' as specified in
983 % |install.txt|, the format may be checked by running the file
985 % \changes{v0.2f}{1994/01/20}
986 % {Modify all of ltxcheck}
987 % \changes{v1.0h}{1994/10/11}
988 % {Modify all of ltxcheck again}
989 % \changes{v1.0t}{1996/09/25}
990 % {Move ltxcheck to separate file}