% sgmlcmpt.sty
%
% (c) Copyleft 1999 J"org Knappen
% Licence: GNU licence version 2
% Documentation: See after \endinput
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sgmlcmpt}[1999/06/01]
\newcommand*\amp{\&}
\newcommand*\lt{<}
\newcommand*\gt{>}
\newcommand*\clmn{&}
\endinput

Unfortunately, one cannot embed LaTeX formulae into SGML as #PCDATA. The
reason is, that a LaTeX formula can contain the characters "<" and "&" which
have a special meaning in SGML.

This little package defines four control sequences to circumvent the
restriction: 

\lt   < (less than)
\gt   > (greater than)
\amp  \& (ampersand sign)
\clmn & (column separator)

\gt is only provided for aesthetical reasons; the asymmetry between \lt 
and > looks ugly to the author of this package. 

The usual catcodes for >, <, and & are assumed while the package is read in.

The following little sed script will make all your TeX formulae SGML #PCDATA

s/</\\lt /g
s/>/\\gt /g
s/\\&/{\\amp}/g
s/&/\\clmn /g

Fine print

Note the spaces inserted after \lt,\gt, and \clmn: They guarantee that the
control words are ended properly. There shouldn't be any spaces eaten up, since
">" and "<" are not intended to be input in text (horizontal) mode. With 
standard TeX fonts they produce surprising results anyway. Leading spaces after
a column separator are ignored by TeX, so no problem here.

Turning the control symbol \& into a control word \amp may cause the loss of
significant spaces, therefore the additional group here. The group should
cause no harm, since \& is alreday of math type "other". It may suppress
a hypothetical ligature or kern between the ampersand sign and a following
character in text mode depending on how many passes TeX needs in order to
typeset the paragraph. The standard TeX fonts don't contain such ligatures
or kerns.

J"org Knappen, Barbarossaring 43, D-55118 Mainz, Allemagne
Author of the Book: Schnell ans Ziel mit LaTeX2e, Oldenbourg-Verlag
M"unchen, 1997, ISBN 3-486-24199-0.
% /sgmlcmpt.sty
