e\TeX, not \eTeX, (or we could add this to ltxdoc.cls)
[latex2e.git] / trunk / base / source2e.tex
blobbe9c8a951d0b003219f12ccd94c04532db0e1067
1 % \iffalse meta-comment
3 % Copyright 1993-2016
4 % The LaTeX3 Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % 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
22 % information.
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.
28 % \fi
30 % This document will typeset the LaTeX sources as a single document.
31 % This will produce quite a large file (roughly 555 pages) and may
32 % take a long time.
34 % Some notes on processing this document are contained at the end
35 % of this document, after \end{document}
37 % DPC 1997/11/17
39 % First a special index style for makeindex
42 \begin{filecontents}{source2e.ist}
43 actual '='
44 quote '!'
45 level '>'
46 preamble
47 "\n \\begin{theindex} \n \\makeatletter\\scan@allowedfalse\n"
48 postamble
49 "\n\n \\end{theindex}\n"
50 item_x1 "\\efill \n \\subitem "
51 item_x2 "\\efill \n \\subsubitem "
52 delim_0 "\\pfill "
53 delim_1 "\\pfill "
54 delim_2 "\\pfill "
55 % The next lines will produce some warnings when
56 % running Makeindex as they try to cover two different
57 % versions of the program:
58 lethead_prefix "{\\bfseries\\hfil "
59 lethead_suffix "\\hfil}\\nopagebreak\n"
60 lethead_flag 1
61 heading_prefix "{\\bfseries\\hfil "
62 heading_suffix "\\hfil}\\nopagebreak\n"
63 headings_flag 1
65 % and just for source2e:
66 % Remove R so I is treated in sequence I J K not I II III
67 page_precedence "rnaA"
68 \end{filecontents}
72 \documentclass{ltxdoc}
74 \listfiles
76 % Do not index some TeX primitives, and some common plain TeX commands.
78 \DoNotIndex{\def,\long,\edef,\xdef,\gdef,\let,\global}
79 \DoNotIndex{\if,\ifnum,\ifdim,\ifcat,\ifmmode,\ifvmode,\ifhmode,%
80 \iftrue,\iffalse,\ifvoid,\ifx,\ifeof,\ifcase,\else,\or,\fi}
81 \DoNotIndex{\box,\copy,\setbox,\unvbox,\unhbox,\hbox,%
82 \vbox,\vtop,\vcenter}
83 \DoNotIndex{\@empty,\immediate,\write}
84 \DoNotIndex{\egroup,\bgroup,\expandafter,\begingroup,\endgroup}
85 \DoNotIndex{\divide,\advance,\multiply,\count,\dimen}
86 \DoNotIndex{\relax,\space,\string}
87 \DoNotIndex{\csname,\endcsname,\@spaces,\openin,\openout,%
88 \closein,\closeout}
89 \DoNotIndex{\catcode,\endinput}
90 \DoNotIndex{\jobname,\message,\read,\the,\m@ne,\noexpand}
91 \DoNotIndex{\hsize,\vsize,\hskip,\vskip,\kern,\hfil,\hfill,\hss}
92 \DoNotIndex{\m@ne,\z@,\z@skip,\@ne,\tw@,\p@}
93 \DoNotIndex{\dp,\wd,\ht,\vss,\unskip}
95 % Set up the Index and Change History to use \part
96 \IndexPrologue{\part*{Index}%
97 \markboth{Index}{Index}%
98 \addcontentsline{toc}{part}{Index}%
99 The italic numbers denote the pages where the
100 corresponding entry is described,
101 numbers underlined point to the definition,
102 all others indicate the places where it is used.}
104 \GlossaryPrologue{\part*{Change History}%
105 % Allow control names to be hyphenated here...
106 {\GlossaryParms\ttfamily\hyphenchar\font=`\-}%
107 \markboth{Change History}{Change History}%
108 \addcontentsline{toc}{part}{Change History}}
110 % The standard \changes command modified slightly to better cope with
111 % this multiple file document.
112 \makeatletter
113 \def\changes@#1#2#3{%
114 \let\protect\@unexpandable@protect
115 \edef\@tempa{\noexpand\glossary{#2\space\currentfile\space#1\levelchar
116 \ifx\saved@macroname\@empty
117 \space
118 \actualchar
119 \generalname
120 \else
121 \expandafter\@gobble
122 \saved@macroname
123 \actualchar
124 \string\verb\quotechar*%
125 \verbatimchar\saved@macroname
126 \verbatimchar
128 :\levelchar #3}}%
129 \@tempa\endgroup\@esphack}
130 \makeatother
132 % Produce a Change Log and (2 column) Index.
133 \RecordChanges
134 \CodelineIndex
135 \EnableCrossrefs
136 \setcounter{IndexColumns}{2}
138 % Needed for documentation in ltoutenc.dtx
139 \usepackage{textcomp}
141 \begin{document}
142 \title{The \LaTeXe\ Sources}
143 \author{%
144 Johannes Braams\\
145 David Carlisle\\
146 Alan Jeffrey\\
147 Leslie Lamport\\
148 Frank Mittelbach\\
149 Chris Rowley\\
150 Rainer Sch\"opf}
152 % This command will be used to input the patch file
153 % if that file exists.
154 \newcommand{\includeltpatch}{%
155 \def\currentfile{ltpatch.ltx}
156 \part{ltpatch}
157 {\let\ttfamily\relax
158 \xdef\filekey{\filekey, \thepart={\ttfamily\currentfile}}}%
159 Things we did wrong\ldots
160 \IndexInput{ltpatch.ltx}}
164 % Get the date and patch level from ltvers.dtx
165 \makeatletter
166 \let\patchdate=\@empty
167 \begingroup
168 \def\ProvidesFile#1\fmtversion#2#3\patch@level#4{%
169 \date{#2}\xdef\patchdate{#4}\endinput}
170 \input{ltvers.dtx}
171 \global\let\X@date=\@date
173 % Add the patch version if available.
174 \long\def\Xdef#1#2#3\def#4#5{%
175 \xdef\X@date{#2}%
176 \xdef\patchdate{#5}%
177 \endinput}%
178 \InputIfFileExists{ltpatch.ltx}
179 {\let\def\Xdef}{\global\let\includeltpatch\relax}
180 \endgroup
182 \ifx\@date\X@date
183 \def\Xpatch{0}
184 \ifx\patchdate\Xpatch\else
185 \edef\@date{\@date\space Patch level \patchdate}
187 \else
188 \@warning{ltpatch.ltx does not match ltvers.dtx!}
189 \let\includeltpatch\relax
191 \makeatother
193 \pagenumbering{roman}
194 \MaintainedByLaTeXTeam{latex}
195 \maketitle
196 \renewcommand\maketitle{}
198 \tableofcontents
200 \clearpage
202 \pagenumbering{arabic}
204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
206 % Each of the following \DocInclude lines includes a file with extension
207 % .dtx. Each of these files may be typeset separately. For instance
208 % latex ltboxes.dtx
209 % will typeset the source of the LaTeX box commands.
211 % If this file is processed, each of these separate dtx files will be
212 % contained as a part of a single document. Using ltxdoc.cfg you can
213 % then optionally produce a combined index and/or change history for
214 % the entire source of the format file. Note that such a document will
215 % be quite large (about 555 pages).
218 \DocInclude{ltdirchk} % System dependent initialisation
220 \DocInclude{ltplain} % LaTeX version of Knuth's plain.tex
222 \DocInclude{ltvers} % Current version date
224 \DocInclude{ltdefns} % Initial definitions.
226 \DocInclude{ltalloc} % Allocation of counters and others.
228 \DocInclude{ltcntrl} % Program control macros.
230 \DocInclude{lterror} % Error handling.
232 \DocInclude{ltpar} % Paragraphs.
234 \DocInclude{ltspace} % Spacing, line and page breaking.
236 \DocInclude{ltlogos} % Logos.
238 \DocInclude{ltfiles} % \input files and related commands
240 \DocInclude{ltoutenc} % Output encoding interface
242 \DocInclude{ltcounts} % Counters
244 \DocInclude{ltlength} % Lengths
246 \DocInclude{ltfssbas} % NFSS Base macros
248 \DocInclude{ltfsstrc} % NFSS Tracing (and tracefnt.sty)
250 \DocInclude{ltfsscmp} % NFSS1 Compatibility
252 \DocInclude{ltfssdcl} % NFSS Declarative interface
254 \DocInclude{ltfssini} % NFSS Initialisation
256 \DocInclude{fontdef} % fonttext.ltx/fontmath.ltx
258 \DocInclude{preload} % preload.ltx
260 \DocInclude{ltfntcmd} % \textrm etc
262 \DocInclude{ltpageno} % Page numbering
264 \DocInclude{ltxref} % Cross referencing
266 \DocInclude{ltmiscen} % Miscellaneous environment definitions.
268 \DocInclude{ltmath} % Mathematics set up.
270 \DocInclude{ltlists} % List and related environments
272 \DocInclude{ltboxes} % Parbox and friends
274 \DocInclude{lttab} % Tabbing tabular and array
276 \DocInclude{ltpictur} % Picture mode
278 \DocInclude{ltthm} % Theorem environments
280 \DocInclude{ltsect} % Sectioning
282 \DocInclude{ltfloat} % Floats
284 \DocInclude{ltidxglo} % Index and Glossary
286 \DocInclude{ltbibl} % Bibliography
288 \DocInclude{ltpage} % \pagestyle \raggedbottom \sloppy
290 \DocInclude{ltoutput} % Output routine
292 \DocInclude{ltclass} % Package & Class interface
294 \DocInclude{lthyphen} % Hyphenation (hyphen.ltx).
296 \DocInclude{ltluatex} % Luatex support
298 \DocInclude{ltfinal} % Last minute initialisations and dump
300 \includeltpatch % Corrections distributed after the full release
302 % Stop here if ltxdoc.cfg says \AtEndOfClass{\OnlyDescription}
303 \StopEventually{\end{document}}
305 \clearpage
306 \pagestyle{headings}
308 % Make TeX shut up.
309 \hbadness=10000
310 \newcount\hbadness
311 \hfuzz=\maxdimen
313 \typeout{%
314 \string # Produce change log with^^J%
315 makeindex -s gglo.ist -o source2e.gls source2e.glo}
318 \PrintChanges
320 \clearpage
322 % makeindex needs a symbol between the parts of composite page numbers
323 % but we dont want one, so:
324 \typeout{%
325 \string # Produce index with^^J%
326 makeindex -s source2e.ist source2e.idx}
328 \begingroup
329 \def\endash{--}
330 \catcode`\-\active
331 \def-{\futurelet\temp\indexdash}
332 \def\indexdash{\ifx\temp-\endash\fi}
334 \PrintIndex
335 \endgroup
337 % Make sure that the index is not printed twice
338 % (ltxdoc.cfg might have a second \PrintIndex command)
339 \let\PrintChanges\relax
340 \let\PrintIndex\relax
342 \end{document}
345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347 To use this file to produce a fully indexed source code
348 you need to execute the following (or equivalent) commands:
350 latex source2e.tex
352 makeindex -s source2e.ist source2e.idx
353 makeindex -s gglo.ist -o source2e.gls source2e.glo
355 latex source2e.tex
356 latex source2e.tex
359 The makeindex style source2e.ist is used in place of the usual
360 doc gind.ist to ensure that I is used in the sequence I J K
361 not I II II, which would be the default makeindex behaviour.
363 The third run with latex is only required to get the table of
364 contents entries for the change log and index. You may speed things up
365 by using the \includeonly mechanism so as not to typeset the source
366 files on the second run. This involves changing the file
367 ltxdoc.cfg
368 between the latex runs.
370 The following unix script automates this.
371 (It could easily be ported to scripts for DOS or VMS,
372 rm is ReMove a file, and echo "..." > file writes ... to "file".)
375 After this script (after the second ==============) is a similar script
376 that will produce the documentation for all the files in the base
377 distribution that are *not* included in source2e.dvi. This second script
378 was requested, but before using it, beware it will take a long time!
379 It may however be modified as required, eg to not typeset the fdd files
380 or whatever...
382 ==============
383 #!/bin/sh
385 rm -f source2e.gls source2e.ind source2e.toc
387 # First run:
388 # Create new standard ltxdoc.cfg file
389 # Pass the (possibly empty) list of arguments supplied on the
390 # command line to article class.
392 # If you use A4 paper, running this script with argument
393 # a4paper
394 # may save about 30 pages.
396 echo "\PassOptionsToClass{$*}{article}" > ltxdoc.cfg
399 # Now LaTeX the file with this cfg file.
401 latex source2e.tex
404 # Make the Change log and Glossary.
406 makeindex -s source2e.ist source2e.idx
407 makeindex -s gglo.ist -o source2e.gls source2e.glo
410 # Second run: append \includeonly{} to ltxdoc.cfg to speed up things
411 # (this run needed only to get changes and index listed in .toc file)
413 # Note that the index will not be made incorrect by the insertion
414 # of the table of contents as the front matter uses a different page
415 # numbering scheme.
417 echo "\includeonly{}" >> ltxdoc.cfg
419 latex source2e.tex
422 # Third and final run, to put everything together.
423 # First restore the cfg file:
425 echo "\PassOptionsToClass{$*}{article}" > ltxdoc.cfg
426 latex source2e.tex
429 ==============
430 #!/bin/sh
432 # Running this script will process all the dtx fdd and *guide.tex
433 # and ltnews*.tex files in the LaTeX distribution, except the dtx
434 # files included in source2e.tex.
435 # (The shell first script in the comments of source2e.tex will
436 # process those.)
438 # Any command line arguments (eg a4paper) are taken as options to the
439 # article class.
441 # This script is likely to take ages!
443 echo "\PassOptionsToClass{$*}{article}" > ltxdoc.cfg
444 echo "\batchmode" >> ltxdoc.cfg
446 # The next four lines produce full indexes and change logs
447 # you may not want those.
448 echo "\AtBeginDocument{\RecordChanges}" >> ltxdoc.cfg
449 echo "\AtEndDocument{\PrintChanges}" >> ltxdoc.cfg
450 echo "\AtBeginDocument{\CodelineIndex\EnableCrossrefs}" >> ltxdoc.cfg
451 echo "\AtEndDocument{\PrintIndex}" >> ltxdoc.cfg
453 # If you do not want any code listings, just documentation, then instead
454 # of the above four lines, uncomment the following:
455 # echo "\AtBeginDocument{\OnlyDescription}" >> ltxdoc.cfg
457 echo "\PassOptionsToClass{$*}{article}" > ltxguide.cfg
458 echo "\batchmode" >> ltxguide.cfg
460 cp ltxguide.cfg ltnews.cfg
463 for i in *dtx *fdd *guide.tex ltnews*.tex
465 B=`basename $i .dtx`
467 if (grep "Include{$B}" source2e.tex >/dev/null ; )
468 then
469 echo In source2e: $i
470 else
471 echo latex $i
472 if (latex $i > /dev/null)
473 then
474 echo latex $i
475 latex $i > /dev/null
476 echo makeindex -s gind.ist $B.idx
477 makeindex -s gind.ist $B.idx > /dev/null 2> /dev/null
478 echo makeindex -s gglo.ist -o $B.gls $B.glo
479 makeindex -s gglo.ist -o $B.gls $B.glo > /dev/null 2> /dev/null
480 echo latex $i
481 latex $i > /dev/null
482 else
483 echo "!!! LaTeX ERROR: $i. (See $B.log.)"
487 done