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.

TeX Wikibooks

Requirements to "good documentation":

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

    Advanced requirements:

    • 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
    • links to StackExchange
    • maintenance by all users of the community

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

TeX, the program section 487 \if

That doesn't really help me.

And here \if in TeX by Topic:

enter image description here

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

Thanks to the hint from Marcel Krüger:

The TeXbook

enter image description here

It looks a lot better.

  • 6
    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
  • 5
    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
  • 3
    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
  • 2
    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
  • 4
    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

A dedicated server for querying and browsing TeX and LaTeX package information and general documentation texdoc.net.

Only LaTex:

LaTeX2e unofficial reference manual latexref.xyz

LaTeX Formatting Information here


I just discovered by chance David Bausum's TeX Reference Manual here HTML version. At first glance more extensive than the TeX-Wikibooks.


I just found at random from an internet search the book Making TeX Work by Norman Walsh

Making TeX Work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.