Which unit of measurement should I use to specify \textwidth?

I used to specify \textheight in cm but read in some doc that one should always use multiples of \baselineskip. Indeed, the output improved considerably and I got rid of almost all badness messages. Hence I would like to know which unit is optimal for the specification of \textwidth or, in general, horizontal lengths? Of course it is not \baselineskip but what then?

My current specification is as follows:


In theory you can use any supported unit. What is important, however, is that in case you have only normal paragraph text that this text properly fills the page (meaning that it doesn't have to be stretched apart to fill the page body as there may be nothing to stretch). It is therefore useful to define the \textheight as a function of \baselineskip and \topskip.

\baselineskip  is the distance from one baseline to the next in a paragraph
\topskip       is the distance from the top of the page area to the baseline of 
               the first line (if the page starts with a line)

For example in the standard book class (without an option like 11pt) the \baselineskipis 12pt and the \topskip is 10pt so a page with 40 lines should be 478pt. Of course you could achieve the same by giving the equivalent of that value in cm or mm but given that baselineskips are traditionally specified in points ...

If you use a value that isn't a multiple of baselineskip + topskip you may find to get "underfull" warnings, because TeX then tries to stretch pages to fill all space (that would happen in the bookclass, for example, as this class uses the setting `\flushbottom).

However, a better solution might be to use the package geometry that does a lot of work like this for you when setting up the page area. Have a look at its documentation.

  • In fact, I do use geometry --> I edited my original question accordingly! Do I still have to add \topskip to multiple of \baselienskip? – lpdbw Aug 6 '12 at 17:51
  • 2
    @lpdbw Don't worry: the heightrounded option of geometry performs the necessary computations to ensure that the final text height contains an integer number of lines, keeping into account the difference between \topskip and \baselineskip. – egreg Aug 6 '12 at 18:02
  • heightrounded does that for you behind the scenes for you, which is one of the reasons why I suggested geometry in the first place. – Frank Mittelbach Aug 6 '12 at 18:37

It really doesn't matter. Traditionally the text width would be given in pt (or commonly pica, pc = 12pt). TeX doesn't care but if you give font related sizes in terms of pt but paper related sizes in terms of conventional units such as cm or in it is harder to keep track of their relationship than if you use pt throughout. The book class uses a wild mix of pt and in units for setting the text and column width related parameters for various mostly historical reasons.

The analog of the advice for keeping \textheight and \topskip and \baselineskip in sync would be to make the text width \parindent plus a multiple of the character width, but that only makes sense if the text is mostly monospace, so isn't really relevant.

Note in the vertical case \textheight should be \topskip + an integer multiple of \baselineskip as \topskip controls where the first line goes.

  • Too short for an answer so I'll just comment here: You can do fun stuff with dimen registers: say your text width is 27 picas, then you can just say \vsize=1.62\hsize to have golden ratio between the width and height! (or, I guess I should say \textheight and \textwidth, but anyway) – morbusg Aug 6 '12 at 19:16

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.