The Use of SGML Entities in GELLMU

William F. Hammond

21 July 2000

1.  Introduction

GELLMU now has provision for the incorporation of an internal declaration subset with either SGML or direct XML output from the syntactic translator gellmu.el. (The didatic article document type is first written as SGML and then re-formatted with some normalization, including “argument naming”, as XML.)

SGML entities do not correspond in any obvious way to classical LaTeX markup. However, as things unfold, it is expected that use of SGML entities may accommodate some LaTeX-like macro functionality.

As things stand with the didactic document type, all entity expansion takes place when the SGML created by gellmu.el is first parsed.

With an appropriate SGML document type defintion, one might provide for an “internal” command in the article preamble that spawns an internal declaration subset in the XML image. For direct production of XML this is not an issue.

These two ways of handling entities could be used in the same document.

2.  A Few Simple Examples

The quoted phrase at the end of this sentence is produced with entity markup under the name foo: “a <sample> string”. The GELLMU source used for this phrase is “&foo”.

The GELLMU source for the definition of the entity foo is

\entity{foo "a &oltc;sample&ogtc; string"} .

Note that sample is not markup. The expansion of this definition uses another entity fooglm. The entity oltc is defined in the source with

\entity{oltc STARTTAG "ltc"} .

It invokes at parse-time the starttag for the empty element ltc in the didactic GELLMU document type that gives rise in most formattings to the character ‘<’. Note that this layer of indirection is only required for an SGML (or XML) document that is going to be subjected to a formatting pipeline that involves at least one target language under SGML or XML where an instance of the character ‘<’ might not be intended as markup.

The GELLMU source for the definition of foo translates under gellmu.el to SGML as

<!ENTITY foo "a &oltc;sample&ogtc; string"> .

The display of this translation is marked up with still another entity foosgml.