summaryrefslogtreecommitdiff
path: root/info/digests/texline/no14/article.tex
blob: 22e08f30c7ee6022fef687588ef5d421e24717c3 (plain)
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

\title{Notes on graphics in \TeX}
Getting pictures onto the printed page is a problematic process, 
basically because the quality you can achieve depends so heavily on 
the cost of the hardware at your disposal. This militates against 
portability, and is one of the reasons why \TeX\ (the ultimately 
portable DTP system) has trouble with graphics. What follows is 
in no sense state-of-the-art graphics typesetting. It is simply an 
account of how a \TeX\ {\it user}, having a variety of types of 
picture and needing to transport files between different machines, 
came up with some {\it ad hoc} solutions. Probably nobody else will
have exactly the same requirements as I had, but the opportunities
may have wider relevance.

\section{Diagrams}
There is a deep structure underlying large areas of mathematics, and 
manifesting itself in various ways, which is conventionally described 
by diagrams called {\it Coxeter-Dynkin diagrams}. Most of these 
consist of a number of nodes in a line, consecutive nodes joined by 
single or double bonds. However, there are some diagrams which have a 
three-way branch (one of the arms having length~1), such as $E_6$, 
which looks like this:
$$\esix$$
The straight-line diagrams can be drawn easily enough, using the 
{\tt\char`\\circ} character for nodes and rules for the arcs joining them.
I found that some kerning was necessary. This had to be done by trial 
and error, with the disadvantage that what looks right on the screen 
may not do so on the laser printer (presumably a defect in the \dvi\ 
drivers). Perhaps this could be improved by turning off the glue; but 
I decided that what I had was good enough.

Recently, geometers have begun using these and similar diagrams to 
describe strange new geometries. It has become customary to attach 
labels to both nodes and arcs; in the case of nodes, different labels 
above and below carry different information. In Norbert Schwarz's {\sl
Introduction to \TeX\ }[2], I found a macro for optional arguments.
(There it is also used for superscripts and subscripts, though the 
details of the printing are a bit different). Using it, I can print 
diagrams like this one (a bit cluttered, for demonstration purposes):
$$\node^{\rm point}_s \darc \node^{\rm line}_t \arc 
\node^{\rm quad}_q \stroke{L} \node^{\rm symp}_r$$
Here, the superscripts and subscripts on the nodes are entered in the 
standard \TeX\ manner: for example, the input for the above diagram is
\begintt
$$\node^{\rm point}_s \darc 
  \node^{\rm line}_t  \arc 
  \node^{\rm quad}_q  \stroke{L} 
  \node^{\rm symp}_r$$
\endtt

This also enables the production of the three-way branching diagrams 
like $E_6$; just subscript a node with a little construction 
consisting of a vertical line with a node at the end.

It's not perfect. Better kerning, and the possibility of changing 
the node character (e.g.\ to a filled or crossed circle) would be 
desirable.



\section{Figures}
Elementary geometry requires figures consisting of lines and circles 
intersecting in various ways. Graph theory needs figures a bit like 
the diagrams just discussed, but with much greater flexibility about 
where the nodes are placed and the slopes of the lines.

\LaTeX\ provides a {\tt picture} environment for drawing such 
diagrams. It doesn't handle circles adequately (only very small sizes are
available), but accurate lines are drawn. The difficulty is the famous
restriction on the slopes of the lines. Any line which is not 
horizontal or vertical must have rational slope with numerator and 
denominator between 1 and 6 inclusive (possibly negative). Thus, just 
48 slopes are allowed.

For simple pictures, this is OK: draw the picture in rough, choose 
slopes for the lines from the allowed set, and then work out where the
points must be, by elementary coordinate geometry. There are a couple 
of programs available which take all the calculation out: you draw 
your picture using the mouse, and it is automagically compiled into 
\LaTeX\ source. But for more complicated figures, mathematical insight
or computational power may be required. For example, consider the 
following ruled quadric.


$$\hbox{%
\setlength{\unitlength}{0.02mm}
\picture(1200,1800)(-600,-100)
\put(707,-141){\Line(0,1){1697}}
\put(-707,-141){\Line(0,1){1697}}
\put(-834,-110){\Line(1,6){282}}
\put(834,-110){\Line(-1,6){282}}
\put(-552,-167){\Line(-1,6){282}}
\put(552,-167){\Line(1,6){282}}
\put(-929,-74){\Line(1,3){558}}
\put(929,-74){\Line(-1,3){558}}
\put(-371,-186){\Line(-1,3){558}}
\put(371,-186){\Line(1,3){558}}
\put(-986,-33){\Line(1,2){822}}
\put(986,-33){\Line(-1,2){822}}
\put(-164,-197){\Line(-1,2){822}}
\put(164,-197){\Line(1,2){822}}
\put(69,-200){\Line(-2,3){1067}}
\put(-69,-200){\Line(2,3){1067}}
\put(-998,14){\Line(2,3){1067}}
\put(998,14){\Line(-2,3){1067}}
\put(1000,0){\Line(-5,6){1338}}
\put(-1000,0){\Line(5,6){1338}}
\put(338,-188){\Line(-5,6){1338}}
\put(-338,-188){\Line(5,6){1338}}
\put(924,-76){\Line(-1,1){1631}}
\put(-924,-76){\Line(1,1){1631}}
\put(707,-141){\Line(-1,1){1631}}
\put(-707,-141){\Line(1,1){1631}}
\endpicture}$$

The obvious way to draw this is to take two horizontal circles, one 
above the other; take equally spaced points on one, and join them to 
the points a fixed angle in front or behind on the other, and then 
work out the plane projection in the usual way. With \LaTeX, it is 
necessary to work out a formula for the angle which will give the 
projected line a given slope, and solve it for various admissible 
slopes.

An added complication here is that my first serious use of this 
mechanism was for a book [1] for which my co-author sent me his part
(by email) in \AmSTeX. Converting it to plain \TeX\ was straightforward,
but took time; I was not prepared to take the further step to 
\LaTeX. Malcolm Clark had told me that it was easy enough to convert 
the \LaTeX\ picture commands to plain \TeX; I couldn't find his 
version in the Aston archive, so I took him at his word and did it 
myself. Look at the book and judge the result!

I learnt too late that \PiCTeX\ might have helped me here. But I 
believe that simpler tools have their place.

\section{Pictures}
Suppose you want to include in your document a picture not made up of 
geometric elements. If you are a \PS\ programmer or a \dvi\ 
wizard, anything is possible; but the result will not be portable. I 
would like to be able to preview, print in draft on a 9-pin dot matrix
printer, and send the file over the network to the laser printer.

My terminal and my machine at home are both Atari STs. The commonest 
picture format for DTP on this machine, also used in the PC world, is 
the dreaded {\tt.img}. After combing the public domain for information on 
the {\tt.img} file format, I wrote a program to translate a {\tt.img} file into 
\TeX\ input consisting of long sequences of boxes and rules.

It doesn't work on all inputs (I've never met anyone who claims to 
have a program which handles all {\tt.img} files!), but seems fine on mono 
screen snapshots. The \TeX\ file is liable to be very big, so this is 
only recommended for small images (logos, signatures, etc.) The result
is (of course) as portable as any plain \TeX\ input, and can be re-%
scaled by setting two pixel size parameters at the start of the file. 
Here, for example, is an image probably familiar to all GEM-based 
computer users.

\input tiger
$$\tiger$$

{\frenchspacing
\def\item#1{\par\hangindent1.5em\hangafter1{\noindent
\hbox to 1.5em{#1\hfil}}}
\def\bibitem#1#2{\item{{#1}}{#2}}
\section{Bibliography}
\bibitem{1}{{\sc P J Cameron \& J H van Lint,} {\sl Designs, Graphs, Codes and their
Links}, London Math. Soc. Student Texts {\bf 22}, Cambridge Univ. Press,
1991.}
\bibitem{2}{{\sc Norbert Schwarz,} {\sl Introduction to \TeX}\ (transl. {\sc J Krieger}),
Addison-Wesley, 1990.}
\author{Peter Cameron}}


\endinput Cameron}
}


\endinput90.}}

\author{Peter Cameron}
\endinputtle to be very big, so this is 
only recommended for small images (logos, signatures, etc.) The result
is (of course) as portable as any plain \TeX\ input, and can be re-%
scaled by setting two pixel size parameters at the start of the file. 
Here, for example, is an image probably familiar to all GEM-based 
computer users.

\input tiger

$$\tiger$$

\medbreak

\noindent{\sl References}
\frenchspacing

1. P. J. Cameron \& J. H. van Lint, {\sl Designs, Graphs, Codes and their
Links}, London Math. Soc. Student Texts {\bf 22}, Cambridge Univ. Press,
1991.

2. N. Schwarz, {\sl Introduction to \TeX}\ (transl. J. Krieger),
Addison-Wesley, 1990.

\medskip

\line{\hfill\sl Peter Cameron}

\bye