24

I have seen LaTeX code that

  1. puts a ~ between every math expression and the text preceding it,
  2. does not use ~ in this manner at all, and
  3. uses a ~ in this way if and only if the math expression is a number (i.e, consists of digits).

I think the first way is not very nice, since it constrains TeX a lot in how it can typeset the rest of the text. I follow the third way, because I vaguely seem to remember reading somewhere that this is how it should be done; but I cannot recollect where, and I don't have any justification for this.

What is the rule to follow here, and what are the typographical/TeX principles behind this rule? It would be great to have references too, to convince obstinate co-authors (if required!).

Similarly, what is the reasoning behind the (almost universally observed) rule that a ~ should precede a \cite{}? Is this documented somewhere?

1
  • 1
    I would imagine the idea is to put a nbsp before anything that would look out-of-place coming at the beginning of a line. Short (<2 or 3 character) entities usually fall under this category. Obviously it's subjective, though...
    – David Z
    Aug 16, 2010 at 5:29

2 Answers 2

17

The physical effect you would get from a line break at some point is a small pause / distraction in reading, so what I do is use a mental trick: imagine how the sentence sounds with a small pause in the trouble spot(s) when read out loud. Some cases are clearer than others, but in general that works fairly well for me.

Occasionally I see something in the typeset output that looks bad visually even though it sounds OK, then I correct the ties in the input to fix that one break.

As the problem is related to the actual language you are using, you could also ask this question on english.stackexchange.com

2
  • 3
    I agree. Don't worry too much about it. Things like "Chapter~12" and "(b)~Show that $f(x)$ is (1)~continuous; (2)~bounded" are obvious and one should always use ~; however, with the borderline cases, simply have a look at the output. If it looks good, nobody will know if you used ~ "correctly". If it looks bad, tweak it a bit (add ~, hyphenate, rephrase, ...). Aug 16, 2010 at 8:48
  • Taco, Jukka, Thanks, that gives me a thumb rule to follow.
    – gphilip
    Aug 16, 2010 at 13:08
32

See chapter~14 of the TeXbook, where Knuth suggests the following ties:

  • Chapter~12
  • Theorem~1.2
  • Appendix~A
  • Figure~3
  • Table~\hbox{B-8}
  • Lemmas 5 and~6
  • Donald~E. Knuth
  • Luis~I. Trabb~Pardo
  • Bartel~Lendert van~der~Waerden
  • Charles~XII
  • Charles Louis Xavier~Joseph de~la Vall\'ee~Poussin
  • dimension~$d$
  • width~$w$
  • function~$f(x)$
  • string~$s$ of length~$l$
  • string~$s$ of length $l$~or more
  • 1,~2, or~3
  • $a$,~$b$, and~$c$.
  • 1,~2, \dots,~$n$.
  • of~$x$
  • from 0 to~1
  • increase $z$ by~1
  • in common with~$m$
  • of $u$~and~$v$.
  • equals~$n$
  • less than~$\epsilon$
  • (given~$X$)
  • mod~2
  • modulo~$p^e$
  • for all large~$n$
  • is~15
  • is 15~times the height
  • (b)~Show that $f(x)$ is (1)~continuous; (2)~bounded

There are even more examples in the exercises, but that covers most cases...

3
  • 2
    I must be really dense, I can't seem to figure out any "rules" from these examples; these look quite arbitrary to me. Perhaps I should bite the bullet and read the chapter. Thanks for the pointer.
    – gphilip
    Aug 16, 2010 at 4:23
  • 11
    I would summarize the rules of these examples as follows: * Never split an enumerator and its item (e.g.: Chapter~12; (1)~continuous). * Never let a single number or variable happen at the beginning of a new line or page (e.g.: string~$s$; 1,~2, or~3; Luis~I. Trabb~Pardo). However, I also don't know a reliable reference on these conventions.
    – MRA
    Aug 16, 2010 at 7:06
  • @gphilip For the record, here these examples are formulated as rules. Jan 14, 2017 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .