TUGboat, Volume 44 (2023), No. 3.

Book review: The LaTeX Companion, third edition, by Frank Mittelbach with Ulrike Fischer (PDF edition)

Frank Mittelbach with Ulrike Fischer, The LaTeX Companion, 3rd edition. Addison-Wesley, 2023, two volumes, 944 pp. and 970 pp., electronic (PDF) edition, ISBN 978-0-13-465894-0 and 978-0-201-36300-5. https://tug.org/l/tlc3

This is a review of the electronic (PDF) edition of The LaTeX Companion, third edition (TLC3) [2]. If you are looking for a general discussion of what’s new in the third edition, see the earlier TUGboat review [3].

The first thing to say about this edition is that it is in a downloadable PDF format. It isn’t currently available in any e-reader format and would likely be difficult to adapt for e-readers, since it has two colours (black and blue) and is a reference book you search in rather than read from cover to cover.

There are two reasons you might want the PDF edition instead of (or as well as) the hardback edition. First, at 3.7kg, the hardback edition is only a little more portable than a saxophone, while the PDF weighs in at only 131.5 MB, small enough to comfortably fit on a mobile phone or tablet. Second, it is quicker to search through a PDF document or navigate from the index to a page in the PDF format.

I tested how easy it is to use TLC (PDF edition) on several devices using several PDF readers. Most mobile phone screens will be too small, but the book is easily readable on a 25cm (10inch) tablet screen. The main issue with the tablet was that searching the PDF takes longer, though it is straightforward to use the table of contents or index to navigate to what you want to read about.

TLC3 has a comprehensive index, because it is designed to be used as a reference text (and not just because LaTeX makes this easy!). It also has a lot of cross references. The PDF format makes it particularly easy to handle these, though you may want to choose a PDF reader that allows you to move back to the previous page in case the index entry you clicked on wasn’t the one you were looking for. I tested several PDF readers including Adobe Acrobat Reader, Qoppa PDFStudio, Evince and the built-in PDF readers in Chrome and Firefox. All of them worked well. The web browsers have a back button and Evince (see picture below; cropped a little) shows a preview of a hyperlink target if you hover over it before clicking it. All of them also allow you to search for a phrase within the book, either with a button or with Ctrl+F. This is very useful for the occasions when the index is not enough.

One advantage of being able to download the PDF edition of TLC3 is that you can add bookmarks and annotations. For example, I find it difficult to remember how to identify font features in OpenType fonts in LuaLaTeX. TLC3 explains it on page I.715 with an example:

otfinfo -f ‘kpsewhich XCharter-Roman.otf‘

This is difficult to remember and only works for fonts that kpsewhich knows how to find. So, I add a bookmark to the PDF file. Then I put in an annotation explaining what to do if the OpenType file is not one that kpsewhich will find. Finally I save the PDF file so that in addition to the table of contents there is now a list of bookmarks. I can now quickly find this detail just as if I had added some bookmarks to the hardback version of the book, but not quite as messy. The one limitation I found is that bookmarks created in one viewer are not always visible in another.

TLC3 cannot cover every detail of every LaTeX package. There are vast web resources such as [467] so that we can find an answer to most questions we have about LaTeX using a simple search. So it is reasonable to ask whether we really need another electronic resource.

The practical answer is yes. In principle, all the LaTeX packages on CTAN [1] are documented. But even if the documentation is beautifully written it is often cluttered with explanation of how it works, changes from earlier versions and features you are unlikely to need. And, while CTAN is comprehensive, it offers little in discussion of which packages you should use.

By contrast, a web search is often more helpful. Typically it will lead you to general documentation sites like [6] and [7] or to sites answering specific questions like StackExchange [4]. These are often very good—LaTeX package writers post answers on such sites. But the answers are not always comprehensive, accurate or up-to-date.

TLC3 overcomes many of the limitations of web resources. The authors know LaTeX inside out and so their advice is invariably good and usually up-to-date. They discuss alternative methods of achieving what you want and point out limitations in various packages. And their explanations are usually longer and better illustrated than anything you will find online.

In practice, then, you will probably want to use TLC3 (electronic edition) in combination with online resources. The picture above shows how you might do this in Firefox, with separate tabs for TLC3 and the results of various web searches. For example, suppose you wish to create a table that is too long to fit on a single page. A web search quickly identifies the longtable package and gives some simple examples of its use. Looking through the index (or table of contents) of TLC3 you find more detailed documentation on longtable. In particular, it explains that it uses the table counter and shares some behaviour with the table environment. But you also find discussion of alternatives such as supertabular and xltabular that might turn out to be better for your needs.

The electronic edition of TLC3 is easier for quick reference than the print edition [2]. But the print edition is easier to read for those learning LaTeX or when you need to read more extensively than is easy on a screen.

There are a few limitations of the electronic edition. The index entries take you to the top of the page indicated, and not to a specific point on the page where that would be more useful, though the table of contents entries work better. It would be nice if there were links from footnote text back to the footnote and not just the other way round. And the PDF file contains no tags, which limits its accessibility. These are current limitations of using LaTeX to write a book that could only be written in LaTeX. And there is much ongoing (though still experimental) work in this area [5], so that we may hope that many of these limitations are resolved by the time the fourth edition of The LaTeX Companion is published.


[1]   CTAN, Comprehensive TeX Archive Network. https://ctan.org

[2]   Frank Mittelbach with Ulrike Fischer, The LaTeX Companion, 3rd edition (parts I and II), Addison-Wesley, 2023. https://tug.org/l/tlc3

[3]   John D Lamb, Book review: The LaTeX Companion, third edition, by Frank Mittelbach with Ulrike Fischer, TUGboat, Vol. 44, No. 2, 2023. https://tug.org/TUGboat/tb44-2/tb137reviews-mittelbach-tlc.pdf

[4]   StackExchange, TeX - LaTeX. https://tex.stackexchange.com

[5]   Ulrike Fischer, The tagpdf package. https://github.com/u-fischer/tagpdf, https://ctan.org/pkg/tagpdf

[6]   Overleaf, Documentation. https://overleaf.com/learn

[7]   Wikibooks, LaTeX. https://en.wikibooks.org/wiki/LaTeX

John D Lamb

j.d.lamb (at) johndlamb dot net

$Date: 2023/10/22 23:13:27 $
TUG home page; webmaster; facebook; twitter; mastodon;   (via DuckDuckGo)