<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%% ====================================================================
%%%  @LaTeX3-article{ LaTeX3-LTX3-002a,
%%%  filename        = "l3d002a.tex",
%%%  archived        = "ctan:/tex-archive/info/ltx3pub/",
%%%  related-files   = "part of l3d002.tex",
%%%  author          = "David Rhead",
%%%  doc-group       = "Project core team",
%%%  title           = "Some ideas for improving {\LaTeX}\\ General",
%%%  version         = "1.1",
%%%  date            = "18-Mar-1993",
%%%  time            = "20:19:36 GMT",
%%%  status          = "public, official",
%%%  abstract        = "Ideas and suggestions from David Rhead for
%%%                     improving various areas in LaTeX",
%%%  note            = "prepared for the workshop at Dedham 91",
%%%  keywords        = "",
%%%  project-address = "LaTeX3 Project            \\
%%%                     c/o Dr. Chris Rowley      \\
%%%                     The Open University       \\
%%%                     Parsifal College          \\
%%%                     Finchley Road             \\
%%%                     London NW3 7BG, England, UK",
%%%  project-tel     = "+44 171 794 0575",
%%%  project-FAX     = "+44 171 433 6196",
%%%  project-email   = "LTX3-Mgr@SHSU.edu",
%%%  copyright       = "Copyright (C) 1993 LaTeX3 Project
%%%                     All rights reserved.
%%%
%%%                     Permission is granted to make and distribute
%%%                     verbatim copies of this publication or of
%%%                     coherent parts from this publication provided
%%%                     this copyright notice and this permission
%%%                     notice are preserved on all copies.
%%%
%%%                     Permission is granted to copy and distribute
%%%                     translations of this publication or of
%%%                     individual items from this publication into
%%%                     another language provided that the translation
%%%                     is approved by the original copyright holders.
%%%
%%%                     No other permissions to copy or distribute this
%%%                     publication in any form are granted and in
%%%                     particular no permission to copy parts of it
%%%                     in such a way as to materially change its
%%%                     meaning.",
%%%  generalinfo     = "To subscribe to the LaTeX3 discussion list:
%%%
%%%                      Send mail to listserv@vm.urz.uni-heidelberg.de
%%%                      with the following line as the body of the
%%%                      message (substituting your own name):
%%%
%%%                        subscribe LaTeX-L First-name Surname
%%%
%%%                     To find out about volunteer work:
%%%
%%%                      look at the document vol-task.tex which can
%%%                      be obtained electronically, see below.
%%%
%%%                     To retrieve project publications electronically:
%%%
%%%                      Project publications are available for
%%%                      retrieval by anonymous ftp from ctan hosts:
%%%                          ftp.tex.ac.uk
%%%                          ftp.dante.de
%%%                          ftp.shsu.edu
%%%                      in the directory /tex-archive/info/ltx3pub.
%%%
%%%                      The file ltx3pub.bib in that directory gives
%%%                      full bibliographical information including
%%%                      abstracts in BibTeX format.  A brief history
%%%                      of the project and a description of its aims
%%%                      is contained in l3d001.tex.
%%%
%%%                     If you only have access to email, and not ftp
%%%                      You may use the ftpmail service.
%%%                      Send a message just containg the word
%%%                          help
%%%                      to ftpmail@ftp.shsu.edu
%%%                      for more information about this service.
%%%
%%%                     For offers of financial contributions or
%%%                      contributions of computing equipment or
%%%                      software, contact the project at the above
%%%                      address, or the TeX Users Group.
%%%
%%%                     For offers of technical assistance, contact the
%%%                      project at the above address.
%%%
%%%                     For technical enquiries and suggestions, send
%%%                      e-mail to the latex-l list or contact the
%%%                      project at the above address.",
%%%  checksum        = "55562 484 2612 20025",
%%%  docstring       = "The checksum field above contains a CRC-16
%%%                     checksum as the first value, followed by the
%%%                     equivalent of the standard UNIX wc (word
%%%                     count) utility output of lines, words, and
%%%                     characters.  This is produced by Robert
%%%                     Solovay's checksum utility.",
%%%  }
%%% ====================================================================

\chapter{Could  \LaTeX\ do more for chemists?}

This appendix is based on a \lq\lq paper'' that I e-mailed a while
back.  It also contains some e-mailed comments.


\section{Motivation}

\begin{footnotesize}\begin{verbatim}
From:     Rainer Schoepf &lt;Schoepf@DE.DBP.ZIB-BERLIN.SC&gt;
Date:     Mon, 15 Oct 90 13:09:23 +0100

I got the following message a while ago, as a reaction to a discussion
I had with John Simmie after the talk at Cork.  He's a chemist, so his
focus of interest is different from the mathematicians one.  I think it's
interesting to pass this on to the list.

 - Rainer

----------------------original message follows ------------------------------

...                    I would like to see ...
a user-definable environment which would parallel displaymath-mode.

For example, in printing chemical equations the conventions are that
the text is in roman not math-italic---ok this is easily done via
\def\chem{\rm\everymath={\rm}}
and \chem can now be included inside $...$ or \[ ... \] or $$ ... $$ etc
or outside as  for {\chem\begin{eqnarray} ... \end{eqnarray}}
Your virtual fonts approach will also work.
Problems arise if mathematical and chemical equations are mixed in the sense
text
text
\begin{equation}      pV = nRT \end{equation}
text
\begin{equation}\chem
                      2 H_2 + 2O_2 = 2H_2O \end{equation}
text
because the automatic numbering schemes assigns (1) to the first eqn
and (2) to the second.  Whereas one wants to number maths eqns and
chemical eqns (reactions) independently---for example,
(2.1) eqn 1 of chapter 2 and (1) reaction number 1, maybe in bold or
oldstyle and maybe with &lt;&gt; brackets.

At the moment the only solution is to hack into latex.tex
and duplicate LL's \equation and \eqnarray environments with new
counters and parameters---this I have done and it works fine for
simple examples but failed for cases where the number of stacked
eqnarray's exceeded the page size (hash size and other mysterious errors).

You suggested that AMSTEX might do but on reflection that involves
even more maths---and what us chemists want is less!

Another feature is the lack of a construct to do the following:

                                catalyst
                    2H_ + O_2 -------------&gt;  2 H_2O
                               300 K; 4 bar
where the length of the arrow (---&gt; or &lt;--- or &lt;===&gt;) is
determined by the amount of text over and under it.

Note that we do not want to disable the equation environment just
have a second customisable one.

Regards, John.
\end{verbatim}\end{footnotesize}

\section{Typesetting and artwork}

It may help               to consider    the             division of labour
within a traditional publishing house.  A ``copy-editor''
\cite[p.\ 236]{butcher-81} 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{haas+okane,ramek-90}
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]{lamport-86}
``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 \&amp; 179]{knuth-90}.
\item A designer could implement a house-style  in which
      mathematical and chemical equations are numbered in separate
      sequences
      \cite[p.\ 224]{butcher-81} or a house-style in which there is only one
      sequence of numbers \cite[p.\ 132]{dodd-86}.
\item It might be possible to arrange that subscripts will normally be
      at the same level \cite[p.\ 179]{knuth-90} inside the environments
      for chemistry.
\end{itemize}

\subsection{Commands}

At first sight, the \LaTeX\ manual \cite[ch.\ 3]{lamport-86} 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=O)OCl
      \cite[p.\ 235]{butcher-81} in ``math mode''?
      We can't simply
      use ``=''
      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]{butcher-81}
to have documented facilities for
single and double bonds.  Triple bonds might also be needed
\cite{chemsoc-61}.
Documented facilities would also be useful for representing
\begin{itemize}
\item single bonds by raised dots \cite[p.\ 59]{hart-83}
\item ``association of an unspecified type'' by three centred dots
      \cite[p.\ 96]{dodd-86}.
\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-82}.
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{footnotesize}\begin{verbatim}
\begin{displaychem}
  2H\_2 + O\_2  \oneway{catalyst}{300 K; 4 bar}  2 H\_2O
\end{displaychem}
\end{verbatim}\end{footnotesize}

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]{spivak-86}
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{lamport-86},
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{Some e-mail comments}

\begin{footnotesize}\begin{verbatim}
From:     CA_ROWLEY@UK.AC.OPEN.ACS.VAX
Date:     Mon, 22 Oct 90 13:51:21 GMT

This is a comment on the message from John Simmie, passed on by Rainer:

Whilst I think that the typesetting of chemical formulas, etc, is an
important area for any TeX-based system to provide.  I think that, in
common with maths, it should be provided by an add-on package (as
AMS-LaTeX does for maths).  This should be written in close
cooperation with experts in such typesetting.

Nevertheless, we should attempt to ensure that we dot make any
decisions about "basic LaTeX" which make such an add-on dificult to
produce.  It is not clear to me how we can achieve this in general
(since it applies to many other specialist areas of typeseting)
but I cannot see anything in John's requests that requires any changes
to basic LaTeX.
\end{verbatim}\end{footnotesize}
\begin{center} --- \end{center}
\begin{footnotesize}\begin{verbatim}
From:     David Rhead ...
Date:     24 Oct 90 14:10:44

%  A LaTeX input file
\documentstyle[11pt]{article}


\begin{document}

%  A chemist might hope to typeset single/double/triple bonds in
%  the following "obvious" ways.  However, none of them will give
%  what is required (because, although the bonds are visually
%  similar to some mathematical sybols, they are logically different).

A single bond? $X-Y$

A single bond? $X.Y$

A single bond? $X\cdot Y$

A double bond? $X=Y$

A triple bond? $X\equiv Y$

\end{document}
\end{verbatim}\end{footnotesize}
\begin{center} --- \end{center}
\begin{footnotesize}\begin{verbatim}
Subject:  Re: Facilities for chemists.  A LaTeX example file.
From:     bbeeton &lt;BNB@COM.AMS.MATH&gt;
Date:     Wed, 24 Oct 90 18:14:13 CET


in looking at david rhead's chemistry example, i find two distinct
notions presented:
   (a) "the bonds are visually similar to some mathematical symbols"
and
   (b) "they are logically different"

why is it necessary to use the existing notation, just because of (a)?
why isn't it possible, yea almost trivial!, to define new names and
structures for these that are logically distinct?  tex, after all, is
a powerful macro language -- one of its main, perhaps most important,
selling points.

i offer another example to illustrate what i'm suggesting.
   $\vector a$  (or $\vector{a}$ )
assume this will be used only in math mode.
if you're a mathematician this becomes
   \def\vector#1{\vec{#1}}
if you're a physicist, it becomes
   \def\vector#1{{\bf#1}}
here the logical notion is the same, but the representation is different.

seems to me that this is what sgml is trying to tell us.  teach the
user to capture the logic, and let the representation be taken care of
behind the scenes.

i don't say that the available fonts and structures are adequate for
chemistry (they're almost certainly not), but that doesn't mean that
suitable new ones can't be constructed.
\end{verbatim}\end{footnotesize}
\begin{center} --- \end{center}
\begin{footnotesize}\begin{verbatim}
From:     David Rhead ...
Date:     25 Oct 90 14:08:11

...

... with reference to Barbara's message, there may be no difference
between what she's suggesting and what I'm suggesting.   ...
...                                                    I just intended
to show what a chemist might actually do on seeing the current LaTeX
manual (before the chemist found that it didn't give him/her what s/he
wanted), not to show what I think chemists should do in future.
I agree with Barbara that, in an ideal world (to which we are working with
LaTeX 3.0), the user should not use the existing notation ...
\end{verbatim}\end{footnotesize}
</pre></body></html>