Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

LaTeX/TeX programing challenge, the Automatic Chemical Numbering Environment (ACNE)

4 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Justin Finnerty

ungelesen,
25.09.1998, 03:00:0025.09.98
an
The Problem:

In chemistry technical writing, individual chemicals may be included in
a document as the full name, an abbreviation or a number[optional second
letter/number] (eg acetic acid, THF, or compound 14a---see a full
example below). Where numbers are used, the chemicals are numbered
consecutively from the start of the paper, with the first time a
chemical is mentioned it is given its full name and number. One of the
problems with editing chemistry texts is that moving text from one place
to another can change the order of compounds and therefore the numbering
sequence. (Add to this the fact that a large document/paper may be
spread over many files)

To my mind keeping track of numbering and first instances is mind
numbingly boring and simple and one destined to drive a human proof
reader either to sleep or to hysteria. The perfect task for a computer
program!

Full example of a chemistry paragraph (excuse the bad chemistry
though!):

Monosubstituted benzenes (1) can be either ortho,para directing or meta
directing. Chlorobenzene (1a) and Bromobenzene (1b) do not react with
t-butanol (2) in the presence of an acid catalyst in THF/water.
Ethylbenzene (1c) reacts readily under these conditions to give
predominantly the para-substituted product 3a, although a small
percentage of the 2,4-disubstituted product 4 is sometimes observed.
However, 1a and 1b react readily under basic conditions, but to give
t-butoxybenzene (1d) instead of the desired para-substituted products
3b,c.

Existing Solutions:

There is a package that goes somewhere towards addressing this issue. It
is based on the LaTeX citation system. It seems to require the
individual to create a psuedo-bibliography and order the
compounds/citation manually. However it does not address the issue of
using compound number/letter sequences nor making sure that the first
time a compound number is used it occurs with the full name.

Solutions:

My original concept was to have a set of commands like the following;

\chemistrynumberNumber[superkey]{key}
\chemistrynumberName[superkey]{key}

\chemistrynumberDefinition[superkey]{key}{full name of compound}
\chemistrynumberAbbrevDefinition[superkey]{key}{full name of
compound}{Abbreviation}

Then as the latex files are processed the first time, a table is
constructed that lists the key|subkeys in order and as each
\chemistrynumberDefinition/AbbrevDefinition is reached the names and
abbreviations are added to the table. At the end of the document, this
table can be saved to disk, then searched for missing full names and an
error issued.

The second time the source files are processed this table is used to
insert the appropriate information into the output stream, with the
functions having the following meanings;

\chemistrynumberNumber[superkey]{key}
--at this place in the text put in the number/letter or abbreviation,
unless it is the first instance either this or the following function
have been called, in which case act like the following function.

\chemistrynumberName[superkey]{key}
--at this place in the text put in the full name (number/letter) or full
name (abbreviation).

Possible enhancements:

1. Addition of format functions that could allow specification of simple
output formatting. Perhaps something like this?

\chemistrynumberFormatNumber{} {\textsl{[\the_number]}}
\chemistrynumberFormatName{} {[the_full_name] \textsl{([the_number])}}

2. The ability to enter multiple keys or just the superkey to get
results like;
--use of just superkey=> "Monosubstituted benzenes (1) can .."
--use of multiple keys=> ".. the desired para-substituted products
3b,c."

3. The ability to create a sorted table of abbreviations and/or a table
of chemicals listed by number.

Alternative system name:

the Chemistry Automated Numbering System (CANS)

The Challenge:

I am making an attempt to program this in PERL (something I am
reasonably familiar with). My challenge is for anyone with LaTeX
programing experience to have a go independently OR write to me and
perhaps collaborate in making a full LaTeX package?

I look forward to hearing your response.

-------------------------------------------------------------------
| Justin Finnerty. . . . . .email: J.Fin...@chemistry.uq.edu.au |
| Department of Chemistry. . ____ . . . . . Ph: 61-(0)7-33653829 |
| University of Queensland . \ /. . . . . .Fax: 61-(0)7-33654580 |
| St Lucia 4072. . . . . . . .\/ . . . . . . . . . . . Ext: 53829 |
-------------------------------------------------------------------

0 neue Nachrichten