# References for learning how to check for typesetting problems

The following thread discusses a number of tasks one must accomplish to finish up a document: What are the finishing touches you put to a document?

• Did the original author of TeX make such small adjustments to specific words within his books?
• How critical is the order in which one completes these tasks? E.g.: if I modify something at the end of my document, then modify something at the beginning, is my first modification now irrelevant? Are there times when it is better to fix a problem near the end of a document first? If order is important, in what order is most efficient?
• What are ideal ways to solve each kind of problem when they are encountered?
• Are there any books or articles which provide such information (e.g. a checklist outlining the above)?
-
Whoa, that's a hefty bounty! I believe that the single most important task is to make sure (while writing the text!) that you use ties (~). This advice doesn't stop at TeX, either: when writing HTML, for example, it would be wise to add those &nbsp;'s while writing. For examples on when and where to use ties, search for ties on this site. – morbusg Dec 9 '11 at 11:25
Also, you might find Yiannis' answer to a previous question interesting (I know I did!) – morbusg Dec 9 '11 at 11:30
@Village I was wondering about the scope of this imaginary list. It touches at least technical writing, printing and typography issues. It depends on the type of document (think recipie, vs. PhD thesis) as well as on the language it is written in, whether it will be printed or just distributed electronically. I suggest to limit the scope somehow. – uli Dec 9 '11 at 11:41
I did not realize this questions included to technical writing and printing. I was thinking in terms of typography problems in TeX documents; i.e. text being put in the wrong place because the algorithms did not get enough instructions or did not know how to make a particular choice and they need manual corrections or the writer forgot to mark something in a particular way, and thus TeX has improper instructions. Are there areas where the writing of the text (communicating ideas, choosing words well) and the special needs of printing collide with these typography problems? – Village Dec 9 '11 at 12:31
As for genre, my own needs relate to printed reference works, however, I tried to phrase the question in a way that did not simply consider my own interests. Would answers relevant to such books (which are full of cross-references, margin notes, footnotes, glossaries, and indexes) also benefit a large number of other TeX users? – Village Dec 9 '11 at 12:44

## 4 Answers

While not directly related to TeX, I'd say that a good read of Bringhurst's The Elements of Typographic Style is relevant here. There is a lot of very careful detail in the book, and for example the discussion on altering font kerning is very useful. What it suggests more than anything is that you need to very carefully examine the output you have if you want to address the typography of a document. It also points out that sometimes a designer might decide to bend or break the 'rules', and that this is something that requires judgement.

More widely, I think that you are unlikely to find a check list of TeX-related things to look at. At best, you may find more general design information, but as design is to some extent artistic it does not necessarily lend itself well to rigid sets of rules.

-
i don't know of any existing checklist for this topic, but it might be a good topic for, say, a tugboat article, if someone wants to undertake it. i wouldn't call the result "rules", but "guidelines", or even just "suggestions". – barbara beeton Dec 9 '11 at 14:23
@barbarabeeton I did write 'rules' with quote marks: there was a reason for that :-) I'd imagine you are much better placed to write a TUGBoat on this than many of the other people here. – Joseph Wright Dec 9 '11 at 16:51
Sorry. I downvoted by mistaken ehen reading the answer on my phone. Now I cannot change my vote :( – Aditya Dec 10 '11 at 15:16
@Aditya No problem, I think I can cope :-) – Joseph Wright Dec 10 '11 at 16:31
Bringhurst is a joy to read as well. Full of great phrases and oddly passionate criticisms of his pet hates. In some respects similar to Fowler's Modern English Usage in that respect. – Seamus Dec 12 '11 at 20:49

“Dear Polish friends: I’m doubly sorry”, Knuth wrote at the top of a macro! “I’m doubly sorry that I have only a crude approximation to an ogonek”; and he went and drafted a macro to make an ogonek.

Now that was not a symbol that either appeared frequently or formed part of the mathematics of the paper. It was only required in the last two references, out of a total of 29. He used it on the last one but missed it on the other! As a sideline he used a comma to imitate the cedilla hook.

If you are interested, the paper is titled Overlapping Pfaffians. Knuth also took care of the spacing in the “Pfaffians” and for which he defined a macro as:

\def\Pfaff/{P\kern-.07emfaff}


Moral of the story: Even the best of us can miss something, so always have someone else read through your final copy.

One can never be sure how much editing he did, but this particular paper showed seven revisions, with the dates all carefully marked at the top of the TeX file and spanning some three months. If you follow some of the guidelines in this answer and analyze Knuth’s publicly available works, you can observe that:

Overfull boxes are down to none on all his papers. He used very few additional fonts. At most he defined a short-cut for the small caps font, normally as \font\sc=cmcsc10. Knuth is very consistent with spacing. Most displayed equations are treated as paragraphs and they are compactly inserted between the text. They also have the correct punctuation after the equations.

There are no rivers, almost no bullet lists and where lists exist, they have a function; mostly to describe steps in algorithms. Talking of steps, have a look at the step diagram below, from another Knuth paper, where he used it to indicate the number of ways to put a positive integer into a k-rowed triple staircase:

It took this to write it, I am sure, just so that the line thickness would match with the text:

\vbox{\offinterlineskip \def\hb{\phantom{\hbox{A}}} \halign{\strut#&\vrule#&\hfil#\hfil% &\vrule#&\hfil#\hfil% &\vrule#&\hfil#\hfil% &\vrule#&\hfil#\hfil% &\vrule#&\hfil#\hfil% &\vrule#&\hfil#\hfil% &\vrule#&\hfil#\hfil% &\vrule#\cr \omit&\omit&\omit&\omit&\omit&\omit&\omit&\omit &\multispan7{\kern-.4pt\hrulefill\kern-.4pt}\cr \omit&\omit&\omit&\omit&\omit&\omit&\omit&\omit&&\hb&&\hb&&\hb&&\cr \omit&\omit&\omit&\omit&\omit&\omit &\multispan9{\kern-.4pt\hrulefill\kern-.4pt}\cr \omit&\omit&\omit&\omit&\omit&\omit&&\hb&&\hb&&\hb&&\cr \omit&\omit&\omit&\omit&\multispan9{\hrulefill}\cr \omit&\omit&\omit&\omit&\omit&\hb&&\hb&&\hb&&\cr \omit&\omit&\multispan9{\kern-.4pt\hrulefill\kern-.4pt}\cr \omit&\omit&\omit&\hb&&\hb&&\hb&&\cr \multispan9{\kern-.4pt\hrulefill\kern-.4pt}\cr \omit&\hb&&\hb&&\hb&&\cr \multispan7{\kern-.4pt\hrulefill\kern-.4pt}\cr }}


He took care of hyphenation, where there was a problem, both preventing it as well as encouraging it where it was appropriate.

What is prevalent in his works is consistency, which I think is one of the most valuable traits of good typography

Now to summarize the response to your questions:

Did the original author of TeX make such small adjustments to specific words within his books? Yes, as is evident from the above.

How critical is the order in which one completes these tasks? E.g.: if I modify something at the end of my document, then modify something at the beginning, is my first modification now irrelevant? Are there times when it is better to fix a problem near the end of a document first? If order is important, in what order is most efficient?

Dijkstra — the famous Computer Scientist — allegedly wrote his famous EWD notes in one pass and never went back to revise them. This is obviously the most efficient method of editing a document; if you are a genius. For us mere mortals we can do well to follow Halmos editing algorithm. When you finish Chapter 2, go back and edit Chapter 1 and Chapter 2. When you finish Chapter 3, go back and edit Chapters 1–3 and so on. By the end of the Book, you only need one more edit from Chapter 1 to the last one and you are done. This is a good method for editing paragraphs in a Chapter as well. In my opinion this spiral technique is the most efficient — after Dijkstra's. True for the writing and true for the coding and true for many other things in life as well.

What are ideal ways to solve each kind of problem when they are encountered? There are no ideal ways as there are no ideal books, just information and advice, which you need to absorb and develop your own techniques.

Are there any books or articles which provide such information (e.g. a checklist outlining the above)? There is no checklist as far as I know floating around but Barbara’s answer to your question has one good point; read the guidelines. There are too many books on typography, most of them hijacked by Graphic Designers with plenty pictures of posters with fonts. Stir away from them. Best learn by example; study good papers and books in your field and try and emulate them; develop good habits. There is also good advice — most of the time — on this Site.

Notes:

Style references: APA, MLA, Chicago Manual of Style,Oxford. Similar but free guide aaanet. Excellent but a bit dated book on uses of italics, which is a common source of inconsistencies and errors. The EU Style Guide, has a good section on romanization, another common area of inconsistencies. Best guide IMHO is the Economist's, unfortunately not free, but advice from people that write daily and make a living out of it is invaluable. The Magazine itself is reputed to have graphics that adhere to Tufte's guidelines. For maths see mathematical typesetting

Consistency: fonts, margins, headings, citations, bibliographies, contents, indices, list of symbols, page numbering, headers and footers are all well covered by (La)TeX, search for any problems tex.sx . Once you settle on a class, the best you can do is develop some macros of your own, e.g., names you are prone to get wrong while typing for example names such as Hàn Thế Thành, abbreviations etc.

Inspiration: The physics website arXiv can be a source of inspiration, even if not your field. Quite a few of the papers provide the LaTeX or TeX code; but you can also get disappointed to read papers with almost 600 co-authors, where you could expect that there was at least a one typographically inclined co-author and find that the plots could do with a bit of TiKZ or pstricks magic and with a Jake answer. Best inspiration is to visit a good library, get a few books you like and study the style.

-
I have to say, I'm a little surprised that Knuth went for such a horrible solution to draw the boxes picture. It's unreadable and probably was a nightmare to write and debug. My package ytableau does the same thing with nice syntax, and I had it drawing pictures like that in only two days. (This is not to say I am better than Knuth, just that he appears, uncharacteristically, to have compromised elegance here for rather small time savings.) – Ryan Reich Dec 12 '11 at 19:35
@RyanReich That was at a time that there was not even picmac. The common approach at the time was to leave a space for the figure, photocopy it stick it on the final copy and tippex around the edges of the piece of paper with the figure on! It also probably looked amazingly clean on any computer screen at the time, and it runs with no errors and no package almost thirty years later:) – Yiannis Lazarides Dec 12 '11 at 19:57
Sorry, I didn't mean to imply that the result was ugly, but the code. – Ryan Reich Dec 13 '11 at 0:50
What is the source for Halmos editing algorithm? I don't find anything related to it while Googling. – gerrit Dec 16 '11 at 9:19
@gerrit I christened it as such, but the description is at math.uh.edu/~tomforde/Books/Halmos-How-To-Write.pdf, pg 131-132 – Yiannis Lazarides Dec 16 '11 at 9:39

Regarding the first two questions:

As the sources of Donald Knuth’s TeXBook are available from CTAN you can look inside and find individual kerning adjustments like

is a trademark of Addison\kern.1em--Wesley Publishing Company.


So I would say that a meticulous inspection was conducted.

The order is very critical. For example anything that affects line and page breaking must come before the check for orphans and widows. Otherwise you have to check over and over again.

Regarding your last question I yet have to see such a detailed checklist with respect to LaTeX. Generally, almost every book on technical writing, printing books or typography I came about has some sort of list. Even print shops themselves typically have a flyer to remind their customers of the most important checks.

EDIT: As you ask for references I remembered typokurz. Unfortunately it is only available in German. But it gives recommandations for further reading. Among them is the book by Bringhurst, as well as the CMOS. The book “Erste Hilfe in Typografie” by Friedrich Forssman and the late Hans Peter Willberg is available in English too. Unfortuantely only available in German are the remarkable books “Lesetypografie” and “Detailtypografie”. One of the authors, Friedrich Forssman, offers on his own webpage a short checklist however not specifically with LaTeX in mind.

2nd. EDIT: Regarding the do’s and dont’s of mixing different fonts “Wegweiser Schrift” is worth being mentioned.

3rd. EDIT: Another one I totally forgot about, finally something with respect to LaTeX: Anselm Lingnau, the author of the float package, has published a book titled “LaTeX Hacks” with O’Reilly in 2007. It contains 100 solutions to small and not so small problems while typesetting with LaTeX. Yet again I’m not aware of an English version.

-
I wouldn't recommend Lingnau: IMHO he tends to use hacks where cleaner solutions (e.g. packages) are available. – Martin Schröder Dec 11 '11 at 21:44

i can say with certainty that don knuth does make even very tiny final adjustments. if you read the article by knuth & plass on "breaking paragraphs into lines" (sorry, it's not on line, as far as i know) you will see that as much as possible is built in. some tactics, like using ~ or \ or \@ become automatic with practice, but there's always some tidying up to do at the end.

it's better to start making adjustments at the beginning. depending on the magnitude of the adjustment, it could change the paging; then later problem areas may disappear, and adjustments become unnecessary.

one way to avoid problems if you are submitting a document for publication is to use the applicable document class provided by the publisher. and read the instructions/guidelines! take care of all overfull lines before you submit files to the publisher.

i'd love to see an article with suggestions on this topic for tugboat.

-
Got to love the determined consistency (consistency is oh so pivotal in this very discussion)! :-D – morbusg Dec 11 '11 at 14:39