# Executables of formats, engines and executables of engines

1. Each format has its executable/command, which compiles tex files into a document in dvi, pdf etc.

For example

• for TeX (proper), what is its executable?
• for Plain TeX, its executable is tex which will turn a plain TeX file into a dvi file.
• for LaTex, its executable is latex which will turn a LaTeX file into a dvi file.
• for ConTeXt, its executable is texexec which will turn a ConTeXt file into a pdf file.
2. A TeX engine is a program and turns a tex file into a document in dvi, pdf etc, and it is the actual executable binary which implements the different TeX formats.

For example

• Knuth's TeX ('TeX-82') (executable: initex, or -ini flag to tex)
• e-TeX (executable: etex)
• PDFTeX (executable: pdftex)
• XeTeX (executable: xetex)
• LuaTeX (executable: luatex)

I wonder what relations and differences are between executables of formats, engines, and executables of engines?

Thanks!

• – Martin Schröder Jul 20 '12 at 17:08
• On Unix systems the executable latex is usually a hard/softlink to the real program; typically pdflatex. – Martin Schröder Jul 20 '12 at 17:11

In the beginning....

there was tex and initex (and virtex)

initex was for making formats (which basically means it has an extra defined command \dump which stops the job and saves a binary file of its internal state, which can be loaded.

virtex was a vanilla tex with no preloaded format, just tex primitives you could load it with a format by using eg

virtex &plain myplain.tex

or

virtex &latex  mylatexdoc,tex

tex was like virtex but defaulted to plain tex format (but would switch formats if used with &latex as above)

The distinction got blurred once web2c tex based systems started using an alternative syntax where the name of the program was used to default the format. So if you copy tex to latex or just make a symbolic link so the command may be called via either name then

tex file

will use plain tex but

latex file

will use latex even though tex and latex are the same executable.

similarly tex and initex got merged into one executable with usage governed by command line options and these days the formats most people use are all driven by the "pdftex" engine which incorporates both the original tex and the e-tex extended primitives as well as the extension to produce pdf, and depending what name the executable is called by will use plain or latex or context or any other format.

context's texexec is a bit different it is a wrapper script that will call tex and any other auxiliary programs and generally do whatever is needed. (so it is more like makefiles or other scripts designed to run latex/bibtex multiple times)

• Thanks! (1) "virtex was a vanilla tex with no preloaded format, just tex primitives you could load it with a format", I wonder if with no preloaded format and with a format are contrary to each other? (2) tex and initex got merged, and what happened to virtex? – Tim Jul 21 '12 at 14:46
• @Tim (1) No, they are not contrary. VirTeX has no format preloaded, but can load one using &..., while something like latex has the LaTeX format preloaded and thus cannot load another format file (well, nearly as these are all clever aliases, but anyway). (2) In days gone by, IniTeX's requirement for extra memory to process hyphenation patterns meant it could not be used for 'normal' typesetting. That's no longer true, so you can happily run tex -ini and do typesetting. So there is no real need for VirTeX. – Joseph Wright Jul 21 '12 at 15:32
• In "if you copy tex to latex or just make a symbolic link so the command may be called via either name", I was wondering what original program the "symbolic link" is made to? What is "the command"? – Tim Jul 21 '12 at 16:25
• @JosephWright: Thanks! I understand (1) better now. In (2), "So there is no real need for VirTeX“, but the reason before it seems to be all about iniTeX and tex? – Tim Jul 21 '12 at 16:32
• @Tim Well yes. As mentioned in egreg's answer, VirTeX is not really useful for very much beyond tests. In the past, you couldn't do those with TeX in IniTeX mode, so VirTeX was useful. Now, if you want to do format-free testing you can just use tex -ini. – Joseph Wright Jul 21 '12 at 17:09

An engine without a preloaded format is pretty unusable. For example you can't even do

\def\macro{something}

because the braces don't have their usual meaning. Therefore every call of an engine is usually associated to a preloaded format. For instance, calling tex loads the Plain format, which has been built by

tex -ini -jobname=tex plain

Similarly, etex, pdftex, xetex and luatex preload (a modified form of) Plain.

Actually etex is usually a symbolic link to pdftex.

The binaries based on Web2C (those in TeX Live or MiKTeX), have a built-in mechanism by which they can be called by different names and preload a format with the same name. So, for instance, pdflatex is a symbolic link to pdftex and preloads pdflatex.fmt. (On Windows systems there are not symbolic links, but the principle is almost the same.)

Note that calling tex -ini is not exactly the same as what one would obtain by not preloading any format; a "no preloaded format" TeX engine can be produced by saying

tex -ini -jobname=virtex "\dump"

and moving the created virtex.fmt file in a suitable place; the current directory would be good for interactive experiments starting at the command line with

tex "&virtex"

If you type \relax at the ** prompt and then \show{ at the * prompt you get

> the character {.

which shows that the brace is not a begin-group character. Say

\catcode`{=1 \show{