Received: by nummer-3.proteosys id <01C19442.D545E96C@nummer-3.proteosys>; Thu, 3 Jan 2002 11:38:50 +0100 MIME-Version: 1.0 x-vm-v5-data: ([nil nil nil nil nil nil nil t nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19442.D545E96C" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: Facilities for chemists. Run this through AMSTeX. Date: Wed, 24 Oct 1990 15:08:31 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: Sender: "LaTeX-L Mailing list" To: "Rainer M. Schoepf" Reply-To: "LaTeX-L Mailing list" Status: R X-Status: X-Keywords: X-UID: 246 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19442.D545E96C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable % 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! \documentstyle{amsppt} \define\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\smc a}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \define\itlatex{L\kern-.30em\raise.3ex\hbox{\it A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.100emX} % for use in = "references" \define\bs{\char'134} \document \topmatter \title Could \LaTeX\ do more for chemists? \endtitle \author David Rhead \endauthor \affil Nottingham University \endaffil \endtopmatter \nologo \NoBlackBoxes \heading Introduction \endheading From time to time I have seen queries in {\tt 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. \heading Typesetting and artwork \endheading It may help to consider the division of = labour within a traditional publishing house. A ``copy-editor'' \cite{3, p.\ 236} 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 {\tt \bs special}. For example, {\smc chemdraw} \cite{6} can produce ``encapsulated {\smc PostScript}'', so a \LaTeX-ed document with {\smc chemdraw} diagrams can be printed on a {\smc PostScript} printer. \heading Desirable facilities for chemists in the new \LaTeX \endheading \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''. \subheading{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, = p.\ 6}, ``mathematics'' and ``chemistry'' represent ``logically distinct = structural elements''. It would seem natural to: \roster \item define environments for chemists that are analogous to the environments that are available for = mathematicians \item within these ``chemistry'' environments, aim to keep to whatever typesetting conventions are usual in chemistry. \endroster How about defining {\tt chem}, {\tt displaychem} and {\tt chemequation} 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: \roster \item The default would be {\tt \bs 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 \TeX book themselves \cite{7, pp. 163 \& 179}. \item A designer could implement a house-style in which mathematical and chemical equations are numbered in separate sequences \cite{3, p.\ 224} or a house-style in which there is = only one sequence of numbers \cite{8, p.\ 132}. \item It might be possible to arrange that subscripts will normally be at the same level \cite{7, p.\ 179} inside the environments for chemistry. \endroster \subheading{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: \roster \item How does one obtain CH${_3}$(C=3DO)OCl \cite{3, p.\ 235} in ``math = mode''? We can't use ``=3D'' to mean ``double bond'', since \TeX\ puts space around it. \item To represent a reversible reaction with rate constants above/below a pair of harpoons, I ended up with {\tt \newline \bs[ \newline \bs renewcommand\{\bs arraystretch\}\{0.5\} \newline A \bs begin\{array\}\{c\} \newline \bs scriptstyle k\_1 \bs\bs [1mm] \newline \bs rightleftharpoons \bs\bs \newline \bs scriptstyle k\_2 \newline \bs end\{array\} B \newline \bs] \newline } before it looked right. Surely individual \LaTeX\ users shouldn't = have to re-do the ``tuning'' needed to get these things = right? \item As in the above example, arrows and harpoons are often labelled to show reaction = conditions. It is not clear how to get arrows/harpoons that expand = to the width of the labels. \endroster 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? \roster \item It seems desirable \cite{3, p.\ 237} 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, p.\ 59}. Might commands such as {\tt \bs bond}, {\tt \bs doublebond} and {\tt \bs triplebond} be appropriate? \item It seems desirable to have specific commands for typesetting = arrows/harpoons with labels above/below (to indicate conditions or rate constants). \cite{11, p.\ 371} gives an indication of the combinations of arrows/harpoons that might have traditionally been typeset. 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/right and completed to left/right. Might it be worth defining some commands such as {\tt \bs oneway}, {\tt \bs equilibriumR}, {\tt \bs equilibriumL}, {\tt \bs reversibleR}, {\tt \bs reversibleL}, {\tt \bs rightright}, {\tt \bs rightleft}, {\tt \bs leftright}, {\tt \bs leftleft}, that each accept two parameters: one to give a = label above the symbol, the other to give a label below the symbol? For example, {\tt \newline \bs begin\{chem\} \newline \quad 2H\_2 + O\_2 \bs oneway\{catalyst\}\{300 K; 4 bar\} 2 H\_2O = \newline \bs end\{chem\} \newline } 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. \text{2H}_2 + \text{O}_2 @> \text{catalyst} > \text{300 K; 4 bar} > \text{2H}_2\text{O} $$ \endroster \heading Work involved \endheading 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 {\tt \bs oneway}, \dots\ , {\tt \bs leftleft}. The only similar facility that I've found in an existing macro package is that for arrows in \AmSTeX\ \cite{12, = p.\ 140}, 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. \heading Documentation \endheading 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''. \Refs % \ref \no 1 % Sorry about the lack of umlaut. \: gives an error here. \by Frank Mittelbach and Rainer Schopf \paper With \itlatex\ into the Nineties \jour TUGboat \vol 10 \yr 1989 \pages 681--690 \endref % \ref \no 2 \by Leslie Lamport \book \LaTeX: A Document Preparation System \publ Addison-Wesley \yr 1986 \endref % \ref \no 3 \by Judith Butcher \book Copy-editing \publ Cambridge University Press % \publaddr Cambridge \yr 1981 \endref % \ref \no 4 \by Roswitha T. Haas and Kevin C. O'Kane \paper Typesetting chemical structure formulae with the text formatter \TeX/\itlatex \yr 1987 \vol 11 \jour Computers and Chemistry \pages 251-271 \endref % \ref \no 5 % How does one do "inproceedings" in AmSTeX? \by Michael Ramek \book Chemical structure formulae and $x/y$ diagrams with \TeX''. {\rm = In:} {\rm Malcolm Clark (editor).} ``\TeX: applications, uses, methods \publ Ellis Horwood % \publaddr London \yr 1990 \endref % \ref \no 6 \book CHEMDRAW (A program for the Macintosh) \publ Cambridge Scientific Computing \publaddr Cambridge, Massachusetts \endref % \ref \no 7 \by Donald E. Knuth \book The \TeX book \publ Addison-Wesley \yr 1986 \endref % \ref \no 8 \by Janet S. Dodd \book The ACS Style Guide \publ American Chemical Society % \publaddr Washington, DC \yr 1986 \endref % \ref \no 9 \book Handbook for Chemical Society Authors \publ The Chemical Society \yr 1961 \endref % \ref \no 10 \book Hart's Rules \publ Oxford University Press \yr 1983 \endref % \ref \no 11 \book Chicago Manual of Style \publ Chicago University Press % \publaddr Chicago \yr 1982 \endref % \ref \no 12 \book The Joy of \TeX \by Michael Spivak \publ American Mathematical Society \yr 1986 \endref % \enddocument ------_=_NextPart_001_01C19442.D545E96C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Facilities for chemists. Run this through AMSTeX.

%  Warning:  This is an input file for = AMSTeX, rather than for LaTeX.
%          &nb= sp; This is just so that I can use the commands for arrows
%          &nb= sp; mentioned on pages 140-141 of "The Joy of TeX".
%          &nb= sp; It may not be "good AmSTeX", since it's the first = time
%          &nb= sp; I've used AmSTeX seriously!
\documentstyle{amsppt}

\define\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\smc = a}\kern-.15em
      = T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\define\itlatex{L\kern-.30em\raise.3ex\hbox{\it = A}\kern-.15em
       = T\kern-.1667em\lower.7ex\hbox{E}\kern-.100emX}  % for use in = "references"
\define\bs{\char'134}

\document

\topmatter
\title Could  \LaTeX\ do more for chemists? = \endtitle
\author David Rhead \endauthor
\affil Nottingham University \endaffil
\endtopmatter

\nologo
\NoBlackBoxes

\heading Introduction \endheading

>From time to time I have seen queries in {\tt = 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.

\heading Typesetting and artwork \endheading

It may = help           &nb= sp;   to consider    = the           &nbs= p; division of labour
within a traditional publishing house.  A = ``copy-editor''
\cite{3, p.\ 236} 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 {\tt \bs = special}.
For example,
{\smc chemdraw}
\cite{6} can produce ``encapsulated {\smc = PostScript}'',
so a \LaTeX-ed document with {\smc chemdraw} diagrams = can be printed on
a {\smc PostScript} printer.

\heading Desirable facilities for chemists in the new = \LaTeX \endheading

\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''.

\subheading{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, p.\ 6},
``mathematics'' and ``chemistry'' represent = ``logically distinct structural
elements''.

It would seem natural to:
\roster
\item define environments for chemists that = are
      analogous to the = environments that are available for mathematicians
\item within these ``chemistry'' environments,  = aim to keep to
      whatever typesetting = conventions are usual in chemistry.
\endroster
How about defining {\tt chem}, {\tt displaychem} and = {\tt chemequation}
 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:
\roster
\item The default would be {\tt \bs 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 \TeX book themselves
      \cite{7, pp. 163 = \& 179}.
\item A designer could implement a house-style  = in which
      mathematical and = chemical equations are numbered in separate
      sequences \cite{3, p.\ = 224} or a house-style in which there is only one
      sequence of numbers = \cite{8, p.\ 132}.
\item It might be possible to arrange that subscripts = will normally be
      at the same level = \cite{7, p.\ 179} inside the environments
      for chemistry.
\endroster

\subheading{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:
\roster
\item How does one obtain CH${_3}$(C=3DO)OCl \cite{3, = p.\ 235} in ``math mode''?
      We can't
      use ``=3D''
      to mean ``double = bond'', since \TeX\ puts space
      around it.
\item To represent a reversible reaction with rate = constants above/below
      a pair of harpoons, I = ended up with
      {\tt  = \newline
      \bs[  = \newline
      \bs renewcommand\{\bs = arraystretch\}\{0.5\}  \newline
      = A     \bs begin\{array\}\{c\}  \newline
          &nbs= p; \bs scriptstyle k\_1      \bs\bs  = [1mm]  \newline
          &nbs= p; \bs rightleftharpoons     \bs\bs  = \newline
          &nbs= p; \bs scriptstyle k\_2  \newline
          &nbs= p; \bs = end\{array\}          &= nbsp;      B  \newline
      \bs]  = \newline
      }
      before it looked = right.  Surely individual \LaTeX\ users shouldn't have
      to re-do the = ``tuning''      needed to get these = things         right?
\item As in the above example,
      arrows and harpoons = are often labelled  to show reaction conditions.
      It is not clear how to = get            = arrows/harpoons that expand to the
      width of the = labels.
\endroster
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?
\roster
\item
It seems desirable \cite{3, p.\ 237} 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, = p.\ 59}.
Might commands such as {\tt \bs = bond},    {\tt \bs doublebond} and
{\tt \bs triplebond}
be appropriate?
\item
It seems desirable to have specific commands for = typesetting arrows/harpoons
with labels above/below (to indicate conditions or = rate
constants).  \cite{11, p.\ 371} gives an = indication of the combinations
of arrows/harpoons that might have traditionally been = typeset.
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/right and completed to = left/right.
Might it be worth defining some commands such = as
{\tt \bs oneway},
{\tt \bs equilibriumR},
{\tt \bs equilibriumL},
{\tt \bs reversibleR},
{\tt \bs reversibleL},
{\tt \bs rightright},
{\tt \bs rightleft},
{\tt \bs leftright},
{\tt \bs leftleft}, that each accept two = parameters:  one to give a label
above the symbol, the other to give a label below the = symbol?
For example,
{\tt  \newline
\bs begin\{chem\}  \newline
\quad 2H\_2 + O\_2 \bs oneway\{catalyst\}\{300 K; 4 = bar\}    2 H\_2O  \newline
\bs end\{chem\}  \newline
}
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.
\text{2H}_2 + \text{O}_2
      @> \text{catalyst} = > \text{300 K; 4 bar} >
          &nbs= p; \text{2H}_2\text{O}
$$
\endroster

\heading Work involved \endheading

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 = {\tt \bs oneway},
\dots\ , {\tt \bs leftleft}.  The only similar = facility that I've found
in an existing macro package is that for arrows in = \AmSTeX\ \cite{12, p.\ 140},
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.

\heading Documentation \endheading

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.         &nbs= p;  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''.

\Refs
%
\ref \no 1
%  Sorry about the lack of umlaut.  \: = gives an error here.
\by Frank Mittelbach and Rainer Schopf
\paper With \itlatex\ into the Nineties
\jour TUGboat \vol 10 \yr 1989
\pages 681--690
\endref
%
\ref \no 2
\by Leslie Lamport
\book \LaTeX: A Document Preparation System
\publ Addison-Wesley
\yr 1986
\endref
%
\ref \no 3
\by Judith Butcher
\book Copy-editing
\publ Cambridge University Press
%  \publaddr Cambridge
\yr 1981
\endref
%
\ref \no 4
\by Roswitha T. Haas and Kevin C. O'Kane
\paper Typesetting chemical structure formulae with = the text formatter
      \TeX/\itlatex
\yr 1987 \vol 11
\jour Computers and Chemistry
\pages 251-271
\endref
%
\ref \no 5
%  How does one do "inproceedings" in = AmSTeX?
\by Michael Ramek
\book Chemical structure formulae and $x/y$ diagrams = with \TeX''.  {\rm In:}
      {\rm Malcolm Clark = (editor).}
      ``\TeX: applications, = uses, methods
\publ Ellis Horwood
%  \publaddr London
\yr 1990
\endref
%
\ref \no 6
\book CHEMDRAW (A program for the Macintosh)
\publ Cambridge Scientific Computing
\publaddr Cambridge, Massachusetts
\endref
%
\ref \no 7
\by Donald E. Knuth
\book The \TeX book
\publ Addison-Wesley
\yr 1986
\endref
%
\ref \no 8
\by Janet S. Dodd
\book The ACS Style Guide
\publ American Chemical Society
%  \publaddr Washington, DC
\yr 1986
\endref
%
\ref \no 9
\book Handbook for Chemical Society Authors
\publ The Chemical Society
\yr 1961
\endref
%
\ref \no 10
\book Hart's Rules
\publ Oxford University Press
\yr 1983
\endref
%
\ref \no 11
\book Chicago Manual of Style
\publ Chicago University Press
%  \publaddr Chicago
\yr 1982
\endref
%
\ref \no 12
\book The Joy of \TeX
\by Michael Spivak
\publ American Mathematical Society
\yr 1986
\endref
%
\enddocument

------_=_NextPart_001_01C19442.D545E96C--