12

I understand that XeTeX was written to handle UTF-8 input better than pdfTeX. However, it seems to process documents in a slightly different way. That is, documents that don't use special fonts or need UTF-8 encoding still compile differently from the two engines.

This site contains many questions along the lines of "How do I get XeTeX to do xyz ?", where xyz is something that works fine with pdfTeX. I understand that XeTeX and pdfTeX do handle internals differently; my question is "Do they have to?" Is it possible to have XeTeX handle fonts/input differently, but once this is accomplished, it handles everything else exactly the same way as pdfTeX? Or is the issues of input encoding and fonts so fundamental that things necessarily have to be different, and workarounds must constantly be made to match outputs from the different engines?

9
  • if you want a unicode aware tex that is closer to pdftex you should probably look at luatex. luatex extends the pdftex base but xetex extends the classic (dvi) tex base and then uses a dvi driver to generate pdf. Commented Feb 8, 2013 at 14:38
  • 1
    Can you give a minimal example of a document that compiles differently?
    – egreg
    Commented Feb 8, 2013 at 15:04
  • In terms of "plain text," no (although I seem to recall reading somewhere that the line-breaking algorithm between the two is slightly different.) Graphics seem to be handled differently. The crop command of \includegraphics in graphicx package doesn't seem to work; the spy library of tikz doesn't work. These are two that I've run into recently and part of what spawned the question.
    – GregH
    Commented Feb 8, 2013 at 15:20
  • @GregH The crop issue is solved, and an updated xetex.def should be emerging soon to solve it :-)
    – Joseph Wright
    Commented Feb 8, 2013 at 15:32
  • 3
    The answer is simple, your first sentence is wrong, XeTeX was not written to do anything better than PDFTeX; XeTeX is a desendant of TeXGX which was first released in 1996 and was never based on PDFTeX. Commented Feb 8, 2013 at 17:52

1 Answer 1

11

To round up the comments and not leave this unanswered, xetex is based on (dvi) TeX and generates (extended) dvi which is then converted to pdf via the dvipdfmx driver. luatex in contrast is based on pdftex sources. Thus inclusion of graphics and other features requiring driver support differ, just as in classic tex the support for different file formats, clipping and colour varies between different dvi drivers.

Moreover, in order to circumvent some problems related to the OpenType font support, XeTeX has a different hyphenation algorithm, which might lead to different line breaks. The algorithm is actually essentially the same, but it's performed at a different stage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .