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

Jonathan Kew jonathan_kew at sil.org
Tue May 13 13:50:28 CEST 2008


On 13 May 2008, at 12:34 pm, SUN Wenchang wrote:

>
>
> 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.

....which indicates that this is not a XeTeX issue; a general (La)TeX  
list would have been a better place for it.  :)

>
> What is wrong with it?

Your "\color{blue}" produces a \special node, and if this occurs in  
vertical mode (i.e., before the paragraph has actually started), it  
defeats the \section command's efforts to ensure it stays with the  
following text. I haven't checked exactly what happens, but you  
probably get inter-paragraph and/or inter-line glue after the  
\special, and it is now separated from the \penalty that was supposed  
to apply.

To correct this, try

   \def\aaa{{\leavevmode\color{blue}\texttt{aaa}}}

which ensures that TeX enters horizontal mode before the \special is  
generated, so that it doesn't disrupt the inter-paragraph penalties  
that \section is using.

JK


>
>
> Wenchang
>
> ================================================================
> \documentclass {article}
> \usepackage{color}
> \textheight 60mm
> \def\aaa{{\color{blue}\texttt{aaa}}}
> \begin{document}
> \section{page break}
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
>  some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. s! ome texts.
> some texts. some texts. some texts. some texts.
>
> \section{page break}
> \aaa\
> This is an incorrect page break.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> some texts. some texts. some texts. some texts.
> \end{document}
> ================================================================
>
>
>
> 下載 Windows Live Messenger 8.5 最新版,多元溝通、盡情 
> 分享,和即時傳訊好友線上同樂!— 立即下載
>
> 下載 Windows Live Messenger 8.5 最新版,多元溝通、盡情 
> 分享,和即時傳訊好友線上同樂!— 立即下載 
> <ex1.pdf><ex1.tex>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20080513/70115ab3/attachment-0001.html 


More information about the XeTeX mailing list