我正在尝试排版一些诗歌,但我想强制在诗节之间进行分页,以避免在诗节内分页。我搜索了各种方法(如下面的示例所示),但似乎都没有用。有办法吗?
\documentclass[12pt]{scrartcl}
\usepackage[letterpaper,margin=1in]{geometry}
\setlength{\parskip}{12pt}
% try not to have a page break in the middle of a stanza
\widowpenalty=10000
\clubpenalty=10000
\linepenalty=400
\raggedbottom
\begin{document}
\begin{verse}
Lorem \textbf{ipsum} dolor sit amet, \emph{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. Donec\\gravida quis augue in
tincidunt.\\Ut pulvinar ac sapien venenatis dignissim.\\Fusce vulputate
congue dui, at dictum risus congue vel.\\Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
Lorem ipsum dolor sit amet,\\consectetur adipiscing elit.\\Sed
ullamcorper est in erat efficitur congue. Integer ullamcorper ac lorem
non maximus. Aliquam ut placerat nisl, eget euismod ante.
Sed ut perspiciatis\\unde omnis iste\\natus error sit\\voluptatem
accusantium.
Lorem \textbf{ipsum} dolor sit amet, \emph{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. Donec\\gravida quis augue in
tincidunt.\\Ut pulvinar ac sapien venenatis dignissim.\\Fusce vulputate
congue dui, at dictum risus congue vel.\\Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
ad minim veniam, quis nostrud\\exercitation ullamco laboris\\nisi ut
aliquip ex ea commodo\\consequat. Donec\\gravida quis augue in
tincidunt.\\Ut pulvinar ac sapien venenatis dignissim.\\Fusce vulputate
congue dui, at dictum risus congue vel.\\Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
ad minim veniam, quis nostrud\\exercitation ullamco laboris\\nisi ut
aliquip ex ea commodo\\consequat. Donec\\gravida quis augue in
tincidunt.\\Ut pulvinar ac sapien venenatis dignissim.\\Fusce vulputate
congue dui, at dictum risus congue vel.\\Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
\end{verse}
\end{document}
答案1
行和寡妇惩罚在内部不起作用verse
\\
,\par
因此在 Tex 原始级别上,每行都是一个单独的段落,这些惩罚在此起作用。您可以使用\\*
它来防止分页:
请注意,此版本不会产生有关未定义页面样式的错误。
\documentclass[12pt]{scrartcl}
%\pagestyle{fancy}
\usepackage[letterpaper,margin=1in]{geometry}
\setlength{\parskip}{12pt}
\begin{document}
\begin{verse}
Lorem \textbf{ipsum} dolor sit amet, \emph{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. Donec\\*gravida quis augue in
tincidunt.\\*Ut pulvinar ac sapien venenatis dignissim.\\*Fusce vulputate
congue dui, at dictum risus congue vel.\\*Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\*Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
Lorem ipsum dolor sit amet,\\*consectetur adipiscing elit.\\*Sed
ullamcorper est in erat efficitur congue. Integer ullamcorper ac lorem
non maximus. Aliquam ut placerat nisl, eget euismod ante.
Sed ut perspiciatis\\*unde omnis iste\\*natus error sit\\*voluptatem
accusantium.
Lorem \textbf{ipsum} dolor sit amet, \emph{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. Donec\\*gravida quis augue in
tincidunt.\\*Ut pulvinar ac sapien venenatis dignissim.\\*Fusce vulputate
congue dui, at dictum risus congue vel.\\*Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\*Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
ad minim veniam, quis nostrud\\*exercitation ullamco laboris\\*nisi ut
aliquip ex ea commodo\\*consequat. Donec\\*gravida quis augue in
tincidunt.\\*Ut pulvinar ac sapien venenatis dignissim.\\*Fusce vulputate
congue dui, at dictum risus congue vel.\\*Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\*Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
ad minim veniam, quis nostrud\\*exercitation ullamco laboris\\*nisi ut
aliquip ex ea commodo\\*consequat. Donec\\*gravida quis augue in
tincidunt.\\*Ut pulvinar ac sapien venenatis dignissim.\\*Fusce vulputate
congue dui, at dictum risus congue vel.\\*Vivamus rutrum commodo nunc,
sed elementum velit consectetur nec.\\*Aenean sit amet tellus non nisi
vulputate ornare. Vestibulum in nibh cursus, volutpat leo in, auctor
lacus. Donec euismod suscipit nunc sed tempus.
\end{verse}
\end{document}
答案2
在 poetryscol 中,您可以重新定义节环境,将惩罚更改为您想要的任何内容。Poemscol 还会自动标记在页面边界处有(或没有)节中断的情况。这可能对您也有帮助。
以下是 的一个最小示例poemscol
。惩罚实际上是为了稍微鼓励在节环境之间翻页。但如果在翻页处有节间断,则会在页面底部poemscol
放置(或您希望的任何内容)。*
\documentclass{article}
\usepackage{fancyhdr,geometry,keyval,ifthen,mparhack}
\usepackage{poemscol}
\stanzaatbottom{*}
\nostanzaatbottom{\relax}
\geometry{textwidth=4in,textheight=6.75in,headheight=14pt,paperwidth=6in,paperheight=9in}
\begin{document}
\poemtitle{The Funeral Day}
\epigraph{Suffield, Connecticut, 1952}
\begin{poem}
\begin{stanza}
Later, we folded our hands in his tidy room.\verseline
Patience taught us nothing: we sat for hours\verseline
While the brass clock mumbled to itself like a nun.\verseline
The shadows in the eaves began\verseline
To knot up all the air. And then outside\verseline
This bird just sang and sang and sang.\verseline
What was it to him? Where did he get the right?\verseline
I got up to close the window\end{stanza}
\begin{stanza}
And there I saw the tobacco-fields\verseline
Moving their shrouds in the dusk.\verseline
The wind came thoughtlessly over the wide cloth\verseline
And lifted the white undersides of leaves.\verseline
I didn't close the window. When I sat back down,\verseline
I didn't say what I had seen.\end{stanza}
\end{poem}
\end{document}
Poemscol 这样定义诗节环境:
\newenvironment{stanza}{\penalty-100\instanzatrue\mark{\nostanzaatbottomvalue\ }}
{\nobreak\mark{\stanzaatbottomvalue\ }\nobreak\ifspeciallinelock%
\relax\else%
\nolinebreak\incrementverselinenumber%
\fi%
\speciallinelockfalse%
\nobreak
\instanzafalse
\stanzaskip
}
如果您想要改变节环境以阻止甚至防止在节分隔处出现分页符,请使用\renewenvironment
并更改第一行中的惩罚值。