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
|
{\overfullrule0pt\def\cite#1{[#1]}
% Warning: This is an input file for AMSTeX, rather than for LaTeX.
% This is just so that I can use the commands for arrows
% mentioned on pages 140-141 of "The Joy of TeX".
% It may not be "good AmSTeX", since it's the first time
% I've used AmSTeX seriously!
\title{Could \LaTeXbf\ do more for chemists?}
From time to time I have seen queries in {\TeXhax} and
elsewhere from people who wish to use \LaTeX\ for documents
that involve chemical formulae, etc. Since there are now plans for
\LaTeX\ 3.0 \cite{1},
I thought this might be a good time to consider
what facilities one could reasonably ask the people implementing the new
\LaTeX\ to provide for chemists.
I'm not a chemist myself, but have been involved in helping chemists
use \LaTeX\ 2.09 \cite{2} for producing theses, etc.
\section{Typesetting and artwork}
It may help to consider the division of labour within a traditional
publishing house. A `copy-editor' \cite{3, p236} might divide the work on
chemical formulae up between `the printer' and `the draughtsman'. Thus,
some formulae can be typeset, but others are treated as `artwork' and are
drawn.
Although there have been valiant attempts \cite{4-5} to define \TeX\ macros
for drawing chemical structure diagrams, I think it is inevitable that,
whatever \TeX\ macros are defined, there will be chemists who come along with
requirements that are beyond the abilities of the macro packages. Therefore,
it seems sensible to retain the traditional division between typesetting and
artwork: to typeset those formulae that can be typeset easily and to get the
other formulae drawn in some way.
In \TeX\ terms, artwork can be treated as `graphics' to be
`pasted' into a typeset document via |\special|.
For example, {\sans Chemdraw}
\cite{6} can produce `encapsulated {\PS}',
so a \LaTeX-ed document with {\sans Chemdraw} diagrams can be printed on
a {\PS} printer.
\section{Desirable facilities for chemists}
\LaTeX\ is never going to be a system for producing `artwork',
so it seems to me that it would be unwise to attempt to provide
comprehensive facilities for `chemical artwork' in \LaTeX. However, it does
seem worth providing a limited number of facilities to make it
easier to produce the chemical formulae that should be
treated as `typesetting'.
\subsection{Environments}
Chemists' problems start when they use \LaTeX's `mathematics'
environments for `chemistry'. Chemistry is not mathematics, and
the conventions for typesetting chemistry are different from those for
typesetting mathematics. In terms of the \LaTeX\ philosophy \cite{2, p6},
`mathematics' and `chemistry' represent `logically distinct structural
elements'.
It would seem natural to:
\bi define environments for chemists that are
analogous to the environments that are available for mathematicians
\bi within these `chemistry' environments, aim to keep to
whatever typesetting conventions are usual in chemistry.
\noindent
How about defining {\tt chem}, {\tt displaychem} and {\tt chem\-equation}
environments,
by analogy with {\tt math}, {\tt displaymath} and {\tt equation}?
If such environments were defined, the style-file writer would then
have control over `mathematics' and `chemistry' separately.
In particular:
\bi The default would be {|\rm|} for chemistry (although
a designer could change the default in a {\tt .sty} file).
Individual
authors would no longer have to search through
``double bend'' sections of the \TB\ themselves
\cite{7, pp163 \& 179}.
\bi A designer could implement a house-style in which
mathematical and chemical equations are numbered in separate
sequences \cite{3, p224} or a house-style in which there is only one
sequence of numbers \cite{8, p32}.
\bi It might be possible to arrange that subscripts will normally be
at the same level \cite{7, p179} inside the environments
for chemistry.
\subsection{Commands}
At first sight, the \LaTeX\ manual \cite{2, ch.\ 3} gives the impression that
\LaTeX\ 2.09 provides the `building blocks' to give all the arrows,
harpoons and annotation that a chemist could want. However, it is often
difficult to get these building blocks arranged in the ways required.
For example:
\bi How does one obtain CH${_3}$(C=O)OCl \cite{3, p235} in `math mode'?
We can't
use `='
to mean ``double bond'', since \TeX\ puts space
around it.
\bi To represent a reversible reaction with rate constants above\slash below
a pair of harpoons, I ended up with
\begintt
\renewcommand{\arraystretch}{0.5}
A \begin\{array}{c}
\scriptstyle k_1\\[1mm]
\rightleftharpoons\\
\scriptstyle k\_2
\end{array} B
\endtt
before it looked right. Surely individual \LaTeX\ users shouldn't have
to re-do the `tuning' needed to get these things right?
\bi As in the above example, arrows and harpoons are often labelled to show
reaction conditions. It is not clear how to get
arrows\slash harpoons that expand to the width of the labels.
\noindent Many of these difficulties are another consequence of trying to
use, for chemistry, the structural elements that were designed for
mathematics.
So what commands might usefully be made available inside some future
`chemistry' environments?
It seems desirable \cite{3, p237} to have documented facilities for
single and double bonds. Triple bonds might also be needed \cite{9}.
A documented facility for representing single
bonds by raised dots would also be useful \cite{10, p59}.
Might commands such as |\bond|, |\doublebond| and
|\triplebond|
be appropriate?
It seems desirable to have specific commands for typesetting
arrows\slash harpoons with labels above\slash below (to indicate conditions or
rate constants). An indication of the combinations
of arrows\slash harpoons that have been typeset traditionally is given
in \cite{11,~p371}. Thus, as well as providing simple arrows for one-way
reactions, it might be worth aiming to provide commands for: equilibrium
reactions (beginning at left and right); reversible reactions (beginning at
left and right); reactions beginning at left\slash right and completed to
left\slash right. Might it be worth defining some commands such as
\centerline{\vbox{\tt\halign{\char'134#\quad&\char'134#\cr
oneway\cr
equilibriumR &equilibriumL\cr
reversibleR &reversibleL\cr
rightright &rightleft\cr
leftright &leftleft\cr
}}}
\noindent that each accept two parameters: one to give a label
above the symbol, the other to give a label below the symbol?
For example,
\begintt
\begin{chem}
2H_2 + O_2
\oneway{catalyst}{300 K; 4 bar} 2 H_2O
\end{chem}
\endtt
might be a natural way to specify
% This is the line that contains the command that made me use AMSTeX.
% I couldn't find anything else ready-made in plain TeX or LaTeX.
\newdimen\bigaw
\def\oneway>#1>#2>{%
\setbox0\hbox{$\scriptstyle#1$}
\setbox1\hbox{$\scriptstyle#2$}
\bigaw\wd0\ifdim\wd1>\bigaw\bigaw\wd1\fi
\mathrel{\mathop{\hbox
to\bigaw{\rightarrowfill}}\limits^{#1}_{#2}}}
$${\rm2H}_2 + {\rm O}_2
\oneway >{\rm catalyst} > {\rm 300 K; 4 bar} >
{\rm 2H}_2{\rm O}
$$
\section{Work involved}
I'd guess that my suggestions about environments could be implemented
by slight modications of the code that implements the corresponding
environments for mathematics.
Some new work would be required for commands such as |\oneway|,
\dots\ , |\leftleft|. The only similar facility that I've found
in an existing macro package is that for arrows in \AmSTeX\ \cite{12, p140},
but (from a chemist's point-of-view) this doesn't provide sufficient
choice of symbols.
It might be worth seeking advice about objectives
from people who typeset chemistry professionally.
% Perhaps the UK's Royal Society of Chemistry would be prepared to advise
% about details. I've been in e-mail correspondence with their Publications
% Manager about authors submitting mansuscripts electronically to them,
% although they seem to be going the wordprocessor + chemdraw + SGML route.
\section{Documentation}
If the facilities that I've outlined above were provided, I would
be inclined to give them less prominence in the documentation than
the analogous facilities for mathematicians. This would help
give the impression that, whereas mathematicians can expect \LaTeX\
to do everything they want, chemists can only expect \LaTeX\ to do a certain
proportion of what they want.
For example, in the successor to \cite{2}, the description of facilities for
chemists might be relegated to an appendix, which could start with a
paragraph explaining that the facilities are intended to support
`typesetting' but not `artwork'.
\section{Bibliography}{\parindent0pt\frenchspacing\raggedright
\everypar{\hangafter1\hangindent20pt}
\par
[1] Frank Mittelbach and Rainer Sch\"opf, 1989,
With \LaTeX\ into the Nineties
TUGboat 10,
681--690.
[2]
Leslie Lamport, 1986,
\LaTeX: A Document Preparation System,
Addison-Wesley.
[3]
Judith Butcher, 1981,
Copy-editing
Cambridge University Press,
[4]
Roswitha T. Haas and Kevin C. O'Kane, 1987,
Typesetting chemical structure formulae with the text formatter
\TeX\slash \LaTeX,
Computers and Chemistry 11,
251-271.
[5]
Michael Ramek, 1990,
Chemical structure formulae and $x/y$ diagrams with \TeX\ {\it in:}
\TeX: applications, uses, methods, Malcolm Clark (editor),
Ellis Horwood.
[6]
{\sans Chemdraw} (A program for the Macintosh),
Cambridge Scientific Computing,
Cambridge, Massachusetts.
%
[7]
Donald E. Knuth, 1986,
The \TeX book,
Addison-Wesley.
[8]
Janet S. Dodd, 1986,
The ACS Style Guide
American Chemical Society
[9]
Handbook for Chemical Society Authors, 1961,
The Chemical Society
[10]
Hart's Rules, 1983,
Oxford University Press
1983
[11]
Chicago Manual of Style, 1982,
Chicago University Press
% \publaddr Chicago
[12]
Michael Spivak, 1986,
The Joy of \TeX,
American Mathematical Society
}}
%
\author{David Rhead}
|