# Is there good documentation of TeX, eTeX, pdfTeX, XeTeX and/or LuaTeX primitives?

I mean something like this: TeX - Wikibooks

I found it looking up documentation for `\if`. I didn't expect to find it to be a WikiBook.

Open the link, scroll down to "TeX Primitives" and click `ìf` in the third column or use this link: TeX \if.

Requirements to "good documentation":

• online
• easy to find, easy to access
• comprehensive, complete
• examples

• generated from a database
• requirements of use
• used in package, file, line
• peculiarities
• where defined
• where redefined
• importance, statistically determined
• supply of tooltips for typesetting system editors
• links to good blog posts
• maintenance by all users of the community

And for comparison TeX, The Program Index `\if section 487`:

That doesn't really help me.

And here `\if` in TeX by Topic:

That's better but in both cases no reference to `\else` `\fi`.

Thanks to the hint from Marcel Krüger:

The TeXbook

It looks a lot better.

• This text seems a bit imprecise, I'm afraid. The usual reference for TeX primitives is the TeXbook (Knuth). There is also TeX by topic (Vic­tor Ei­jkhout) but I haven't read it. LaTeX doesn't have primitives stricto sensu. The LaTeX Companion (now at its 2nd edition) explains a few internal LaTeX commands, but I'd say this is not its main objective; for those that are not covered (a lot), you have the source2e document (commented source code). – frougon Aug 5 '19 at 22:28
• the official reference documentation for tex is the texbook and the official reference documentation for latex are the latex book and the latex companion, all three books published by Addison-Wesley. – David Carlisle Aug 5 '19 at 22:44
• You only quoted 13.2.1 of TeX By Topic. At minimum you should read the section headings. Chapter 13 is called “Conditionals”, so the entire chapter is about `\if` and variants. Specifically, the `\else` and `\fi` that you say are missing are listed on the very first page of the chapter, then 13.1 explains the general structure of conditionals (including the `\fi` or `\else ... \fi`), then 13.2 lists specific ones (`\if`, `\ifcat` etc), then 13.7 says more about how conditionals are evaluated (skipping until `\else` etc). – ShreevatsaR Aug 6 '19 at 4:25
• As it stands, this feels hard to answer: what the bar for 'good documentation here? The various manuals (e-TeX, pdfTeX, LuaTeX) plus The TeXbook and TeX by Topic feel like they offer reasonable coverage to me. – Joseph Wright Aug 6 '19 at 6:52
• Documentation of this sort doesn't exist, and is unlikely to (who would do it?) TeX predates the web so the idea that its documentation would suddenly exist in the form that you've become used to with some other more modern software seems unreasonable. As Stackexchange discovered with their disastrous documentation site attempt, writing good documentation for existing systems is both hard and not something most people are interested in putting time into. There's plenty of adequate documentation around; the fact that it requires traditional reading rather than clicking shouldn't be a problem. – Alan Munn Aug 6 '19 at 16:45