Received: by nummer-3.proteosys id <01C19442.D63A6C6C@nummer-3.proteosys>; Thu, 3 Jan 2002 11:38:52 +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.D63A6C6C" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: Facilities for chemists: LaTeX equivalent of AMSTeX file Date: Thu, 25 Oct 1990 18:49:08 +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: 257 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19442.D63A6C6C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable % LaTeX 2.09 version. Differences from the AMSTeX version are that: % * I've introduced \association % * in the example at the end of section 3.2, I've used displaychem, % and the arrow isn't the right length. (Trying to get this arrow % the right length was why I used AMSTeX before.) % * a few changes in wording. \documentstyle[11pt]{article} \newcommand{\AmSTeX} {$\cal A$\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em$\cal = S$-\TeX} \newcommand{\itlatex}% {L\kern-.30em\raise.3ex\hbox{\footnotesize\it A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.100emX} % for use in = "references" \begin{document} \title{Could \LaTeX\ do more for chemists?} \author{David Rhead \\ Nottingham University } \date{} \maketitle \section{Introduction} 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{frank}, 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{leslie} 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[p.\ 236]{judith} 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{roswitha,michael-r} 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 \verb+\special+. For example, {\sc chemdraw} \cite{CSC} can produce ``encapsulated {\sc PostScript}'', so a \LaTeX-ed document with {\sc chemdraw} diagrams can be printed on a {\sc PostScript} printer. \section{Desirable facilities for chemists in the new \protect\LaTeX} \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[p.\ 6]{leslie} ``mathematics'' and ``chemistry'' represent ``logically distinct = structural elements''. It would seem natural to: \begin{itemize} \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. \end{itemize} 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: \begin{itemize} \item The default would be \verb+\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[pp.\ 163 \& 179]{don}. \item A designer could implement a house-style in which mathematical and chemical equations are numbered in separate sequences \cite[p.\ 224]{judith} or a house-style in which there is only one sequence of numbers \cite[p.\ 132]{janet}. \item It might be possible to arrange that subscripts will normally be at the same level \cite[p.\ 179]{don} inside the environments for chemistry. \end{itemize} \subsection{Commands} At first sight, the \LaTeX\ manual \cite[ch.\ 3]{leslie} 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: \begin{itemize} \item How does one obtain CH${_3}$(C=3DO)OCl \cite[p.\ 235]{judith} in ``math mode''? We can't simply 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 \begin{verbatim} \[ \renewcommand{\arraystretch}{0.5} A \begin{array}{c} \scriptstyle k\_1 \\ [1mm] \rightleftharpoons \\ \scriptstyle k\_{-1} \end{array} B \] \end{verbatim} 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. \end{itemize} 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? \begin{itemize} \item It seems desirable \cite[p.\ 237]{judith} to have documented facilities for single and double bonds. Triple bonds might also be needed \cite{chemsoc}. Documented facilities would also be useful for representing \begin{itemize} \item single bonds by raised dots \cite[p.\ 59]{hart} \item ``association of an unspecified type'' by three centred dots \cite[p.\ 96]{janet}. \end{itemize} Might commands such as \\ \verb+\bond+, \verb+\doublebond+, \verb+\triplebond+ and \verb+\association+ \\ be appropriate? \item It seems desirable to have specific commands for arrows/harpoons with labels above/below (to indicate conditions or rate constants). We can obtain an indication of the combinations of arrows/harpoons that might have traditionally been typeset from \cite[p.\ 371]{chicago}. 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 \\ \verb+\oneway+, \verb+\equilibriumR+, \verb+\equilibriumL+, \verb+\reversibleR+, \\ \verb+\reversibleL+, \verb+\rightright+, \verb+\rightleft+, \verb+\leftright+, \verb+\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, \begin{verbatim} \begin{displaychem} 2H\_2 + O\_2 \oneway{catalyst}{300 K; 4 bar} 2 H\_2O \end{displaychem} \end{verbatim} might be a natural way to specify \marginpar{\it But oneway, etc.\ should ensure that symbol width exceeds label width} \[ \rm 2H_2 + O_2 \renewcommand{\arraystretch}{0.5} \begin{array}{c} \scriptstyle\rm catalyst \\ [1mm] \longrightarrow \\ \scriptstyle\rm 300\ K;\ 4\ bar \end{array} 2H_2O \] \end{itemize} \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 \verb+\bond+, \dots^, \verb+\association+, \verb+\oneway+, \dots^, \verb+\leftleft+. (The only facility like \verb+\oneway+, \dots^, \verb+\leftleft+ that I've found in an existing macro package is that for arrows in \AmSTeX\ \cite[p.\ 140]{michael-s} 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 manuscripts 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{leslie}, 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''. \begin{thebibliography}{00} \bibitem{frank} Frank Mittelbach and Rainer Sch\"{o}pf. \lq\lq With \LaTeX\ into the Nineties'', {\it TUGboat,} {\bf 10} (1989), pp.\ 681--690. \bibitem{leslie} Leslie Lamport. {\it \itlatex: A Document Preparation System,} Addison-Wesley, 1986. \bibitem{judith} Judith Butcher. {\it Copy-editing,} Cambridge University Press, 1981. \bibitem{roswitha} Roswitha T. Haas and Kevin C. O'Kane. \lq\lq Typesetting chemical structure formulae with the text = formatter \TeX/\LaTeX'', {\it Computers and Chemistry,} {\bf 11} (1987), pp.\ 251--271. \bibitem{michael-r} Michael Ramek. \lq\lq Chemical structure formulae and $x/y$ diagrams with \TeX''. In: Malcolm Clark (editor). {\it \TeX: applications, uses, methods,} Ellis Horwood, 1990. \bibitem{CSC} {\sc chemdraw} (a program for the Macintosh). Cambridge, Massachusetts: Cambridge Scientific Computing Inc. \bibitem{don} Donald E. Knuth. {\it The \TeX book,} Addison-Wesley, 1986. \bibitem{janet} Janet S. Dodd. {\it The ACS Style Guide,} American Chemical Society, 1986. \bibitem{chemsoc} {\it Handbook for Chemical Society Authors,} The Chemical Society, 1961. \bibitem{hart} {\it Hart's Rules,} Oxford University Press, 1983. \bibitem{chicago} {\it Chicago Manual of Style,} Chicago University Press, 1982. \bibitem{michael-s} Michael Spivak. {\it The Joy of \TeX,} American Mathematical Society, 1986. \end{thebibliography} \end{document} ------_=_NextPart_001_01C19442.D63A6C6C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Facilities for chemists: LaTeX equivalent of AMSTeX = file

%  LaTeX 2.09 version.  Differences from the = AMSTeX version are that:
%  *  I've introduced \association
%  *  in the example at the end of section = 3.2, I've used displaychem,
%     and the arrow isn't the = right length.  (Trying to get this arrow
%     the right length was why I = used AMSTeX before.)
%  *  a few changes in wording.

\documentstyle[11pt]{article}

\newcommand{\AmSTeX}
    {$\cal = A$\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em$\cal = S$-\TeX}
\newcommand{\itlatex}%
    = {L\kern-.30em\raise.3ex\hbox{\footnotesize\it A}\kern-.15em
    = T\kern-.1667em\lower.7ex\hbox{E}\kern-.100emX}  % for use in = "references"

\begin{document}

\title{Could  \LaTeX\ do more for = chemists?}
\author{David Rhead  \\
      Nottingham = University
}
\date{}
\maketitle

\section{Introduction}

>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{frank},
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{leslie} for producing theses, = etc.

\section{Typesetting and artwork}

It may = help           &nb= sp;   to consider    = the           &nbs= p; division of labour
within a traditional publishing house.  A = ``copy-editor''
\cite[p.\ 236]{judith} 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{roswitha,michael-r}
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 = \verb+\special+.
For example,
{\sc chemdraw}
\cite{CSC} can produce ``encapsulated {\sc = PostScript}'',
so a \LaTeX-ed document with {\sc chemdraw} diagrams = can be printed on
a {\sc PostScript} printer.

\section{Desirable facilities for chemists in the new = \protect\LaTeX}

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

It would seem natural to:
\begin{itemize}
\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.
\end{itemize}
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:
\begin{itemize}
\item The default would be \verb+\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[pp.\ 163 \& = 179]{don}.
\item A designer could implement a house-style  = in which
      mathematical and = chemical equations are numbered in separate
      sequences
      \cite[p.\ 224]{judith} = or a house-style in which there is only one
      sequence of numbers = \cite[p.\ 132]{janet}.
\item It might be possible to arrange that subscripts = will normally be
      at the same level = \cite[p.\ 179]{don} inside the environments
      for chemistry.
\end{itemize}

\subsection{Commands}

At first sight, the \LaTeX\ manual \cite[ch.\ = 3]{leslie} 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:
\begin{itemize}
\item How does one obtain CH${_3}$(C=3DO)OCl
      \cite[p.\ 235]{judith} = in ``math mode''?
      We can't simply
      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
      = \begin{verbatim}
      \[
      = \renewcommand{\arraystretch}{0.5}
      = A     \begin{array}{c}
          &nbs= p; \scriptstyle k\_1      \\ [1mm]
          &nbs= p; \rightleftharpoons     \\
          &nbs= p; \scriptstyle k\_{-1}
          &nbs= p; = \end{array}          &n= bsp;      B
      \]
      \end{verbatim}
      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.
\end{itemize}
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?
\begin{itemize}
\item
It seems desirable \cite[p.\ 237]{judith}
to have documented facilities for
single and double bonds.  Triple bonds might = also be needed
\cite{chemsoc}.
Documented facilities would also be useful for = representing
\begin{itemize}
\item single bonds by raised dots \cite[p.\ = 59]{hart}
\item ``association of an unspecified type'' by three = centred dots
      \cite[p.\ = 96]{janet}.
\end{itemize}

Might commands such as \\
\verb+\bond+,    = \verb+\doublebond+,
\verb+\triplebond+ and \verb+\association+ \\
be appropriate?
\item
It seems desirable to have specific commands for = arrows/harpoons
with labels above/below (to indicate conditions or = rate
constants).  We can obtain an indication of the = combinations
of arrows/harpoons that might have traditionally been = typeset from
\cite[p.\ 371]{chicago}.
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 = \\
\verb+\oneway+,
\verb+\equilibriumR+,
\verb+\equilibriumL+,
\verb+\reversibleR+, \\
\verb+\reversibleL+,
\verb+\rightright+,
\verb+\rightleft+,
\verb+\leftright+,
\verb+\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,
\begin{verbatim}
\begin{displaychem}
  2H\_2 + O\_2  \oneway{catalyst}{300 K; 4 = bar}  2 H\_2O
\end{displaychem}
\end{verbatim}
might be a natural way to specify
\marginpar{\it But oneway, etc.\
      should ensure that = symbol width exceeds label width}
\[ \rm
2H_2 + O_2
      = \renewcommand{\arraystretch}{0.5}
      = \begin{array}{c}
      \scriptstyle\rm = catalyst       \\ [1mm]
      = \longrightarrow         &nbs= p;      \\
      \scriptstyle\rm 300\ = K;\ 4\ bar
      \end{array}
          &nbs= p;            = ;            =              = 2H_2O
\]
\end{itemize}

\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
\verb+\bond+, \dots^, \verb+\association+,
\verb+\oneway+, \dots^, \verb+\leftleft+.  (The = only facility
like \verb+\oneway+, \dots^, \verb+\leftleft+
that I've found
in an existing macro package is that for arrows in = \AmSTeX\
\cite[p.\ 140]{michael-s}
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 manuscripts = 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.         &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{leslie},
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''.

\begin{thebibliography}{00}

\bibitem{frank} Frank Mittelbach and Rainer = Sch\"{o}pf.
      \lq\lq With = \LaTeX\   into the Nineties'',
      {\it TUGboat,} {\bf = 10} (1989), pp.\ 681--690.

\bibitem{leslie} Leslie Lamport.
      {\it \itlatex: A = Document Preparation System,}
      Addison-Wesley, = 1986.

\bibitem{judith} Judith Butcher.
      {\it    = Copy-editing,}
      Cambridge University = Press, 1981.

\bibitem{roswitha} Roswitha T. Haas and Kevin C. = O'Kane.
      \lq\lq Typesetting = chemical structure formulae with the text formatter
      \TeX/\LaTeX'',
      {\it Computers and = Chemistry,} {\bf 11} (1987), pp.\ 251--271.

\bibitem{michael-r}  Michael Ramek.
      \lq\lq Chemical = structure formulae and $x/y$ diagrams with \TeX''.
      In:
      Malcolm Clark = (editor).
      {\it \TeX: = applications, uses, methods,}
      Ellis Horwood, = 1990.

\bibitem{CSC} {\sc chemdraw} (a program for the = Macintosh).
      Cambridge, = Massachusetts: Cambridge Scientific Computing Inc.

\bibitem{don} Donald E. Knuth.
      {\it   The = \TeX book,}
      Addison-Wesley, = 1986.

\bibitem{janet} Janet S. Dodd.
      {\it   The = ACS Style Guide,}
      American Chemical = Society, 1986.

\bibitem{chemsoc}
      {\it Handbook for = Chemical Society Authors,}
      The Chemical Society, = 1961.

\bibitem{hart}
      {\it  Hart's = Rules,}
      Oxford University = Press, 1983.

\bibitem{chicago}
      {\it  Chicago = Manual of Style,}
      Chicago University = Press, 1982.

\bibitem{michael-s} Michael Spivak.
      {\it The Joy of = \TeX,}
      American Mathematical = Society, 1986.

\end{thebibliography}

\end{document}

------_=_NextPart_001_01C19442.D63A6C6C--