The e-TEX format source file "etex.src"

The primary e-TeX format source file, "etex.src", is in principle merely a wrapper for "plain.tex", providing modified definitions for some Plain TeX commands (at present, just one: \tracingall) and adding new commands (\eTeX, \loggingall, \tracingnone, \newmark, \load, \addlanguage and \uselanguage in the first release). In so doing, we have taken the opportunity to (a) provide intrinsic support for multiple-language typesetting (by deferring the processing of patterns and exceptions until a rudimentary language-handling environment has been defined), and (b) provide a simple but effective module-handling system, to allow e-TeX ancilliary source files to be structured as libraries rather than as flat linear text files. As these extensions are not currently documented elsewhere, a brief explanation of their syntax and semantics is provided here.

\tracingall
The definition is augmented to enable tracing for the four new e-TeX tracing primitives \tracingassigns, \tracinggroups, \tracingifs and \tracingscantokens; the numeric value assigned to the TeX primitive \tracingcommands is increased as e-TeX will report additional detail in these circumstances.

\eTeX
A simple implementation of the e-TeX logo; a more sophisticated version, capable of being used in maths sub/superscripts for example, may find its way into etexdefs.lib in due course.

\loggingall
This command is equivalent to the sequence \tracingall \tracingonline = 0 .

\tracingnone
This command restores the initial state of the various \tracing... primitives following use of \tracingall or \loggingall.

\newmark
As e-TeX provides 256 \marks rather than the single \mark of TeX, an allocator mechanism is required; we believe that \marks are closer to \boxes than to (say) \counts or \dimens and so have provided an analogous allocation mechanism, in that \newmark <control sequence or active character> assigns a numeric value to the parameter rather than making it a synonym for an actual \mark; this numeric value can then be used to access individual \marks, \topmarks, \splitbotmarks, etc., as in
        \newmarks \rectomarks
         . . .
        \marks \rectomarks {This may form part of the recto running head}
         . . .
        \leftline {\topmarks \rectomarks}
It should be noted that as \marks 0 is synonymous with \mark, \newmarks will never allocate that particular value.

\load
Although (Plain) TeX provides facilities for either \inputting a complete file or for \reading a file line-by-line, it makes no provision for any intermediate level of file access. In e-TeX, we provide facilities for \inputting one or more named modules from a suitably structured library file. The syntax used is:
        \load <module>[, <module>...] from <file>
whilst the library file itself should be structured as:
        %! e-TeXlib Vx.y
        \module {<name>}
         . . .
        \endmodule

        \module {<name>}
         . . .
        \endmodule
   
         etc.  
The DSC-style header is required, and the actual values in Vx.y must correspond to the current version/revision of e-TeX; for the first production release, the header must therefore be:
        %! e-TeXlib V1.1
If a library file is changed during the lifetime of the system, it is recommended (but not required) that this amendment be recorded in a cycle number appended to the header; a cycle number is of the form ;digit[s], and thus a valid header for the first release of e-TeX might be any of:
        %! e-TeXlib V1.1
        %! e-TeXlib V1.1;1
        %! e-TeXlib V1.1;247
etc. The necessity for a perfect match between the library header and the current version/revision of e-TeX may be relaxed in a future release if it transpires that no changes in the structure of user libraries are required for compatibility with future versions of e-TeX.

Multiple language typesetting
When TeX gained \language and \setlanguage primitives with the advent of TeX 3.0, no change was made to the Plain TeX source code to really exploit these features with the single exception of the \newlanguage command. In "etex.src", we defer the loading of patterns and hyphenation exceptions until a rudimentary language handling environment has been defined. We now assume that the user (or rather the format-creator) will create a file called "language.def" in which he or she will list the various languages to be supported by the format. Each entry apart from the last in "language.def" is of the form:
        \addlanguage {<language>}
                     {<patterns file>}
                     {<exceptions file>}
                     {<left hyphen min>}
                     {<right hyphen min>} %%% shewn wrapped for clarity
The first line should normally be:
        \addlanguage {USenglish}{hyphen.tex}{}{3}{2}
whilst the last might be
        \uselanguage {USenglish}
if the normal defaults of TeX are to obtain, or \uselanguage with some other language if it is more appropriate. In the absence of a suitable language.def file, the default fallback mode (USenglish, with the canonical patterns, exceptions and left- and right-hyphen minima for TeX) will be used. Within the user document, \uselanguage {<some language>} should be used to switch languages, which will have the effect of loading appropriate patterns, exceptions, and left- and right hyphen minima. To allow the use of more powerful language-handling environments (e.g. Babel), the \uselanguage command finishes by testing whether the putative control sequence \uselanguage@hook is defined; if it is, then it is expanded, passing as parameter the name of the language to be used. It should be noted that \uselanguage is automatically invoked during the expansion of \addlanguage prior to the reading of patterns; a further hook, \addlanguage@hook, is invoked in an identical manner after the reading of patterns and exceptions so as to allow (for example) category-codes to be changed for the duration of the pattern- and exception-loading régime. This code is still classed as experimental, and if it transpires that a superior mechanism would improve the interface to Babel or LaTeX, it may be enhanced in the future.

The e-TeX format source "etex.src" is a product of the NTS group.


Please notify any errors in this document to its creator;
Last updated: 8-NOV-1996 17:55:36 /PT. HTML 3.2 Checked!