-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrootagfa.tex
114 lines (98 loc) · 3.63 KB
/
rootagfa.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
% this is file `root', the root of the whole semantics
\documentstyle[a4,12pt,twoside]{article}
\title{The Definition of Standard ML\\ Version 3}
\author{Robert Harper \and Robin Milner \and Mads Tofte \\
Laboratory for Foundations of Computer Science\\
Department of Computer Science\\
University of Edinburgh\\
Edinburgh EH9 3JZ, Scotland}
\date{1 May 1989}
\include{mac} % macros
\makeindex
%
%\includeonly{syncor}
\voffset -12mm
\begin{document}
\pagestyle{empty}
\maketitle
\cleardoublepage
\pagestyle{plain}
\setcounter{page}{3}
\renewcommand{\thepage}{\roman{page}}
\include{preface3}
\include{preface2}
\include{preface1}
\tableofcontents
\cleardoublepage
\pagestyle{headings}
\setcounter{page}{1}
\renewcommand{\thepage}{\arabic{page}}
\include{intro}
\include{syncor}
\include{synmod}
\include{statcor}
\include{statmod}
\include{dyncor}
\include{dynmod}
\include{prog}
\appendix
\include{app1}
\include{app2}
\include{app3}
\include{app4}
\include{app5}
\include{index}
\end{document}
HOW TO REVISE THE INDEX
The index is made using partly LaTex and partly an ML progam;
the latter is found on the file ``index.ml''.
When LaTex is run on input ``root.tex'' it produces a file ``root.idx''.
Each line in this file is of the form
\indexentry{idxkey}{pageref}
where idxkey is a key inserted precisely one place in the document
(in the form of a LaTex command \index{idxkey})
and pageref is the page number of the page LaTex was printing
by the time it encountered the \index{idxkey} command.
A typical idxkey is 45.1 , which will occur in the TeX file
somewhere near what produces page 45 in the final document.
In fact, when the keys were first inserted in the TeX file,
45.1 would be the first key on page 45, but as the document changes,
one cannot get the pageref from the idxkey simple by taking the
prefix of the idxkey up to the full stop.
There are many entries in the index that refer to the same
idxkey. Thus the number of idxkeys has been kept relatively
small, typically 2 or 3 pr page. The basic idea, then, is that
there is an ML program (on file ``index.ml'') which
associates entries in the final index with idxkeys by
a sequence of expressions
.......
item ``handle'' [p``45.4'',``57.3''to``59.1'',p``78.2''];
item ``{\\it happiness}'' [p''38.1''];
......
The program will first build a conversion table from idxkeys
(such as ``45.4'') to page references by reading thrugh
``root.idx''. Then it will evaluate all the item and subitem
expressions. The item function produces a line in the
latex file (``index.tex'') using the conversion table.
Thus the above lines may produce
...........
\item ``handle'' 46, 57--58, 78
\item {\it happiness} 38
...........
If insertion of more text in the source files result in
new page splits, then one should manually check that
the item expressions in ``index.ml'' refer to the
right idxkeys. It may be necessary to change some of the
lists in the item expressions and it may be desirable to
insert new \index commands in the source text. However,
if we for simplicity assume that we simply insert new
material corresponding to a new chapter (not affecting
the page splits in other chapters) then one would proceed
as follows:
First add new item expressions in the index.ml file corre-
sponding to new entries in the index (one will have new
\index commands in the new input, of course). Then one
runs latex on ``root.tex'' to produce the ``root.idx'' file.
Then one runs index.ml (enter ML and type use ``index.ml'').
Then one runs latex on root again, this time giving the
correct index.