[XeTeX] FW: Incorrect page break: whose bug?

Morten Høgholm morten.hoegholm at gmail.com
Tue May 13 13:51:50 CEST 2008


2008/5/13 SUN Wenchang <sunwch at hotmail.com>:
>
>
> ________________________________
> From: sunwch at hotmail.com
> To: miktex-users at lists.sourceforge.net
> Subject: Incorrect page break: whose bug?
> Date: Tue, 13 May 2008 13:32:42 +0200
>
> Dear All,
>
> The following  tex file leads to an incorrect page break, no matter which
> one of latex, pdflatex, xelatex is used.
> What is wrong with it?
>
> Wenchang
>
> ================================================================
> \documentclass {article}
> \usepackage{color}
> \textheight 60mm
> \def\aaa{{\color{blue}\texttt{aaa}}}

This definition is wrong - if you use
  \def\aaa{\textcolor{blue}{\texttt{aaa}}}
I bet it'll work as you expect.

The problem is that the magic happening after \section is executed
inside the group you open to contain the color specification. This
includes \everypar being executed and the \clubpenalty which is what
LaTeX uses to keep the lines together in the beginning of a section.

As a general comment: always use the \textXYZ commands instead of the
declarations.

-- 
Morten


More information about the XeTeX mailing list