From 5ab48c515e7f18de489791d28188b43a389fe4c8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:57:21 +0000 Subject: jknapltx git-svn-id: svn://tug.org/texlive/trunk@1006 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/jknapltx/sgmlcmpt.sty | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/jknapltx/sgmlcmpt.sty (limited to 'Master/texmf-dist/tex/latex/jknapltx/sgmlcmpt.sty') diff --git a/Master/texmf-dist/tex/latex/jknapltx/sgmlcmpt.sty b/Master/texmf-dist/tex/latex/jknapltx/sgmlcmpt.sty new file mode 100644 index 00000000000..4c29323024d --- /dev/null +++ b/Master/texmf-dist/tex/latex/jknapltx/sgmlcmpt.sty @@ -0,0 +1,57 @@ +% 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//\\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 -- cgit v1.2.3