1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
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 % [2001/06/04 v1.0y 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 [2001/06/04 v1.0y 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}
61 % \changes{v0.2j}{1994/02/25}
62 % {Remove need for drv file}
63 % \changes{v0.2k}{1994/03/01}
64 % {Add unstripped module,
65 % so that dircheck.dtx may be used with initex}
66 % \changes{v1.0a}{1994/03/08}
67 % {Reorganise driver module into `new style'}
68 % \changes{v1.0b}{1994/03/12}
69 % {Change name from dircheck.dtx}
70 % \changes{v1.0b}{1994/03/12}
71 % {Minor edits to the typeouts in ltxcheck}
72 % \changes{v1.0d}{1994/03/28}
73 % {Improve documentation}
74 % \changes{v1.0i}{1994/11/03}
75 % {Generate an error if latex.ltx not used with clean initex}
76 % \changes{v1.0j}{1994/11/17}
77 % {\cs{@tempa} to \cs{reserved@a}}
78 % \changes{v1.0r}{1996/06/13}
79 % {documentation improvements mainly from internal/2174}
80 % \changes{v1.0v}{1997/06/16}
81 % {documentation improvements mainly from internal/2520}
82 % \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}
230 \let\bgroup={ \let\egroup=}
231 \ifx\@@input\@undefined\let\@@input\input\fi
232 \ifx\@@end\@undefined\let\@@end\end\fi
233 \chardef\@inputcheck0
236 \def\typeout{\immediate\write17}
237 \def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&%
238 \do\#\do\^\do\_\do\%\do\~}
239 \def\@makeother#1{\catcode`#1=12\relax}
241 \def\@tempswafalse{\let\if@tempswa\iffalse}
242 \def\@tempswatrue{\let\if@tempswa\iftrue}
243 \let\if@tempswa\iffalse
244 \def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}%
245 \iterate \let\iterate\relax}
250 % \subsection{Some bits of 2e}
253 \def\two@digits#1{\ifnum#1<10 0\fi\number#1}
254 \long\def\@firstoftwo#1#2{#1}
255 \long\def\@secondoftwo#1#2{#2}
257 % \changes{v1.0e}{1994/05/11}
258 % {Add \cs{ProvidesFile} as used in fd files.}
259 % \changes{v1.0l}{1995/10/17}
260 % {Modify initex version of \cs{ProvidesFile}}
261 % \changes{v1.0n}{1995/11/01}
262 % {Initialise \cs{@addtofilelist} to \cs{@gobble}}
263 % This is a special version of |\ProvidesFile| for initex use.
264 % \changes{v1.0x}{2001/05/25}{Explicitly set catcode of
265 % \cs{endlinechar} to 10 (pr/3334)}
266 % \changes{v1.0y}{2001/06/04}{But only if it is a char (pr/3334)}
268 \def\ProvidesFile#1{%
271 \ifnum \endlinechar<256 %
272 \ifnum \endlinechar>\m@ne
273 \catcode\endlinechar 10 %
277 \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}}
278 \def\@providesfile#1[#2]{%
280 \@addtofilelist{ #2}%
282 \long\def\@addtofilelist#1{}
290 \let\@currdir\@undefined
291 \let\input@path\@undefined
292 \let\filename@parse\@undefined
294 % \begin{macro}{\strip@prefix}
295 % \changes{v0.2a}{1993/12/13}
296 % {modified, name changed from \cs{stripmeaning}.}
297 % \changes{v0.2e}{1994/01/19}
298 % {name changed from \cs{strip@meaning}, to match NFSS.}
300 \def\strip@prefix#1>{}
305 % \section{texsys.cfg}
306 % As mentioned above, any site specific definitions required to describe
307 % the filename handling must be entered into a file |texsys.cfg|. If
308 % |texsys.cfg| can not be located by |\openin|, we write a default
309 % version out. The default version only contains comments, so we do not
310 % actually input the file in that case. The automatic tests later will,
311 % hopefully, correctly define the required macros.
313 % The tricky code below checks to see if |texsys.cfg| exists. If it does
314 % not, all the text in this file between START and END is copied
315 % verbatim to a new file |texsys,cfg|. If |texsys.cfg| is found, then it
316 % is simply input. This is only done when this file is being used
322 \typeout{** Writing a default texsys.cfg}
323 \immediate\openout15=texsys.cfg
325 \catcode`\^^M\active%
327 \def\reserved@a#1^^M{%
329 \ifx\reserved@b\reserved@c\endgroup\else%
330 \immediate\write15{#1}%
331 \expandafter\reserved@a\fi}%
332 \def\reserved@d#1START^^M{\let\do\@makeother\dospecials\reserved@a}%
334 \def\reserved@c{%END}
338 % \subsection{texsys.cfg}
340 % This file contains the site specific definitions of the four macros\\
341 % |\@currdir|, |\input@path|, |\filename@parse| and |\@TeXversion|.
343 % As distributed it only contains comments, however this `empty'
344 % file will work on many systems because of the automatic tests built
345 % into |ltdirchk.dtx|. You \emph{are} allowed to edit this file to add
346 % definitions of these macros appropriate to your system.
349 % The macros that must be defined are:
351 % \DescribeMacro{\@currdir}
352 % |\@currdir|\meta{filename}\meta{space} should expand to a form of the
353 % filename that uniquely refers to the `current directory' if this is
354 % possible. (The expansion should also end with a space.) on UNIX,
355 % this is |\def\@currdir{./}|. For more exotic operating systems you may
356 % want to make |\@currdir| a macro with arguments delimited by |.|
357 % and/or \meta{space}. If the operating system has no concept of
358 % directory structure, this macro should be defined to be empty.
361 % \DescribeMacro{\input@path}
362 % If the primitive |\openin| searches the same directories as the
363 % primitive |\input|, then it is possible to tell (using |\ifeof|)
364 % whether a file exists before trying to input it. For systems like
365 % this, |\input@path| should be left undefined.
367 % If |\openin| does not `follow' |\input| then |\input@path| must be
368 % defined to be a list of directories to search for input files. The
369 % format for each directory is as for |\@currdir|, normally just a
370 % prefix is required, but it may be a macro with space-delimited
371 % argument. That is, if \meta{dir} is an entry in the input path,
372 % \TeX will try to load the expansion of
374 % \meta{dir}\meta{filename}\meta{space}
376 % So either \meta{dir} should be defined as a macro with argument
377 % delimited by space, or it should just expand to a directory name,
378 % including the final directory separator, so that it may be
379 % concatenated with the \meta{filename}. This means that for UNIX-like
380 % syntax, each \meta{dir} should end with a slash, |/|. One exception to
381 % this rule is that the input path should \emph{always} contain the
382 % empty directory |{}| as this will allow `full pathnames' to be used,
383 % and the `current directory' to be searched.
385 % |\input@path| should expand to a list of such directories, each in a
389 % \DescribeMacro{\filename@parse}
390 % After a call of the form: |\filename@parse{|\meta{filename}|}|, the
391 % three macros |\filename@area|,|\filename@base|,|\filename@ext| should
392 % be defined to be the `area' (or directory), basename and
393 % extension respectively. If there was no extension specified in
394 % \meta{filename}, |\filename@ext| should be |\let| to |\relax| (so this
395 % case may be tested with |\@ifundefined{filename@ext}| and, perhaps a
396 % default extension substituted).
398 % Normally one would not need to define this macro in |texsys.cfg| as
399 % the automatic tests can supply parsers that work with UNIX and VMS
400 % syntax, as well as a basic parser that willcover many other cases.
401 % However some operating systems may need a `hand produced' parser
402 % in which case it should be defined in this file.
404 % The UNIX parser also works for most MSDOS \TeX\ versions.
405 % Currently if the UNIX or VMS parser is not used, |\filename@parse| is
406 % defined to always return an empty area, and to split the argument into
407 % basename and extension at the first `|.|' that occurs in the name.
408 % Parsers for other formats may be defined in |texsys.cfg|,
409 % in which case they will be used in preference to the default
413 % \DescribeMacro{\@TeXversion}
414 % You should not need to set this macro in |texsys.cfg|. \LaTeX\
415 % tests to set this automatically. See the comments in the opening
416 % section of \texttt{ltdirchk.dtx}.
419 % The following sections give examples of definitions which might
420 % work on various systems. These are currently mainly untested as I only
421 % have access to a few systems, all of which do not need this file as
422 % the automatic tests work. All the code is commented out.
424 % \subsection{UNIX (web2c)}
425 % This implementation does make |\openin| and |\input| look in the same
426 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
427 % file may be empty. The definitions below are therefore just for
431 %\let\input@path\@undefined
434 % \subsection{UNIX (other)}
435 % Apparently some commercial UNIX implementations have different paths
436 % for |\openin| and |\input|. For these one could use definitions like
437 % the following (with whatever directories are used at your site):
438 % note that the directory names should end with |/|.
442 % {/usr/local/lib/tex/inputs/distrib/}%
443 % {/usr/local/lib/tex/inputs/contrib/}%
444 % {/usr/local/lib/tex/inputs/local/}%
448 % \subsection{MSDOS (emtex)}
449 % This implementation does make |\openin| and |\input| look in the same
450 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
451 % file may be empty. The definitions below are therefore just for
455 % \let\input@path\@undefined
458 % \subsection{MSDOS (other)}
459 % Some PC implementations have different paths
460 % for |\openin| and |\input|. For these one could use definitions like
461 % the following (with whatever directories are used at your site):
462 % note that the directory names should end with |/|.
463 % This assumes the implementation uses UNIX style |/| as the directory
468 % {c:/tex/inputs/distrib/}%
469 % {c:/tex/inputs/contrib/}%
470 % {c:/tex/inputs/local/}%
474 % \subsection{VMS (DECUS \TeX, PD VMS 3.6)}
475 % This implementation does make |\openin| and |\input| look in the same
476 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
477 % file may be empty. The definitions below are therefore just for
481 % \let\input@path\@undefined
484 % \subsection{VMS (???)}
485 % Some VMS implementations have different paths
486 % for |\openin| and |\input|. For these one could use definitions like
492 % {SOMEDISK:[SOME.TEX.DIRECTORY]}%
496 % \subsection{MACINTOSH (OzTeX 1.6)}
497 % This implementation does make |\openin| and |\input| look in the same
498 % places. Acceptable settings are made by |ltdirchk.dtx|, and so this
499 % file may be empty. The definitions below are therefore just for
503 % \let\input@path\@undefined
506 % \subsection{MACINTOSH (other)}
507 % Some Macintosh implementations have different paths
508 % for |\openin| and |\input|. For these one could use definitions like
509 % the following (with whatever folders are used on your machine):
510 % note that the directory names should end with |:|, and they should
511 % contain {\em no\/} spaces.
515 % {Hard-Disk:Applications:TeX:TeX-inputs:}%
516 % {Hard-Disk:Applications:TeX:My-inputs:}%
520 % \subsection{FAKE EXAMPLE}
521 % This example is for an operating system that has filenames of the
522 % form |<area>name| For maximum compatability with macro sets,
523 % you want |name.ext| to be mapped to |<ext>name|.
524 % and |<area>name.ext| to be mapped to |<area.ext>name|.
525 % |\input| does this mapping automatically, but |\openin| does not, and
526 % does not look in the same places as |\input|.
527 % |<>name| is the desired `current directory' syntax.
529 % the following code would possibly work:
532 % \@d@r{#1}#2..\@nil}
533 % \def\@d@r#1#2.#3.#4\@nil{%
534 % <\ifx\@dir#1\@dir\else#1\ifx\@dir#3\@dir\else.\fi\fi#3>#2 }
536 % \def\@currdir{\@dir{}}
544 \immediate\closeout15
546 % If |texsys.cfg| did exist, then input it.
549 \typeout{** Using the existing texsys.cfg}
556 % If the stripped version of this file is being used (in latex2e.ltx)
557 % then texsys.cfg should be there, so just input it.
559 %<dircheck>\input texsys.cfg
562 % \changes{v0.2f}{1994/01/20}
563 % {\cs{@copytexsys} and the texsys.new file removed}
565 % \section{Setting \texttt{\cs{@currdir}}}
567 % \begin{macro}{\@currdir}
568 % \begin{macro}{\IfFileExists}
569 % \changes{v0.2e}{1994/01/19}
570 % {name changed from \cs{test}}
571 % This is a local definition of |\IfFileExists|. It tries to relocate
572 % |texsxys.aux|. If it succeeds, then the |\@currdir| syntax has been
573 % determined. If all the tests fail then |\@currdir| will be set to
574 % |\@empty|, and |ltxcheck| will warn of this when it checks the format.
581 \advance\count2 \time
584 % \begin{macro}{\today}
585 % The current date and time stamp.
586 % \changes{v0.2g}{1994/01/21}
587 % {Name changed from \cs{stamp}, to save memory}
590 \the\year/\two@digits{\the\month}/\two@digits{\the\day}:%
591 \two@digits{\the\count@}:\two@digits{\the\count2}}
595 % Create a file |texsys.aux| (hopefully in the current directory),
596 % then try to locate it again.
598 \immediate\openout15=texsys.aux
599 \immediate\write15{\today^^J}
600 \immediate\closeout15 %
603 % |#1| is the file to try, |#2| is what to do on success, |#3| on
606 \def\IfFileExists#1#2#3{%
607 \openin\@inputcheck#1 %
611 \read\@inputcheck to \reserved@a
612 \ifx\reserved@a\today
613 \typeout{#1 found}#2\relax
615 \typeout{BAD: old file \reserved@a (should be \today)}%
619 \closein\@inputcheck}
626 % If |\@currdir| has not been pre-defined in |texsys.cfg| then test for
627 % UNIX, VMS and Oz-\TeX-Mac. syntax.
628 % \changes{v0.2h}{1994/01/24}
629 % {Stop testing once texsys.aux has been found}
631 \ifx\@currdir\@undefined
632 \IfFileExists{./texsys.aux}{\gdef\@currdir{./}}%
633 {\IfFileExists{[]texsys.aux}{\gdef\@currdir{[]}}%
634 {\IfFileExists{:texsys.aux}{\gdef\@currdir{:}}{}}}
636 % If it is still undefined at this point, all the above tests failed.
637 % Earlier versions interactively prompted for a definition at this
638 % point, but it seems impossible to reliably obtain information from
639 % users at this point in the installation. This version of the file
640 % produces a format with no user-interaction. Later if the format is not
641 % suitable for the system, |texsys.cfg| may be edited and the format
643 % \changes{v0.2a}{1993/12/13}
644 % {Removed interactive prompting for current directory syntax}
645 % \changes{v0.2f}{1994/01/20}
646 % {\cs{@copytexsys} removed}
647 % \changes{v1.0u}{1996/12/06}
648 % {*** removed from various messages for GNU Make.
651 \ifx\@currdir\@undefined
652 \global\let\@currdir\@empty
654 !! No syntax for the current directory could be found^^J%
658 % Otherwise |\@currdir| was defined in |texsys.cfg|. In this case check
659 % that the syntax specified works on this system. (In case a complete
660 % \LaTeX\ system has been copied from one system to another.) If the
661 % test fails, give up. The installer should remove or correct the
662 % offending |texsys.cfg| and try again.
665 \IfFileExists{\@currdir texsys.aux}{}{%
666 \edef\reserved@a{\errhelp{%
667 texsys.cfg specifies the current directory syntax to be^^J%
668 \meaning\@currdir^^J%
669 but this does not work on this system.^^J%
670 Remove texsys.cfg and restart.}}\reserved@a
671 \errmessage{Bad texsys.cfg file: \noexpand\@currdir}\@@end}
673 % The version of |\@currdir| in |texsys.cfg| looks OK.
677 % \changes{v0.2d}{1994/01/14}
678 % {Close the texsys.aux output stream}
680 \immediate\closeout15 %
686 \noexpand\@currdir set to:
687 \expandafter\strip@prefix\meaning\@currdir.^^J%
694 % \changes{v0.2a}{1993/12/13}
695 % {on the `docstrip' pass, do not check openin path}
697 % Stop here if the file is being used unstripped.
704 % \section{Setting \texttt{\cs{input@path}}}
706 % Earlier versions of this file attempted to automatically test whether
707 % |\input@path| was required, and interactively prompt for a path if
708 % necessary. This was not found to be very reliable The first-time
709 % installer of \LaTeXe\ can not be expected to have enough information
710 % to supply the correct information to the prompts. Now the interaction
711 % is omitted. After the format is made the installer can attempt to run
712 % the test document |ltxcheck.tex| through \LaTeXe. This will check,
713 % amongst other things, whether |texsys.cfg| will need to be edited and
716 % \begin{macro}{\input@path}
717 % Now set up the |\input@path|.
719 % |\input@path| should either be undefined, or a list of directories as
720 % described in the introduction.
721 % \changes{v0.2e}{1994/01/19}
722 % {No longer check that an empty group is in the path}
725 Assuming \noexpand\openin and \noexpand\input^^J%
726 \ifx\input@path\@undefined
728 % |\input@path| has not been pre-defined.
730 have the same search path.^^J%
733 % |\input@path| has been defined in |texsys.cfg|.
735 have different search paths.^^J%
736 LaTeX will use the path specified by \noexpand\input@path:^^J%
742 % \section{Filename Parsing}
744 % \begin{macro}{\filename@parse}
745 % Split a filename into its components.
746 % \changes{v0.2g}{1994/01/21}
747 % {Minor changes, and add Mac version (:)}
749 \ifx\filename@parse\@undefined
750 \def\reserved@a{./}\ifx\@currdir\reserved@a
752 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
753 % looks like UNIX\ldots
755 \typeout{^^JDefining UNIX/DOS style filename parser.^^J}
756 \def\filename@parse#1{%
757 \let\filename@area\@empty
758 \expandafter\filename@path#1/\\}
761 % Search for the last |/|.
763 \def\filename@path#1/#2\\{%
765 \def\reserved@a{\filename@simple#1.\\}%
767 \edef\filename@area{\filename@area#1/}%
768 \def\reserved@a{\filename@path#2\\}%
774 \else\def\reserved@a{[]}\ifx\@currdir\reserved@a
776 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
777 % looks like VMS\ldots
779 \typeout{^^JDefining VMS style filename parser.^^J}
780 \def\filename@parse#1{%
781 \let\filename@area\@empty
782 \expandafter\filename@path#1]\\}
785 % Search for the last |]|.
787 \def\filename@path#1]#2\\{%
789 \def\reserved@a{\filename@simple#1.\\}%
791 \edef\filename@area{\filename@area#1]}%
792 \def\reserved@a{\filename@path#2\\}%
798 \else\def\reserved@a{:}\ifx\@currdir\reserved@a
800 % |\filename@parse| was not specified in |texsys.cfg|, but |\@currdir|
801 % looks like Macintosh\ldots
803 \typeout{^^JDefining Mac style filename parser.^^J}
804 \def\filename@parse#1{%
805 \let\filename@area\@empty
806 \expandafter\filename@path#1:\\}
809 % Search for the last |:|.
810 % \changes{v1.0g}{1994/05/25}
811 % {Mac parser had " typo for :}
813 \def\filename@path#1:#2\\{%
815 \def\reserved@a{\filename@simple#1.\\}%
817 \edef\filename@area{\filename@area#1:}%
818 \def\reserved@a{\filename@path#2\\}%
826 % |\filename@parse| was not specified in |texsys.cfg|.
827 % So just make a simple parser that always sets |\filename@area| to
830 \typeout{^^JDefining generic filename parser.^^J}
831 \def\filename@parse#1{%
832 \let\filename@area\@empty
833 \expandafter\filename@simple#1.\\}
837 % |\filename@simple| is used by all three versions.
838 % Finally we can split off the extension.
840 \def\filename@simple#1.#2\\{%
842 \let\filename@ext\relax
844 \edef\filename@ext{\filename@dot#2\\}%
846 \edef\filename@base{#1}}
849 % Remove a final dot, added earlier.
851 \def\filename@dot#1.\\{#1}
857 % Otherwise, |\filename@parse| was specified in |texsys.cfg|.
860 \noexpand\filename@parse was defined in texsys.cfg:^^J%
861 \expandafter\strip@prefix\meaning\filename@parse.^^J%
867 % \section{\TeX\ Versions}
869 % \begin{macro}{\@TeXversion}
870 % \TeX\ versions older than than 3.141 require |\@TeXversion| to be
871 % set. This can be determined automatically due to a trick suggested
872 % by Bernd Raichle. (Actually this will not always get the correct
873 % version number, eg \TeX3.14 would be detected as \TeX3, but \LaTeX\
874 % only needs to take account of \TeX's older than 3, or between 3 and
876 % \changes{v1.0h}{1994/10/11}
877 % {Check for TeX3.14}
879 \ifx\@TeXversion\@undefined
880 \ifx\@undefined\inputlineno
883 {\catcode`\^^J=\active
884 \def\reserved@a#1#2\@@{\if#1\string^3\fi}
885 \edef\reserved@a{\expandafter\reserved@a\string^^J\@@}
886 \ifx\reserved@a\@empty\else\gdef\@TeXversion{3}\fi}
896 % \section{ltxcheck.tex}
897 % After the format has been made, and article.cls moved with the
898 % other files to the `standard input directory' as specified in
899 % |install.txt|, the format may be checked by running the file
901 % \changes{v0.2f}{1994/01/20}
902 % {Modify all of ltxcheck}
903 % \changes{v1.0h}{1994/10/11}
904 % {Modify all of ltxcheck again}
905 % \changes{v1.0t}{1996/09/25}
906 % {Move ltxcheck to separate file}