LaTeX and Books

133 views
Skip to first unread message

Rafael Beraldo

unread,
Nov 20, 2010, 12:02:38 PM11/20/10
to latexus...@googlegroups.com
Hello,

Since I've read Robert Bringhurst's amazing Elements of typographic style, I've been trying to deal with some problems I have when using LaTeX. I've been searching for information on book design and LaTeX and, although I know there are a handful people using Lamport's system to typeset books, I haven't found introductory information on the subject.

My main problem are widows and orphans. Commands such as \widowpenalty and \looseness simply won't work. Actually, the penalty system only shows difference when set to 10000, which gives an awkward output. \baselinestrech is not the most elegant solution, since it's visible that the text is almost invading the page number area.

So, my question is: what packages should I use to typeset books? I've read most of memoir's manual but it hasn't solved my problems with vertical spacing. What background information on book typesetting and LaTeX there is?

Thank you,

--
Rafael Beraldo

Peter Flynn

unread,
Nov 20, 2010, 6:47:38 PM11/20/10
to latexus...@googlegroups.com
On Sat, Nov 20, 2010 at 5:02 PM, Rafael Beraldo <rber...@cabaladada.org> wrote:
Hello,

Since I've read Robert Bringhurst's amazing Elements of typographic style, I've been trying to deal with some problems I have when using LaTeX. I've been searching for information on book design and LaTeX and, although I know there are a handful people using Lamport's system to typeset books, I haven't found introductory information on the subject.

There isn't much, although quite a lot of books are actually set using LaTeX, and quite a lot of people doing it, including me.
 
My main problem are widows and orphans. Commands such as \widowpenalty and \looseness simply won't work.

Do you mean they are non-functional (make no difference at all), or that they don't have the effect you expect? Just saying "they don't work" isn't useful, as it doesn't give us enough information to fix the problem. They work fine for me, and unless the page layout is very unusual, they ought to work for you, so I suspect there is something else in your settings that you haven't told us about.
 
Actually, the penalty system only shows difference when set to 10000, which gives an awkward output. \baselinestrech is not the most elegant solution, since it's visible that the text is almost invading the page number area.

Extending the text area is really a last resort, and I only ever do it by one line unless the layout has plenty of space at the foot, in which case two lines. But a lot will depend on the layout and the nature of the text (length of paragraphs, extra space caused by figures, tables, math, etc).
 
So, my question is: what packages should I use to typeset books? I've read most of memoir's manual but it hasn't solved my problems with vertical spacing. What background information on book typesetting and LaTeX there is?

I haven't used memoir (I probably should). I had the benefit of starting very early with TeX, so I had to read the TeXbook, and ultimately that's where the fine detail of the page-breaking algorithm is.

///Peter

Rafael Beraldo

unread,
Nov 20, 2010, 7:17:41 PM11/20/10
to latexus...@googlegroups.com
On 20 November 2010 21:47, Peter Flynn <angleb...@gmail.com> wrote:
On Sat, Nov 20, 2010 at 5:02 PM, Rafael Beraldo <rber...@cabaladada.org> wrote:
There isn't much, although quite a lot of books are actually set using LaTeX, and quite a lot of people doing it, including me.

Do you mean they are non-functional (make no difference at all), or that they don't have the effect you expect? Just saying "they don't work" isn't useful, as it doesn't give us enough information to fix the problem. They work fine for me, and unless the page layout is very unusual, they ought to work for you, so I suspect there is something else in your settings that you haven't told us about.

I'm not using nothing unusual. \windowpenalty does not make difference at all unless I set it to 10000. As for \looseness, I have an example: I had a paragraph which would end with two words (Lady Di) on the next page, and no matter what \looseness I set, those two words would always be placed on the next page.


Extending the text area is really a last resort, and I only ever do it by one line unless the layout has plenty of space at the foot, in which case two lines. But a lot will depend on the layout and the nature of the text (length of paragraphs, extra space caused by figures, tables, math, etc).
I haven't used memoir (I probably should). I had the benefit of starting very early with TeX, so I had to read the TeXbook, and ultimately that's where the fine detail of the page-breaking algorithm is.

///Peter

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

Thank you for the answer, Peter. 

I was browsing my articles and books and tutorials on LaTeX today, and found a decent solution to deal with orphans and widows: rubber band values between paragraphs. I put

\setlength{\parskip}{2pt plus 1mm minus 1mm}

Which gave LaTeX enough room to place the text properly, and 1mm is a reasonable variation, almost unnoticeable. I also managed to get rid of the “overfull hboxes” using the sloppypar environment which, in most cases, gives a seemly output.

Well, I'll keep on collecting articles on book design (the PracTeX Journal has some nice ones). This may be the only way to learn LaTeX fully. I've  been using it for about two years and I'm not quite proficient. When I'm comfortable enough with to do everything a good typographer can and should do, I'll try to write the most comprehensive article I can.

If you have any tips and highlights, they would be welcome.

Peter Flynn

unread,
Nov 20, 2010, 7:37:29 PM11/20/10
to latexus...@googlegroups.com
On Sun, Nov 21, 2010 at 12:17 AM, Rafael Beraldo <rber...@cabaladada.org> wrote:
On 20 November 2010 21:47, Peter Flynn <angleb...@gmail.com> wrote:
On Sat, Nov 20, 2010 at 5:02 PM, Rafael Beraldo <rber...@cabaladada.org> wrote:
There isn't much, although quite a lot of books are actually set using LaTeX, and quite a lot of people doing it, including me.

Do you mean they are non-functional (make no difference at all), or that they don't have the effect you expect? Just saying "they don't work" isn't useful, as it doesn't give us enough information to fix the problem. They work fine for me, and unless the page layout is very unusual, they ought to work for you, so I suspect there is something else in your settings that you haven't told us about.

I'm not using nothing unusual. \windowpenalty does not make difference at all unless I set it to 10000. As for \looseness, I have an example: I had a paragraph which would end with two words (Lady Di) on the next page, and no matter what \looseness I set, those two words would always be placed on the next page.

Did you try \enlargethispage{\baselineskip}, which usually allows one extra line on the page.
\looseness is a plain TeX command: it may or may not work with some LaTeX packages.

I was browsing my articles and books and tutorials on LaTeX today, and found a decent solution to deal with orphans and widows: rubber band values between paragraphs. I put

\setlength{\parskip}{2pt plus 1mm minus 1mm}

I'm sorry, I should have mentioned this: it's the default solution, so I assumed you had already tried it. It is also disallowed by most publishers working to a grid or specifying type be set solid. It works best with a layout that allows or encourages space between non-indented paragraphs (like a business report).
 
Which gave LaTeX enough room to place the text properly, and 1mm is a reasonable variation, almost unnoticeable.

Unfortunately not in the typesetting business, where even a 1pt variation would be noticed.
 
I also managed to get rid of the “overfull hboxes” using the sloppypar environment which, in most cases, gives a seemly output.

What was causing them? They should be rare unless your type size is larger than optimal for the line-length, or the text contains a lot of unhyphenatable words.
 
Well, I'll keep on collecting articles on book design (the PracTeX Journal has some nice ones). This may be the only way to learn LaTeX fully. I've  been using it for about two years and I'm not quite proficient. When I'm comfortable enough with to do everything a good typographer can and should do, I'll try to write the most comprehensive article I can.

You're doing well, and an article for PracTeX or TUGboat would be very valuable.

///Peter

Rafael Beraldo

unread,
Nov 20, 2010, 8:56:52 PM11/20/10
to latexus...@googlegroups.com
On 20 November 2010 22:37, Peter Flynn <angleb...@gmail.com> wrote:
On Sun, Nov 21, 2010 at 12:17 AM, Rafael Beraldo <rber...@cabaladada.org> wrote:
On 20 November 2010 21:47, Peter Flynn <angleb...@gmail.com> wrote:
On Sat, Nov 20, 2010 at 5:02 PM, Rafael Beraldo <rber...@cabaladada.org> wrote:
There isn't much, although quite a lot of books are actually set using LaTeX, and quite a lot of people doing it, including me.

Do you mean they are non-functional (make no difference at all), or that they don't have the effect you expect? Just saying "they don't work" isn't useful, as it doesn't give us enough information to fix the problem. They work fine for me, and unless the page layout is very unusual, they ought to work for you, so I suspect there is something else in your settings that you haven't told us about.

I'm not using nothing unusual. \windowpenalty does not make difference at all unless I set it to 10000. As for \looseness, I have an example: I had a paragraph which would end with two words (Lady Di) on the next page, and no matter what \looseness I set, those two words would always be placed on the next page.

Did you try \enlargethispage{\baselineskip}, which usually allows one extra line on the page.
\looseness is a plain TeX command: it may or may not work with some LaTeX packages. 

\enlargethispage{\baselineskip} does work. It must be a LaTeX package that's not letting \looseness work, then.
 

I was browsing my articles and books and tutorials on LaTeX today, and found a decent solution to deal with orphans and widows: rubber band values between paragraphs. I put

\setlength{\parskip}{2pt plus 1mm minus 1mm}

I'm sorry, I should have mentioned this: it's the default solution, so I assumed you had already tried it. It is also disallowed by most publishers working to a grid or specifying type be set solid. It works best with a layout that allows or encourages space between non-indented paragraphs (like a business report).
 
Which gave LaTeX enough room to place the text properly, and 1mm is a reasonable variation, almost unnoticeable.

Unfortunately not in the typesetting business, where even a 1pt variation would be noticed.

So, what is the real solution? I'm trying to typeset a book the closest I can to what real typographers do.
 
 
I also managed to get rid of the “overfull hboxes” using the sloppypar environment which, in most cases, gives a seemly output.

What was causing them? They should be rare unless your type size is larger than optimal for the line-length, or the text contains a lot of unhyphenatable words.

I'm using memoir's default text block size and Linux Libertine at 12 pt. It's probably larger than the ideal, since the default size is 10 pt.
 
 
Well, I'll keep on collecting articles on book design (the PracTeX Journal has some nice ones). This may be the only way to learn LaTeX fully. I've  been using it for about two years and I'm not quite proficient. When I'm comfortable enough with to do everything a good typographer can and should do, I'll try to write the most comprehensive article I can.

You're doing well, and an article for PracTeX or TUGboat would be very valuable.

///Peter

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

Peter Flynn

unread,
Nov 21, 2010, 11:44:36 AM11/21/10
to latexus...@googlegroups.com
On Sun, Nov 21, 2010 at 1:56 AM, Rafael Beraldo <rber...@cabaladada.org> wrote:
[...]

\enlargethispage{\baselineskip} does work. It must be a LaTeX package that's not letting \looseness work, then.

Maybe. In general you shouldn't expect plain TeX macros to work identically in LaTeX.
\looseness seems only to be referenced in the following packages

$ find /usr/share/texmf-texlive/tex/latex -type f -name '*.sty' -exec grep looseness {} \; -ls | grep texlive/ | awk '{print "basename " $NF}' | sh
rmpage.sty
formlett.sty
gmutils.sty
savetrees.sty
fwlw.sty
mynormal.sty
l3names.sty
lstlang3.sty

So if you're using one of those, \looseness may do something different to what the TeXbook says.
 
 So, what is the real solution? I'm trying to typeset a book the closest I can to what real typographers do.

It depends on the nature of the text: without seeing it, and all your code, it's not possible to give a general "magic wand" answer.

The best tip I ever had was from Barbara Beeton at the AMS: "let paragraph-mode do the work whenever possible". In effect, this means keep everything as simple as possible (Occam's Razor) because TeX's internal default usually do the right thing. Only intervene (eg with a package) when necessary.
 
I'm using memoir's default text block size and Linux Libertine at 12 pt. It's probably larger than the ideal, since the default size is 10 pt.

12pt may be a little big for a book, but it depends on your readership. I'm afraid I'm not a memoir user (yet :-) so I can't help with its formatting.
 
///Peter


Rafael Beraldo

unread,
Nov 21, 2010, 12:23:16 PM11/21/10
to latexus...@googlegroups.com
On 21 November 2010 14:44, Peter Flynn <angleb...@gmail.com> wrote:
Maybe. In general you shouldn't expect plain TeX macros to work identically in LaTeX.
\looseness seems only to be referenced in the following packages

$ find /usr/share/texmf-texlive/tex/latex -type f -name '*.sty' -exec grep looseness {} \; -ls | grep texlive/ | awk '{print "basename " $NF}' | sh
rmpage.sty
formlett.sty
gmutils.sty
savetrees.sty
fwlw.sty
mynormal.sty
l3names.sty
lstlang3.sty

So if you're using one of those, \looseness may do something different to what the TeXbook says.

I'm not using any of those packages…
 
 
 So, what is the real solution? I'm trying to typeset a book the closest I can to what real typographers do.

It depends on the nature of the text: without seeing it, and all your code, it's not possible to give a general "magic wand" answer.

The best tip I ever had was from Barbara Beeton at the AMS: "let paragraph-mode do the work whenever possible". In effect, this means keep everything as simple as possible (Occam's Razor) because TeX's internal default usually do the right thing. Only intervene (eg with a package) when necessary.

My document has about 140 pages. I get something like 40 overfull hboxes, almost all of them can be solved by inputing the hyphenation pattern to the word in question. Since I'm using memoir with the option “twoside”, it automatically activates the command \flushbottom. This, however, causes some orphans and specially widows. It could be solved using \raggedbottom, but that's far from acceptable for a book. So I preferred using rubber band space values between the paragraphs, even though the ideal is to have no space at all.

If you know git, you can grab the code at https://github.com/revberaldo/Contos-Discordianos


12pt may be a little big for a book, but it depends on your readership. I'm afraid I'm not a memoir user (yet :-) so I can't help with its formatting.

Yesterday I changed this value to 11pt. memoir's default value is 10pt. I don't want to use 10pt, since the book will look too short if I do.

memoir's awesome. It has nice ways to specify the typeblock size, for instance, including with a command that gets the size of the whole alphabet in pc for the font you are using. The command

\settypeblocksize{*}{\lxvchars}{1.618}

typeset a typeblock with the ideal \textwidth size (this number is given by \lxvchars), with \textheight in the proportion of 1.618 to 1.
 
 
///Peter


--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

jon

unread,
Nov 21, 2010, 4:14:23 PM11/21/10
to LaTeX Users Group
On Nov 21, 12:23 pm, Rafael Beraldo <rbera...@cabaladada.org> wrote:
> My document has about 140 pages. I get something like 40 overfull hboxes,
> almost all of them can be solved by inputing the hyphenation pattern to the
> word in question.

you may find the microtype package can solve many of these overfull
hboxes (though if you're using linux libertine as the font, maybe
you're also using xetex, and i'm not sure if xetex and microtype play
nicely together -- yet).

cheers,
jon.

stefano franchi

unread,
Dec 13, 2010, 4:29:10 PM12/13/10
to latexus...@googlegroups.com


No, not yet. But Lua(La)TeX does support  microtype and allows to use al fonnts (since fontspec supports LuaTeX now). 

Cheers,

Stefano


cheers,
jon.
Reply all
Reply to author
Forward
0 new messages