-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathchapter33.tex
1262 lines (1158 loc) · 49.8 KB
/
chapter33.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% -*- coding: utf-8 -*-
\documentclass{book}
\input{preamble}
\setcounter{chapter}{32}
\begin{document}
%\chapter{\TeX\ and the Outside World}\label{TeXcomm}
\chapter{\TeX\ and the Outside World}\label{TeXcomm}
%This
%chapter treats those commands that bear relevance to
%\n{dvi} files and formats. It gives some global information
%about \IniTeX, font and format files,
%Computer Modern typefaces, and \web.
This
chapter treats those commands that bear relevance to
\n{dvi} files and formats. It gives some global information
about \IniTeX, font and format files,
Computer Modern typefaces, and \web.
%\label{cschap:dump}\label{cschap:special}\label{cschap:mag}\label{cschap:year}\label{cschap:month}\label{cschap:day}\label{cschap:time}\label{cschap:fmtname}\label{cschap:fmtversion}
%\begin{inventory}
%\item [\cs{dump}]
% Dump a format file; possible only in \IniTeX,
% not allowed inside a group.
\label{cschap:dump}\label{cschap:special}\label{cschap:mag}\label{cschap:year}\label{cschap:month}\label{cschap:day}\label{cschap:time}\label{cschap:fmtname}\label{cschap:fmtversion}
\begin{inventory}
\item [\cs{dump}]
Dump a format file; possible only in \IniTeX,
not allowed inside a group.
%\item [\cs{special}]
% Write a \gr{balanced text} to the \n{dvi} file.
\item [\cs{special}]
Write a \gr{balanced text} to the \n{dvi} file.
%\item [\cs{mag}]
% 1000 times the magnification of the document.
\item [\cs{mag}]
1000 times the magnification of the document.
%\item [\cs{year}]
% The year of the current job.
\item [\cs{year}]
The year of the current job.
%\item [\cs{month}]
% The month of the current job.
\item [\cs{month}]
The month of the current job.
%\item [\cs{day}]
% The day of the current job.
\item [\cs{day}]
The day of the current job.
%\item [\cs{time}]
% Number of minutes after midnight that the current job started.
\item [\cs{time}]
Number of minutes after midnight that the current job started.
%\item [\cs{fmtname}]
% Macro containing the name of the format dumped.
\item [\cs{fmtname}]
Macro containing the name of the format dumped.
%\item [\cs{fmtversion}]
% Macro containing the version of the format dumped.
\item [\cs{fmtversion}]
Macro containing the version of the format dumped.
%\end{inventory}
\end{inventory}
%%\point \TeX, \IniTeX, \VirTeX
%\section{\TeX, \IniTeX, \VirTeX}
%\point \TeX, \IniTeX, \VirTeX
\section{\TeX, \IniTeX, \VirTeX}
%In the terminology established in {\italic \TeX: the Program},
%\cite{Knuth:TeXprogram},
%\thecstoidx TeX\par\thecstoidx IniTeX\par\thecstoidx VirTeX\par
%\TeX\ programs come in three flavours.
%\IniTeX\ is a version of \TeX\ that can generate formats;
%\VirTeX\ is a production version without preloaded format,
%and \TeX\ is a production version with
%preloaded (plain) format. Unfortunately, this terminology is
%not adhered to in general. A~lot of systems do not use preloaded
%formats (the procedure for making them may be impossible on
%some operating systems),
%and call the `virgin \TeX' simply \TeX.
%This manual also follows that convention.
In the terminology established in {\italic \TeX: the Program},
\cite{Knuth:TeXprogram},
\thecstoidx TeX\par\thecstoidx IniTeX\par\thecstoidx VirTeX\par
\TeX\ programs come in three flavours.
\IniTeX\ is a version of \TeX\ that can generate formats;
\VirTeX\ is a production version without preloaded format,
and \TeX\ is a production version with
preloaded (plain) format. Unfortunately, this terminology is
not adhered to in general. A~lot of systems do not use preloaded
formats (the procedure for making them may be impossible on
some operating systems),
and call the `virgin \TeX' simply \TeX.
This manual also follows that convention.
%%\spoint Formats: loading
%\subsection{Formats: loading}
%\spoint Formats: loading
\subsection{Formats: loading}
%A \indexterm{format file}
%(usually with extension~\n{.fmt})
%is a compact dump of \TeX's internal structures.
%Loading a format file takes a considerably shorter time than
%would be needed for
%loading the font information and the macros that
%constitute the format.
A \indexterm{format file}
(usually with extension~\n{.fmt})
is a compact dump of \TeX's internal structures.
Loading a format file takes a considerably shorter time than
would be needed for
loading the font information and the macros that
constitute the format.
%Both \TeX\ and \IniTeX\ can load a format; the user specifies
%this by putting the name on the command line
%\begin{verbatim}
%% tex &plain
%\end{verbatim}
%or at the \n{**} prompt
%\begin{verbatim}
%% tex
%This is TeX. Version ....
%** &plain
%\end{verbatim}
%preceded by an ampersand (for UNIX, this should be \verb>\&> on
%the command line). An input file name can follow the
%format name in both places.
Both \TeX\ and \IniTeX\ can load a format; the user specifies
this by putting the name on the command line
\begin{verbatim}
% tex &plain
\end{verbatim}
or at the \n{**} prompt
\begin{verbatim}
% tex
This is TeX. Version ....
** &plain
\end{verbatim}
preceded by an ampersand (for UNIX, this should be \verb>\&> on
the command line). An input file name can follow the
format name in both places.
%\IniTeX\ does not need a format,
%but if no format is specified for (Vir)\TeX, it will try to
%load the plain format, and halt if that cannot be found.
\IniTeX\ does not need a format,
but if no format is specified for (Vir)\TeX, it will try to
load the plain format, and halt if that cannot be found.
%%\spoint Formats: dumping
%\subsection{Formats: dumping}
%\spoint Formats: dumping
\subsection{Formats: dumping}
%\IniTeX\ is the only version of \TeX\
%that can dump a format, since it is
%the only version of \TeX\ that has
%the command~\csidx{dump},
%which causes the internal structures
%to be dumped as a format.
%It is also the only version of \TeX\ that has the command
%\cs{patterns}, which
%is needed to specify a list of hyphenation
%patterns.
\IniTeX\ is the only version of \TeX\
that can dump a format, since it is
the only version of \TeX\ that has
the command~\csidx{dump},
which causes the internal structures
to be dumped as a format.
It is also the only version of \TeX\ that has the command
\cs{patterns}, which
is needed to specify a list of hyphenation
patterns.
%Dumping is not allowed inside a group, that is
%\begin{verbatim}
%{ ... \dump }
%\end{verbatim}
%is not allowed. This restriction
%prevents difficulties with \TeX's save stack.
%After the \cs{dump} command \TeX\ gives an elaborate listing of
%its internal state, and of the font names associated with
%fonts that have been loaded and ends the job.
Dumping is not allowed inside a group, that is
\begin{verbatim}
{ ... \dump }
\end{verbatim}
is not allowed. This restriction
prevents difficulties with \TeX's save stack.
After the \cs{dump} command \TeX\ gives an elaborate listing of
its internal state, and of the font names associated with
fonts that have been loaded and ends the job.
%An interesting possibility arises from the fact that
%\IniTeX\ can both load and dump a format.
%Suppose you have written a set of macros that build
%on top of plain \TeX, \n{superplain.tex}.
%You could then call
%\begin{verbatim}
%% initex &plain superplain
%*\dump
%\end{verbatim}
%and get a format file \n{superplain.fmt} that
%has all of plain, and all of your macros.
An interesting possibility arises from the fact that
\IniTeX\ can both load and dump a format.
Suppose you have written a set of macros that build
on top of plain \TeX, \n{superplain.tex}.
You could then call
\begin{verbatim}
% initex &plain superplain
*\dump
\end{verbatim}
and get a format file \n{superplain.fmt} that
has all of plain, and all of your macros.
%%\spoint Formats: preloading
%\subsection{Formats: preloading}
%\spoint Formats: preloading
\subsection{Formats: preloading}
%On some systems it is possible to interrupt a running program,
%and save its `core image' such that this can be started as
%an independent program.
%The executable made from the
%core image of a \TeX\ program interrupted after it has loaded
%a format is called a \TeX\ program with preloaded format.
%The idea behind preloaded formats is
%that interrupting \TeX\ after it has loaded a format, and making
%this program available to the user,
%saves in each run the time for loading the format.
%In the good old days when computers were quite a bit slower
%this procedure made sense.
%Nowadays, it does not seem so necessary.
%Besides, dumping a core image may not always be possible.
On some systems it is possible to interrupt a running program,
and save its `core image' such that this can be started as
an independent program.
The executable made from the
core image of a \TeX\ program interrupted after it has loaded
a format is called a \TeX\ program with preloaded format.
The idea behind preloaded formats is
that interrupting \TeX\ after it has loaded a format, and making
this program available to the user,
saves in each run the time for loading the format.
In the good old days when computers were quite a bit slower
this procedure made sense.
Nowadays, it does not seem so necessary.
Besides, dumping a core image may not always be possible.
%%\spoint The knowledge of \IniTeX
%\subsection{The knowledge of \IniTeX}
%\spoint The knowledge of \IniTeX
\subsection{The knowledge of \IniTeX}
%If no format has been loaded, \IniTeX\ knows very little.
%For instance, it has no open/close group characters.
%However, it can not be completely devoid of knowledge
%lest there be no way to define anything.
If no format has been loaded, \IniTeX\ knows very little.
For instance, it has no open/close group characters.
However, it can not be completely devoid of knowledge
lest there be no way to define anything.
%Here is the extent of its knowledge.
%\begin{itemize} \mathsurround=1.5pt
%%\flushright:no
%\item \verb>\catcode`\\=0>, \verb>\escapechar=`\\>
% (see page~\pageref{ini:esc}).
%\item \verb>\catcode`\^^M=5>, \verb>\endlinechar=`\^^M>
% (see page~\pageref{ini:eol}).
%\item \verb>\catcode`\ =10>
% (see page~\pageref{ini:sp}).
%\item \verb>\catcode`\%=14>
% (see page~\pageref{ini:comm}).
%\item \verb>\catcode`\^^?=15>
% (see page~\pageref{ini:invalid}).
%\item \cs{catcode}$x$\n{=11} for $x={}$\n{`a..`z,`A..`Z}
% (see page~\pageref{ini:let}).
%\item \cs{catcode}$x$\n{=12} for all other character codes\nl
% (see page~\pageref{ini:other}).
%\item \cs{sfcode}$x$=\n{999} for $x={}$\n{`A..`Z},
% \cs{sfcode}$x$\n{=1000} for all other characters
% (see page~\pageref{ini:sf}).
%\item \verb>\lccode`a..`z,`A..`Z=`a..`z>, \verb>\uccode`a..`z,`A..`Z=`A..`Z>,
% \cs{lccode}$x$\n{=0}, \cs{uccode}$x$\n{=0} for all other characters
% (see page~\pageref{ini:uclc}).
%\item \verb>\delcode`.=0>, \cs{delcode}$x$\n{=-1} for all other characters
% (see page~\pageref{ini:del}).
%\item \cs{mathcode}$x$\n{="!7100}${}+x$ for all lowercase and uppercase
% letters, \cs{mathcode}$x$\n{="!7000}${}+x$ for all digits,
% \cs{mathcode}$x$\n=$x$ for all other characters
% (see page~\pageref{ini:fam}).
%\item \cs{tolerance=10000}, \cs{mag=1000},
% \cs{maxdeadcycles=25}.
%\end{itemize}
Here is the extent of its knowledge.
\begin{itemize} \mathsurround=1.5pt
%\flushright:no
\item \verb>\catcode`\\=0>, \verb>\escapechar=`\\>
(see page~\pageref{ini:esc}).
\item \verb>\catcode`\^^M=5>, \verb>\endlinechar=`\^^M>
(see page~\pageref{ini:eol}).
\item \verb>\catcode`\ =10>
(see page~\pageref{ini:sp}).
\item \verb>\catcode`\%=14>
(see page~\pageref{ini:comm}).
\item \verb>\catcode`\^^?=15>
(see page~\pageref{ini:invalid}).
\item \cs{catcode}$x$\n{=11} for $x={}$\n{`a..`z,`A..`Z}
(see page~\pageref{ini:let}).
\item \cs{catcode}$x$\n{=12} for all other character codes\nl
(see page~\pageref{ini:other}).
\item \cs{sfcode}$x$=\n{999} for $x={}$\n{`A..`Z},
\cs{sfcode}$x$\n{=1000} for all other characters
(see page~\pageref{ini:sf}).
\item \verb>\lccode`a..`z,`A..`Z=`a..`z>, \verb>\uccode`a..`z,`A..`Z=`A..`Z>,
\cs{lccode}$x$\n{=0}, \cs{uccode}$x$\n{=0} for all other characters
(see page~\pageref{ini:uclc}).
\item \verb>\delcode`.=0>, \cs{delcode}$x$\n{=-1} for all other characters
(see page~\pageref{ini:del}).
\item \cs{mathcode}$x$\n{="!7100}${}+x$ for all lowercase and uppercase
letters, \cs{mathcode}$x$\n{="!7000}${}+x$ for all digits,
\cs{mathcode}$x$\n=$x$ for all other characters
(see page~\pageref{ini:fam}).
\item \cs{tolerance=10000}, \cs{mag=1000},
\cs{maxdeadcycles=25}.
\end{itemize}
%%\spoint Memory sizes of \TeX\ and \IniTeX
%\subsection{Memory sizes of \TeX\ and \IniTeX}
%\spoint Memory sizes of \TeX\ and \IniTeX
\subsection{Memory sizes of \TeX\ and \IniTeX}
%The main memory size of \TeX\ and \IniTeX\ is controlled by
%four constants in the source code:
%\n{mem\_bot}, \n{mem\_top}, \n{mem\_min}, and~\n{mem\_max}.
%For Ini\TeX's memory \n{mem\_bot${}={}$mem\_min}
%and \n{mem\_top${}={}$mem\_max};
%for \TeX\ \n{mem\_bot} and \n{mem\_top} record the main memory
%size of the Ini\TeX\ used to dump the format.
%Thus versions of \TeX\ and \IniTeX\ have to be adapted
%to each other in this respect.
The main memory size of \TeX\ and \IniTeX\ is controlled by
four constants in the source code:
\n{mem\_bot}, \n{mem\_top}, \n{mem\_min}, and~\n{mem\_max}.
For Ini\TeX's memory \n{mem\_bot${}={}$mem\_min}
and \n{mem\_top${}={}$mem\_max};
for \TeX\ \n{mem\_bot} and \n{mem\_top} record the main memory
size of the Ini\TeX\ used to dump the format.
Thus versions of \TeX\ and \IniTeX\ have to be adapted
to each other in this respect.
%\TeX's own main memory can be bigger than that of the
%corresponding \IniTeX: in general
%\n{mem\_min${}\leq{}$mem\_bot} and \n{mem\_top${}\leq{}$mem\_max}.
\TeX's own main memory can be bigger than that of the
corresponding \IniTeX: in general
\n{mem\_min${}\leq{}$mem\_bot} and \n{mem\_top${}\leq{}$mem\_max}.
%For \IniTeX\ a smaller main memory can suffice,
%as this program is typically
%not meant to do real typesetting.
%There may even be a real need for the main memory
%to be smaller, because \IniTeX\ needs a lot of auxiliary
%storage for initialization and for building the
%hyphenation table.
For \IniTeX\ a smaller main memory can suffice,
as this program is typically
not meant to do real typesetting.
There may even be a real need for the main memory
to be smaller, because \IniTeX\ needs a lot of auxiliary
storage for initialization and for building the
hyphenation table.
%%\point More about formats
%\section{More about formats}
%\point More about formats
\section{More about formats}
%%\spoint Compatibility
%\subsection{Compatibility}
%\spoint Compatibility
\subsection{Compatibility}
%\TeX\ has a curious error message: `Fatal format error: I'm stymied',
%which is given if \TeX\ tries to load a format that was made
%with an incompatible version of \IniTeX. See the point
%above about memory sizes, and Chapter~\ref{error} for
%the hash size (parameters \n{hash\_size} and \n{hash\_prime})
%and the hyphenation exception dictionary (parameter \n{hyph\_size}).
\TeX\ has a curious error message: `Fatal format error: I'm stymied',
which is given if \TeX\ tries to load a format that was made
with an incompatible version of \IniTeX. See the point
above about memory sizes, and Chapter~\ref{error} for
the hash size (parameters \n{hash\_size} and \n{hash\_prime})
and the hyphenation exception dictionary (parameter \n{hyph\_size}).
%%\spoint Preloaded fonts
%\subsection{Preloaded fonts}
%\spoint Preloaded fonts
\subsection{Preloaded fonts}
%During a run of \TeX\ the only information needed about fonts
%is the data that is found in the \n{tfm} files (see below).
%Since a run of \TeX, especially if the input contains math material,
%can easily access 30--40 fonts, the disk access for
%all the \n{tfm} files can become significant.
%Therefore the plain format and \LaTeX\ load these
%metrics files in \IniTeX. A~\TeX\ version using such a format
%does not need to load any \n{tfm} files.
During a run of \TeX\ the only information needed about fonts
is the data that is found in the \n{tfm} files (see below).
Since a run of \TeX, especially if the input contains math material,
can easily access 30--40 fonts, the disk access for
all the \n{tfm} files can become significant.
Therefore the plain format and \LaTeX\ load these
metrics files in \IniTeX. A~\TeX\ version using such a format
does not need to load any \n{tfm} files.
%On the other hand, if a format has the possibility of accessing
%a range of typefaces, it may be advantageous to have metrics
%files loaded on demand during the actual run of \TeX.
On the other hand, if a format has the possibility of accessing
a range of typefaces, it may be advantageous to have metrics
files loaded on demand during the actual run of \TeX.
%%\spoint The plain format
%\subsection{The plain format}
%\spoint The plain format
\subsection{The plain format}
%The first format written for \TeX, and the basis for all
%later ones,
%is the plain format, described in \TeXbook.
%It is a mixture of
%\begin{itemize}
%\item definitions and macros one simply cannot live without
%such as the initial \cs{catcode} assignments,
%all of the math delimiter definitions,
%and the \cs{new...} macros;
%\item constructs that are useful, but for which \LaTeX\
%and other packages use
%a different implementation, such as the tabbing environment; and
%\item some macros that are insufficient for any but the
%simplest applications: \cs{item} and \cs{beginsection}
%are in this category.
%\end{itemize}
The first format written for \TeX, and the basis for all
later ones,
is the plain format, described in \TeXbook.
It is a mixture of
\begin{itemize}
\item definitions and macros one simply cannot live without
such as the initial \cs{catcode} assignments,
all of the math delimiter definitions,
and the \cs{new...} macros;
\item constructs that are useful, but for which \LaTeX\
and other packages use
a different implementation, such as the tabbing environment; and
\item some macros that are insufficient for any but the
simplest applications: \cs{item} and \cs{beginsection}
are in this category.
\end{itemize}
%It is the first category which Knuth meant to serve as a
%foundation for future macro packages, so that they
%can live peacefully together (see Chapter~\ref{alloc}).
%This idea is reflected in the fact that the name `plain'
%is not capitalized: it is the basic set of macros.
It is the first category which Knuth meant to serve as a
foundation for future macro packages, so that they
can live peacefully together (see Chapter~\ref{alloc}).
This idea is reflected in the fact that the name `plain'
is not capitalized: it is the basic set of macros.
%%\spoint The \LaTeX\ format
%\subsection{The \LaTeX\ format}
%\spoint The \LaTeX\ format
\subsection{The \LaTeX\ format}
%The \LaTeX\ format\thecstoidx LaTeX\par,
%written by Leslie Lamport of Digital Equipment Corporation
%and described in~\cite{Lamport:LaTeX},
%was released around 1985.
%The \LaTeX\ format, using its own version
%of \n{plain.tex} (called \n{lplain.tex}),
%is not compatible with plain \TeX;
%a~number of plain macros are not available. Still, it contains
%large parts of the plain format (even when they overlap with
%its own constructs).
The \LaTeX\ format\thecstoidx LaTeX\par,
written by Leslie Lamport of Digital Equipment Corporation
and described in~\cite{Lamport:LaTeX},
was released around 1985.
The \LaTeX\ format, using its own version
of \n{plain.tex} (called \n{lplain.tex}),
is not compatible with plain \TeX;
a~number of plain macros are not available. Still, it contains
large parts of the plain format (even when they overlap with
its own constructs).
%\LaTeX\ is a powerful format with facilities such as
%marginal notes, floating objects, cross referencing,
%and automatic table of contents generation.
%Its main drawback is that the `style files' which
%define the actual layout are quite hard to write
%(although \LaTeX\ is in the process of a major revision,
%in which this problem will be tackled;
%see \cite{Frank} and~\cite{Frank2}).
%As a result,
%people have had at their disposal mostly the styles
%written by Leslie Lamport, the layout of which is
%rather idiosyncratic. See~\cite{BEP} for a successful
%attempt to replace these styles.
\LaTeX\ is a powerful format with facilities such as
marginal notes, floating objects, cross referencing,
and automatic table of contents generation.
Its main drawback is that the `style files' which
define the actual layout are quite hard to write
(although \LaTeX\ is in the process of a major revision,
in which this problem will be tackled;
see \cite{Frank} and~\cite{Frank2}).
As a result,
people have had at their disposal mostly the styles
written by Leslie Lamport, the layout of which is
rather idiosyncratic. See~\cite{BEP} for a successful
attempt to replace these styles.
%%\spoint Mathematical formats
%\subsection{Mathematical formats}
%\spoint Mathematical formats
\subsection{Mathematical formats}
%There are two formats with extensive facilities for
%mathematics typesetting:
%\AmsTeX~\cite{Ams}
%(which originated at the American Mathematical Society)
%and \LamsTeX~\cite{Lams}.
%The first of these includes more facilities than plain \TeX\
%or \LaTeX\ for typesetting mathematics, but it lacks
%features such as automatic numbering and cross-referencing,
%available in \LaTeX, for instance. \LamsTeX, then, is the
%synthesis of \AmsTeX\ and \LaTeX. Also it includes
%still more features for mathematics, such as complicated
%tables and commutative diagrams.
There are two formats with extensive facilities for
mathematics typesetting:
\AmsTeX~\cite{Ams}
(which originated at the American Mathematical Society)
and \LamsTeX~\cite{Lams}.
The first of these includes more facilities than plain \TeX\
or \LaTeX\ for typesetting mathematics, but it lacks
features such as automatic numbering and cross-referencing,
available in \LaTeX, for instance. \LamsTeX, then, is the
synthesis of \AmsTeX\ and \LaTeX. Also it includes
still more features for mathematics, such as complicated
tables and commutative diagrams.
%%\spoint Other formats
%\subsection{Other formats}
%\spoint Other formats
\subsection{Other formats}
%Other formats than the above exist:
%for instance, \n{Phyzzx}~\cite{Phyzzx}, \n{TeXsis}~\cite{TeXsis},
%Macro \TeX~\cite{Amy}, \n{eplain}~\cite{Berry},
%and \n{\TeX T1}~\cite{TeXT1}.
%Typically, such formats provide the facilities of \LaTeX, but
%try to be more easily adaptable by the user.
%Also, in general they
%have been written with the intention of being an
%add-on product to the plain format.
Other formats than the above exist:
for instance, \n{Phyzzx}~\cite{Phyzzx}, \n{TeXsis}~\cite{TeXsis},
Macro \TeX~\cite{Amy}, \n{eplain}~\cite{Berry},
and \n{\TeX T1}~\cite{TeXT1}.
Typically, such formats provide the facilities of \LaTeX, but
try to be more easily adaptable by the user.
Also, in general they
have been written with the intention of being an
add-on product to the plain format.
%This book was, in its incarnation published by Addison-Wesley,
%also written in an `other format':
%the \indexterm{Lollipop} format.
%This format does not contain user macros, but the
%tools with which a style designer can program them; see~\cite{EL}.
%The current version of this book is written in \LaTeX.
This book was, in its incarnation published by Addison-Wesley,
also written in an `other format':
the \indexterm{Lollipop} format.
This format does not contain user macros, but the
tools with which a style designer can program them; see~\cite{EL}.
The current version of this book is written in \LaTeX.
%%\point The \n{dvi} file
%\section{The \n{dvi} file}
%\point The \n{dvi} file
\section{The \n{dvi} file}
%The \n{dvi} file (this term stands for `device independent')
%\term \n{dvi} file\par
%contains the output of a \TeX\ run: it
%contains compactly dumped representations of boxes that
%\mdqon
%have been sent there by \cs{shipout}""\gr{box}. The act
%\mdqoff
%of shipping out usually occurs inside the output routine,
%but this is not necessarily so.
The \n{dvi} file (this term stands for `device independent')
\term \n{dvi} file\par
contains the output of a \TeX\ run: it
contains compactly dumped representations of boxes that
\mdqon
have been sent there by \cs{shipout}""\gr{box}. The act
\mdqoff
of shipping out usually occurs inside the output routine,
but this is not necessarily so.
%%\spoint The \n{dvi} file format
%\subsection{The \n{dvi} file format}
%\spoint The \n{dvi} file format
\subsection{The \n{dvi} file format}
%A \n{dvi} file is a byte-oriented file,
%consisting of a preamble, a postamble,
%and a list of pages.
A \n{dvi} file is a byte-oriented file,
consisting of a preamble, a postamble,
and a list of pages.
%Access for subsequent software to a completed \n{dvi} file
%is strictly sequential in nature:
%the pages are stored as a backwards linked list. This
%means that only two ways of accessing are possible:
%\begin{itemize} \item given the start of a page, the next can be
%found by reading until an end-of-page code is encountered, and
%\item starting at the end of the file pages can be read
%backwards at higher speed, as each beginning-of-page code
%contains the byte position of the previous one.\end{itemize}
Access for subsequent software to a completed \n{dvi} file
is strictly sequential in nature:
the pages are stored as a backwards linked list. This
means that only two ways of accessing are possible:
\begin{itemize} \item given the start of a page, the next can be
found by reading until an end-of-page code is encountered, and
\item starting at the end of the file pages can be read
backwards at higher speed, as each beginning-of-page code
contains the byte position of the previous one.\end{itemize}
%The preamble and postamble contain
%\begin{itemize}\item the magnification of the document (see below),
%\item the unit of measurement used for the document, and
%\item possibly a comment string.\end{itemize}
%The postamble contains in addition a list of the font definitions
%that appear on the pages of the file.
The preamble and postamble contain
\begin{itemize}\item the magnification of the document (see below),
\item the unit of measurement used for the document, and
\item possibly a comment string.\end{itemize}
The postamble contains in addition a list of the font definitions
that appear on the pages of the file.
%Neither the preamble nor the postamble
%of the file contains a
%table of byte positions of pages.
%The full definition of the \n{dvi} file format can be found
%in~\cite{Knuth:TeXprogram}.
Neither the preamble nor the postamble
of the file contains a
table of byte positions of pages.
The full definition of the \n{dvi} file format can be found
in~\cite{Knuth:TeXprogram}.
%%\spoint Page identification
%\subsection{Page identification}
%\spoint Page identification
\subsection{Page identification}
%Whenever a \cs{shipout} occurs, \TeX\ also writes the
%values of counters 0--9 to the \n{dvi} file and the terminal.
%Ordinarily, only counter~0, the page number, is used, and the
%other counters are zero. Those zeros are not output to the
%terminal. The other counters can be used to indicate further
%structure in the document. Log output shows the non-zero
%counters and the zero counters in between.
Whenever a \cs{shipout} occurs, \TeX\ also writes the
values of counters 0--9 to the \n{dvi} file and the terminal.
Ordinarily, only counter~0, the page number, is used, and the
other counters are zero. Those zeros are not output to the
terminal. The other counters can be used to indicate further
structure in the document. Log output shows the non-zero
counters and the zero counters in between.
%%\spoint Magnification
%\subsection{Magnification }
%\spoint Magnification
\subsection{Magnification }
%The \indexterm{magnification}
%of a document can be indicated by the \gr{integer
%parameter}
%\cstoidx mag\par
%\cs{mag}, which specifies 1000 times the magnification
%ratio.
The \indexterm{magnification}
of a document can be indicated by the \gr{integer
parameter}
\cstoidx mag\par
\cs{mag}, which specifies 1000 times the magnification
ratio.
%The \n{dvi} file contains the value of \cs{mag} for the
%document in its preamble and postamble.
%If no {\tt true} dimensions are used
%the \n{dvi} file will look the same as when no magnification
%would have been used, except for the \cs{mag} value in the
%preamble and the postamble.
The \n{dvi} file contains the value of \cs{mag} for the
document in its preamble and postamble.
If no {\tt true} dimensions are used
the \n{dvi} file will look the same as when no magnification
would have been used, except for the \cs{mag} value in the
preamble and the postamble.
%Whenever a {\tt true} dimension is used it is divided
%by the value of \cs{mag}, so that the final output will have
%the dimension as prescribed by the user.
%The \cs{mag} parameter cannot be changed after a
%\n{true} dimension has been used, or after the first
%page has been shipped to the \n{dvi} file.
Whenever a {\tt true} dimension is used it is divided
by the value of \cs{mag}, so that the final output will have
the dimension as prescribed by the user.
The \cs{mag} parameter cannot be changed after a
\n{true} dimension has been used, or after the first
page has been shipped to the \n{dvi} file.
%Plain \TeX\ has the \csidx{magnification} macro for
%globally sizing the document, without changing
% the physical size of the page:
%\begin{verbatim}
%\def\magnification{\afterassignment\m@g\count@}
%\def\m@g{\mag\count@
% \hsize6.5truein\vsize8.9truein\dimen\footins8truein}
%\end{verbatim}
%The explanation for this is
%as follows: the command \cs{m@g} is saved with an \cs{afterassignment}
%command, and the magnification value (which is 1000 times the
%actual magnification factor) is assigned to \cs{count@}.
%After this assignment, the macro \cs{m@g} assigns
%the magnification value to \cs{mag}, and the horizontal
%and vertical size are reset to
%their original values {\tt 6.5truein} and {\tt 8.9truein}.
%The \cs{footins} is also reset.
Plain \TeX\ has the \csidx{magnification} macro for
globally sizing the document, without changing
the physical size of the page:
\begin{verbatim}
\def\magnification{\afterassignment\m@g\count@}
\def\m@g{\mag\count@
\hsize6.5truein\vsize8.9truein\dimen\footins8truein}
\end{verbatim}
The explanation for this is
as follows: the command \cs{m@g} is saved with an \cs{afterassignment}
command, and the magnification value (which is 1000 times the
actual magnification factor) is assigned to \cs{count@}.
After this assignment, the macro \cs{m@g} assigns
the magnification value to \cs{mag}, and the horizontal
and vertical size are reset to
their original values {\tt 6.5truein} and {\tt 8.9truein}.
The \cs{footins} is also reset.
%%\point[special] Specials
%\section{Specials}
%\label{special}
%\point[special] Specials
\section{Specials}
\label{special}
%\mdqon
%\TeX\ is to a large degree machine"-independent, but it still needs
%\mdqoff
%a hook for machine-dependent extensions. This is
%done through \indexterm{specials}. The
%\csidx{special} command writes a \gr{balanced text}
%to the \n{dvi} file which \TeX\ does not interpret like other token lists:
%it assumes that the printer driver knows what to do with it.
%The \cs{special} command is not supposed to change the
%$x$ and $y$ position on the page, so that the implementation
%of \TeX\ remains independent of the actual
%\indexterm{device driver}
%that handles the \cs{special}.
\mdqon
\TeX\ is to a large degree machine"-independent, but it still needs
\mdqoff
a hook for machine-dependent extensions. This is
done through \indexterm{specials}. The
\csidx{special} command writes a \gr{balanced text}
to the \n{dvi} file which \TeX\ does not interpret like other token lists:
it assumes that the printer driver knows what to do with it.
The \cs{special} command is not supposed to change the
$x$ and $y$ position on the page, so that the implementation
of \TeX\ remains independent of the actual
\indexterm{device driver}
that handles the \cs{special}.
%The most popular application of specials is probably the
%inclusion of graphic material, written in some
%page description language, such as \indexterm{PostScript}.
%The size of the graphics can usually be determined from
%the file containing it (in the case of encapsulated
%PostScript through
%the `bounding box' data), so \TeX\ can leave space for
%such material.
The most popular application of specials is probably the
inclusion of graphic material, written in some
page description language, such as \indexterm{PostScript}.
The size of the graphics can usually be determined from
the file containing it (in the case of encapsulated
PostScript through
the `bounding box' data), so \TeX\ can leave space for
such material.
%%\point Time
%\section{Time}
%\point Time
\section{Time}
%\TeX\ has four parameters, \csidx{year}, \csidx{month}, \csidx{day}, and
%\csidx{time}, that tell
%the \indexterm{time} and \indexterm{date}
%when the current job started.
%After this, the parameters are not updated.
%The user can change them without this having any effect.
\TeX\ has four parameters, \csidx{year}, \csidx{month}, \csidx{day}, and
\csidx{time}, that tell
the \indexterm{time} and \indexterm{date}
when the current job started.
After this, the parameters are not updated.
The user can change them without this having any effect.
%All four parameters are integers; the \cs{time} parameter
%gives the number of minutes since midnight that the current
%job started.
All four parameters are integers; the \cs{time} parameter
gives the number of minutes since midnight that the current
job started.
%%\point Fonts
%\section{Fonts}
%\point Fonts
\section{Fonts}
%Font information is split in the \TeX\ system into
%the metric information (how high, wide, and deep is a character),
%and the actual description of the characters in a font.
%\TeX, the formatter, needs only the metric information;
%printer drivers and screen previewers need the character
%descriptions. With this approach it is for instance possible
%for \TeX\ to use with relative ease the resident fonts of
%a printer.
Font information is split in the \TeX\ system into
the metric information (how high, wide, and deep is a character),
and the actual description of the characters in a font.
\TeX, the formatter, needs only the metric information;
printer drivers and screen previewers need the character
descriptions. With this approach it is for instance possible
for \TeX\ to use with relative ease the resident fonts of
a printer.
%%\spoint Font metrics
%\subsection{Font metrics}
%\spoint Font metrics
\subsection{Font metrics}
%The metric information of \TeX's fonts is stored in \n{tfm}
%files, which stands for `\TeX\ \indexterm{font metrics}' files.
%Metrics files contain the following information
%(see \cite{Knuth:TeXprogram} for the full definition):
%\begin{itemize}\item the design size of a font;
%\item the values for the \cs{fontdimen} parameters
%(see Chapter~\ref{font});
%\item the height, depth, width, and italic correction
% of individual characters;
%\item kerning tables;
%\item ligature tables;
%\item information regarding successors and extensions
%of math characters (see Chapter~\ref{mathchar}).
%\end{itemize}
%Metrics files use a packed format, but they can be converted
%to and from a readable format by the auxiliary programs
%\n{tftopl} and \n{pltotf} (see~\cite{K:Fuchs}).
%Here \n{pl} stands for `property list',
%a term deriving from the programming language Lisp.
%Files in \n{pl} format are just text, so they can easily be edited;
%after conversion
%they can then again be used as \n{tfm} files.
The metric information of \TeX's fonts is stored in \n{tfm}
files, which stands for `\TeX\ \indexterm{font metrics}' files.
Metrics files contain the following information
(see \cite{Knuth:TeXprogram} for the full definition):
\begin{itemize}\item the design size of a font;
\item the values for the \cs{fontdimen} parameters
(see Chapter~\ref{font});
\item the height, depth, width, and italic correction
of individual characters;
\item kerning tables;
\item ligature tables;
\item information regarding successors and extensions
of math characters (see Chapter~\ref{mathchar}).
\end{itemize}
Metrics files use a packed format, but they can be converted
to and from a readable format by the auxiliary programs
\n{tftopl} and \n{pltotf} (see~\cite{K:Fuchs}).
Here \n{pl} stands for `property list',
a term deriving from the programming language Lisp.
Files in \n{pl} format are just text, so they can easily be edited;
after conversion
they can then again be used as \n{tfm} files.
%%\spoint[virtual:fonts] Virtual fonts
%\subsection{Virtual fonts}
%\label{virtual:fonts}
%\spoint[virtual:fonts] Virtual fonts
\subsection{Virtual fonts}
\label{virtual:fonts}
%With
%\indexterm{virtual fonts}
%(see~\cite{K:virt}) it is possible that
%what looks like one font to \TeX\ resides in more than
%one physical font file. Also, virtual fonts can be used
%to change in effect the internal organization of font files.
With
\indexterm{virtual fonts}
(see~\cite{K:virt}) it is possible that
what looks like one font to \TeX\ resides in more than
one physical font file. Also, virtual fonts can be used
to change in effect the internal organization of font files.
%For \TeX\ itself, the
%presence of virtual fonts makes no difference: everything
%is still based on \n{tfm} files containing metric
%information. However, the screen or printer driver that displays
%the resulting \n{dvi} file on the screen or on a printer
%will search for files with extension \n{.vf} to determine
%how characters are to be interpreted.
%The \n{vf} file can, for instance, instruct the driver
%to interpret a character as a certain position
%in a certain font file, to interpret a character as more
%than one position (a~way of forming accented characters),
%or to include \cs{special} information (for
%instance to set gray levels).
For \TeX\ itself, the
presence of virtual fonts makes no difference: everything
is still based on \n{tfm} files containing metric
information. However, the screen or printer driver that displays
the resulting \n{dvi} file on the screen or on a printer
will search for files with extension \n{.vf} to determine
how characters are to be interpreted.
The \n{vf} file can, for instance, instruct the driver
to interpret a character as a certain position
in a certain font file, to interpret a character as more
than one position (a~way of forming accented characters),
or to include \cs{special} information (for
instance to set gray levels).
%Readable variants of \n{vf} files have extension \n{vpl},
%analogous to the \n{pl} files for the \n{tfm} files; see above.
%Conversion between \n{vf} and \n{vpl} files can be
%performed with the \n{vftovp} and \n{vptovf} programs.
Readable variants of \n{vf} files have extension \n{vpl},
analogous to the \n{pl} files for the \n{tfm} files; see above.
Conversion between \n{vf} and \n{vpl} files can be
performed with the \n{vftovp} and \n{vptovf} programs.
%However, because virtual fonts are a matter for
%\indexterm{device drivers}, no more details will be given in this book.
However, because virtual fonts are a matter for