Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've been using LaTeX for about a year or two as part of writing reports in uni, and want to gain a more in-depth understanding of how it works (I'm a computer science student).

Would Donald Knuth's The TeXbook a recommended read for me? What does it cover? What is your impression of it, those who have read it?

share|improve this question
Yes, You should read it. As Knuth says, it gives you every single detail about TeX and how it works. I am Persian and since English was not my mother tongue, I had difficulties understanding TeXBook and I had to read each concept several times until I could understand them. –  IRAN Feb 11 '11 at 15:05
read the TeX by Topic from Victor Eikhout. It is much more readable than the TeXbook –  Herbert Feb 11 '11 at 15:10
Since this question asks for impressions and experiences of several users, not for a best answer or solution, I suggest converting it to community wiki. –  Stefan Kottwitz Feb 11 '11 at 15:10
@Herbert: I disagree; the TeXbook has very elegant prose, a natural development, and is much more readable as literature. TeX By Topic, however, is much better as a technical manual: as the title says, it is organized by topic, so there's no danger of having to look in five different places for complete information about some builtin. And it has very useful examples. –  Ryan Reich Feb 11 '11 at 21:02
@Vafa: The TeXbook is not organized as a reference manual of TeX as TeX by Topic is. Knuth is clearly aiming to teach the novice reader how to use TeX to produce beautiful books and the advanced reader (dangerous bend sections) more advanced material. As such, Knuth starts with a very basic example of a .tex file and works up to macros, math, tables, and all of the advanced topics. I don't really recall The TeXbook jumping from topic to topic. There's a fairly logical progression of ideas. –  TH. Feb 15 '11 at 6:07
show 5 more comments

5 Answers

up vote 30 down vote accepted

If you want an in-depth understanding of LaTeX you can start somewhere else. However, if you want to really understand TeX then there is no way to avoid the great TeXBook! (I actually ordered the whole 'Computers & Typesetting, Volumes A-E Boxed Set' just 2 weeks ago, its still on its way to Europe -- the US prices are so much cheaper :-) )

It explains a lot of how the TeX engine works. I really just started to understand some of the fine mechanics of it after reading this book.

The sources of The TeXBook are on CTAN, so you could have a peek in it (in source form only). There is also TeX for the Impatient as full PDF. However, I didn't read that book yet.

share|improve this answer
"the US prices are so much cheaper" — weird, because in the U.S. the Indian/east Asian versions of books like that are cheaper than domestic... –  Andrew Arnold Feb 15 '11 at 3:34
@Andrew: That books are, as originals, of course more expensive in Europe because of shipping, customs and the share the retail trader gets. Here it happened that the Amazon.com price (reduced)+shipping was cheaper than the Amazon.de price (also reduced, but less) with free shipping. Anyway, I just figured out that I have to pay customs and claim the book from the customs office, so it isn't really cheaper. The last time I ordered such books (Companion set) from Amazon.com I did so from Ireland which has 0% VAT on books, which made the order smoothly and made me forget about customs this time. –  Martin Scharrer Feb 15 '11 at 9:30
add comment

If you want to gain an in-depth understanding of the TeX family, you will certainly read the TeXbook, early or late.

There are electronic versions of "TeX for the Impatient" and "TeX by Topic" (already installed in TeX Live, but not MiKTeX). Thay are easy to achieve, and can be additional supplements or alternate of TeXbook. Anyway, TeXbook is still worth to read.

Since you are a LaTeX user, you may also read the documented source code of LaTeX, say source2e and classes document, and source code of any package you are interested in. This may be what Martin said a start somewhere else about LaTeX. I learned a lot from other's code, no less than from the books.

Since you want to understand how TeX works, you may also need knowledge of MetaFont, modern TeX engine (eTeX, pdfTeX, XeTeX, LuaTeX, ...), PostScript/PDF drivers (Dvips, dvipdfmx, ...), WEB2C, and so on. For a overview of TeX family, I suggest "An overview of TeX". These may be as important as TeX language itself.

share|improve this answer
The @name syntax doesn't work in answers, just comments. You have a typo "electric versions" should be 'electronic versions', shouldn't it. –  Martin Scharrer Feb 11 '11 at 16:19
@Martin: I didn't know much about the @ notation, thanks. And for the typo. (I'm not good at English.) The using of double quotes is just a custom. –  Leo Liu Feb 12 '11 at 6:00
add comment

Yes, you should definitely read it. I also have a background in Computer Science, and I first read The TeX Book ~5 years after I learned LaTeX; I seriously regret not having read it sooner.

The argument for a LaTeX user to learn TeX is similar to the argument for a C coder to learn assembly: You can program just fine in C without understanding assembly, but it's often useful to know what is going on behind the scenes.

As for first reading alternative texts, I think there is something to be said about reading the manual written by the guy who created TeX in the first place. Isn't that why most C++ programmers first read Stroustrup's book? I also find Knuth's writing style to be very entertaining.

share|improve this answer
add comment

Of course everyone should read the TeXbook. But if you are a proficient LaTeX user who is pressed for time, I'd suggest just a few chapters (until you get hooked). Chapter 7 for character codes and tokens: you should know about tokens. Chapter 12 for TeX's treatment of spacing. Chapter 18 for good style in the input of math formulas. Skim Chapter 20 on macros and Appendix F on font glyphs and their classification. Even if you stop there, you'll have a good appreciation of how LaTeX really works.

share|improve this answer
add comment

IMHO, no. It is a waste of time, unless you really need to do TeX hacking. You cannot really understand the book in the first read, nor in the second, or third. And, I am not sure there is broad computer science added value to the book.

share|improve this answer
In computer science, TeX is a good example of macro programming language. (This kind of language is rare) –  Leo Liu Feb 13 '11 at 6:19
@Leo: I cannot agree less... There are a number of macro programming languages, including e.g., M4 and the C preprocessor. Some are good, some are not as good. But TeX is not one of them. –  Yossi Gil Feb 13 '11 at 11:08
OK, I made a mistake. I don't like the disadvantages of TeX macros either. I intended to say, TeX is a widely used and speical language that worth to understand for a CS student, even if we don't like it. –  Leo Liu Feb 13 '11 at 14:41
@Leo, perhaps a CS student can do better than a CS prof, or better said, me. I could never work out the inner logic, spirit, and/or rationale of the TeX trickery -- yes, I figured it was all very clever, but it would have been even more impressive if the cleverness was hidden, so that you could use it without being so clever yourself -- but this could be just me. –  Yossi Gil Feb 14 '11 at 7:20
@Yossi: Like any style of language (imperative, functional, logical, etc.), macro programming languages simply require a different mindset. TeX may have some flaws, but its macro expansion seems pretty solid to me. –  TH. Feb 15 '11 at 6:00
show 7 more comments

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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