首先,我使用的是 Classic Thesis 样式表的略微修改版本。这个文档太复杂了,无法全部共享,所以存在这个因素。
尽管如此,我在下面的例子中重现了这个问题。(抱歉太长了……为了显示孤儿,你需要大量的填充文字)
问题是,尽管设置了 \clubpenalty 和 \widowpenalty,但在诗句中,孤行和寡行是允许的。如果不设置这些,正常的段落文本将会出现孤行/寡行,但设置了它们后,段落文本中的孤行/寡行就会消失,但诗句中的不会消失。
有什么建议或技巧可以解决这个问题?我不介意“底部参差不齐”或“节间距灵活”的解决方案,但我更希望它是程序化的。也就是说,\enlargethispage{-\baselineskip} 在某些特定情况下有效,但当页面上有其他内容时就会出现问题,实际上创造孤儿/寡妇,否则会正确显示。(见示例)
% book example for classicthesis.sty
\documentclass[11pt,paper=5.75in:9in,footinput=true,headinput=true]{scrbook} %
\usepackage{verse}
% Remove this and you get an orphan with our paragraphs.
% Either way we get an orphan with the verse package
\clubpenalty=9996
\widowpenalty=9999
\brokenpenalty=4991
\predisplaypenalty=10000
\postdisplaypenalty=1549
\displaywidowpenalty=1602
\begin{document}
\settowidth{\versewidth}{Lorem ipsum dolor sit amet,}
\begin{verse}[\versewidth]
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
% this fixes a widow.
\enlargethispage{-\baselineskip}
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
\end{verse}
\settowidth{\versewidth}{Lorem ipsum dolor sit amet,}
\begin{verse}[\versewidth]
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
% Here this creates an orphan.
\enlargethispage{-\baselineskip}
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
Lorem ipsum dolor sit amet,\\
consectetur adipisicing elit,\\
sed do eiusmod tempor incididunt\\
ut labore et dolore magna aliqua.\\!
\end{verse}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
ps 我不确定如何嵌入 pdf? 此处为我编译的 pdf 链接(已设置惩罚):https://www.dropbox.com/s/2cjv6sipybwfpu2/ran-test.pdf
答案1
内部\\
处于类似的环境\par
中verse
,因此原始惩罚没有效果,因为它们都是一行段落。
但是你可以使用它\\*
而不是\\
如果你替换它们全部那么分页符只会发生在诗句之间,或者你可以在第一行和最后一行使用它,或者任何你需要的东西。