[Tex/LaTex] XeTeX and XeLaTeX in TeXworks editor

texworksxetex

In TeXworks editor in the Typeset dropdown menu among others I can select XeTeX or XeLaTex typesetting formats.

If I understand correctly XeLaTex and XeTex is exactly the same thing, so why does TeXworks list them as separate options?

Best Answer

They are not the same. That is, they use the same engine, the XeTeX engine, but they are for different formats. The XeTeX option is for use when writing plain TeX, while the XeLaTeX option is for LaTeX.

The document lualatex-doc describes the difference between an engine and a format. I quote:

To answer this question, we need to mention a few details about the TEX world that you may usually ignore: the difference between an engine and a format. An engine is an actual computer program, while a format is a set of macros executed by an engine, usually preloaded when the engine is invoked with a particular name.

Actually, a format is more or less like a document class or a package, except it is associated with a particular command name. Imagine there is a command latex-article that would do the same as latex, except you wouldn’t need to say \documentclass{article} at the beginning of your file. Similarly, in current distributions, the command pdflatex is the same as the command pdftex except that you don’t need to put the instructions to load LaTeX at the beginning of your source file. This is convenient, and slightly more efficient too.

Formats are great because they implement powerful commands using the basic tools an engine provides. However the power of the format is sometimes limited by the engine’s tools set, so people started developing more powerful engines so that other people can implement even more powerful formats (or packages). The most famous engines now (except the original TEX) are pdfTeX, XeTeX and LuaTeX.