<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 13 May 2008, at 12:34 pm, SUN Wenchang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <br><br> <blockquote> <hr> From: <a href="mailto:sunwch@hotmail.com">sunwch@hotmail.com</a><br>To: <a href="mailto:miktex-users@lists.sourceforge.net">miktex-users@lists.sourceforge.net</a><br>Subject: Incorrect page break: whose bug?<br>Date: Tue, 13 May 2008 13:32:42 +0200<br><br> Dear All,<br> <br>The following  tex file leads to an incorrect page break, no matter which one of latex, pdflatex, xelatex is used.</blockquote></blockquote><div><br class="webkit-block-placeholder"></div><div>....which indicates that this is not a XeTeX issue; a general (La)TeX list would have been a better place for it.  :)</div><br><blockquote type="cite"><blockquote><br>What is wrong with it?</blockquote></blockquote><div><br class="webkit-block-placeholder"></div><div>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.</div><div><br class="webkit-block-placeholder"></div><div>To correct this, try</div><div><br class="webkit-block-placeholder"></div><div><div>  \def\aaa{{\leavevmode\color{blue}\texttt{aaa}}}</div><div><br class="webkit-block-placeholder"></div><div>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.</div><div><br class="webkit-block-placeholder"></div><div>JK</div><div><br class="webkit-block-placeholder"></div></div><br><blockquote type="cite"><blockquote><br> <br>Wenchang<br> <br>================================================================<br>\documentclass {article}<br>\usepackage{color}<br>\textheight 60mm<br>\def\aaa{{\color{blue}\texttt{aaa}}}<br>\begin{document}<br>\section{page break}<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br> some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. s! ome texts.<br>some texts. some texts. some texts. some texts.<br> <br>\section{page break}<br>\aaa\<br>This is an incorrect page break.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>some texts. some texts. some texts. some texts.<br>\end{document} <br>================================================================<br> <br><br><br> <hr> 下載 Windows Live Messenger 8.5 最新版,多元溝通、盡情分享,和即時傳訊好友線上同樂!— <a href="http://get.live.com/zh-cht-tw/betas/messenger_betas" target="_blank">立即下載</a> </blockquote><br><hr>下載 Windows Live Messenger 8.5 最新版,多元溝通、盡情分享,和即時傳訊好友線上同樂!—  <a href="http://get.live.com/zh-cht-tw/betas/messenger_betas" target="_new">立即下載</a><span>&lt;ex1.pdf&gt;</span><span>&lt;ex1.tex&gt;</span><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">XeTeX mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:postmaster@tug.org">postmaster@tug.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</a></div> </blockquote></div><br></body></html>