[tex-eplain] How do I test for TeX or eTeX

Guy Worthington guyw@multiline.com.au
16 Mar 2001 16:03:54 +0800


I've lifted the following code from kgeneric.tex.  When using the TeX
engine it behaves correctly; however when using eTeX it chokes (see
attached log files).  Through a lucky guess I changed the value of the
register \count18 from -1 to 0, this corrects eTeX's behaviour, but
makes TeX start allocating family numbers from 1.

I'd like to use an if...else statement, which tests for TeX or eTeX
and then sets respectively, \count18, to either -1 or 0, but I've got
no idea how to do it.  Could someone please help me?

------------------------------------------------------------
% test.tex 
%
% Plain's allocation register for family numbers.  We want to start
% allocating from zero.
\input eplain
\count18=-1
\def\definefamilyvariant#1{%
  \ece\innernewfam{#1fam}}
\definefamilyvariant{rm}
\bye
------------------------------------------------------------

This is TeX, Version 3.14159 (Web2c 7.3.3.1) (format=tex 2001.2.7)  16 MAR 2001 15:34
**test.tex
(./test.tex (c:/Local/TeX/texmf/tex/eplain/eplain.tex)
\rmfam=\fam0
 )
No pages of output.
------------------------------------------------------------
This is e-TeX, Version 3.14159-2.1 (Web2c 7.3.3.1) (format=etex 2001.2.7)  16 MAR 2001 15:44
entering extended mode
**test.tex
(./test.tex (c:/Local/TeX/texmf/tex/eplain/eplain.tex)
! Bad character code (-1).
\alloc@ ...by \@ne \global #3#5=\allocationnumber 
                                                  \wlog {\string #5=\string ...
l.5 \definefamilyvariant{rm}
                            
? pdfetex beginjavxa
Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, E to edit your file,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? x
No pages of output.
------------------------------------------------------------