3

Will all plain TeX code also work with XeTeX?

Toothrot
  • 3,346
  • 3
    You may need to tighten this up a bit. As discussed in http://tex.stackexchange.com/questions/222286, there are some 'pathological' cases that will be different, plus any driver code may need adjustment. If you mean 'in general is plain XeTeX like plain (e-)TeX' then 'yes'. – Joseph Wright Sep 09 '15 at 11:37

1 Answers1

4

The question is not really well formed as plain tex is a macro format and xetex is an extended TeX engine, but I assume you mean to compare plain Tex with the tex (or pdftex) engine, with plain tex using xetex.

Most things will work, but some things will not, such as

\ifx\Umathchar\undefined
hello
\else
\ERROR
\fi

\bye

which typesets hello with pdftex and just makes an error with xetex,

or this (latin-1, ISO 8859-1) encoded document

\font\x=ecrm1000\x

café

\bye

which typesets café with pdftex but with xetex typesets caf and warns in the log:

Invalid UTF-8 byte or sequence at line 4 replaced by U+FFFD.
Missing character: There is no � in font ecrm1000!
David Carlisle
  • 757,742
  • 1
    The fact that café prints the right character is rather a coincidence than a feature; try straße. – egreg Sep 09 '15 at 12:30
  • @egreg well it's not a complete coincidence that some of the Cork encoding matches latin-1, although I chose my example carefully. But the question was not "will all things work in plain pdftex" it was "will things that work in pdftex work in xetex" I could have chosen an LY1/ansinew encode font which by design is closer to the input encoding if you prefer. – David Carlisle Sep 09 '15 at 12:33