冗长且包含大量诗句的文档中存在孤立标题

冗长且包含大量诗句的文档中存在孤立标题

我正在排版我整理的一本英文诗集。这是一份很长的文件,超过 500 页,而该项目的性质意味着绝大多数文本被包裹在大约一千个环境。虽然我已经设法使排版基本符合我的要求,但仍然有大约二十几个孤立标题,我希望能够解决。

这是最小工作示例问题:

\documentclass{amsbook}

\title{Hosker's Almanack}

\usepackage{verse, xfrac}

% Fix fractions.
\usepackage{xfrac}
\DeclareInstance{xfrac}{cmunrm.otf(0)}{text}{
    slash-symbol-font = ptm,
    scale-factor=0.8,
    numerator-top-sep = 0pt,
    denominator-bot-sep = 0pt,
    slash-right-kern=-.25em,
    slash-left-kern=-.3em
}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{0}
\renewcommand{\chaptername}{}
\renewcommand{\thechapter}{}

\begin{document}

\frontmatter

\maketitle

\tableofcontents

\mainmatter

\renewcommand\thesection{{\Roman{section}}}
\renewcommand\thefootnote{{\thesubsection.}}
\makeatletter
\def\blfootnote{\xdef\@thefnmark{}\@footnotetext}
\renewcommand{\@makefnmark}{\hbox{{{{\@thefnmark}}}}\hbox{{{{ }}}}}
\makeatother

\part{The Almanack Proper}

\chapter{Primilis}

\bigskip
\bigskip
\section{}

\subsection{}

\settowidth{\versewidth}{{\vin} {\vin} A burning forehead, and a parching tongue.}
\begin{verse}[\versewidth]
Thou still unravished bride of quietness,\\*\footnotetext{`Ode on a Grecian Urn', John Keats (1795 -- 1821)}
{\vin} Thou foster-child of silence and slow time,\\
Sylvan historian, who canst thus express\\
{\vin} A flowery tale more sweetly than our rhyme:\\
What leaf-fringed legend haunts about thy shape\\
{\vin} Of deities or mortals, or of both,\\
{\vin} {\vin} In \textsc{Tempe} or the dales of Arcady?\\
{\vin} What men or gods are these? What maidens loth?\\
What mad pursuit? What struggle to escape?\\*
{\vin} {\vin} What pipes and timbrels? What wild ecstasy?\\!

Heard melodies are sweet, but those unheard\\*
{\vin} Are sweeter; therefore, ye soft pipes, play on;\\
Not to the sensual ear, but, more endeared,\\
{\vin} Pipe to the spirit ditties of no tone:\\
Fair youth, beneath the trees, thou canst not leave\\
{\vin} Thy song, nor ever can those trees be bare;\\
{\vin} {\vin} Bold lover, never, never canst thou kiss,\\
Though winning near the goal yet, do not grieve;\\
{\vin} She cannot fade, though thou hast not thy bliss,\\*
{\vin} {\vin} For ever wilt thou love, and she be fair!\\!

Ah, happy, happy boughs, that cannot shed\\*
{\vin} Your leaves, nor ever bid the spring adieu;\\
And, happy melodist, unwearied,\\
{\vin} For ever piping songs for ever new;\\
More happy love! more happy, happy love!\\
{\vin} For ever warm and still to be enjoyed,\\
{\vin} {\vin} For ever panting, and for ever young;\\
All breathing human passion far above,\\
{\vin} That leaves a heart high-sorrowful and cloyed,\\*
{\vin} {\vin} A burning forehead, and a parching tongue.\\!

Who are these coming to the sacrifice?\\*
{\vin} To what green altar, O mysterious priest,\\
Lead'st thou that heifer lowing at the skies,\\
{\vin} And all her silken flanks with garlands drest?\\
What little town by river or sea shore,\\
{\vin} Or mountain-built with peaceful citadel,\\
{\vin} {\vin} Is emptied of this folk, this pious morn?\\
And, little town, thy streets for evermore\\
{\vin} Will silent be; and not a soul to tell\\*
{\vin} {\vin} Why thou art desolate, can e'er return.\\!

O attic shape! Fair attitude! with brede\\*
{\vin} Of marble men and maidens overwrought,\\
With forest branches and the trodden weed;\\
{\vin} Thou, silent form, dost tease us out of thought\\
As doth eternity: cold pastoral!\\
{\vin} When old age shall this generation waste,\\
{\vin} {\vin} Thou shalt remain, in midst of other woe\\
Than ours, a friend to man, to whom thou say'st,\\
{\vin} `Beauty is truth, truth beauty -- that is all\\*
{\vin} {\vin} Ye know on earth, and all ye need to know.'
FILLER\\
FILLER\\
FILLER\\
FILLER\\
FILLER\\
FILLER\\
FILLER\\
FILLER\\
FILLER\\
\end{verse}

\subsection{}

\settowidth{\versewidth}{{\vin} He stared at the Pacific -- and all his men}
\begin{verse}[\versewidth]
Much have I travelled in the realms of gold,\\*\footnotetext{`On First Looking into Chapman's Homer', John Keats (1795 -- 1821).}
{\vin} And many goodly states \& kingdoms seen;\\
{\vin} Round many western islands have I been\\
Which bards in fealty to \textit{Apollo} hold.\\
Oft of one wide expanse had I been told\\
{\vin} That deep-browed \textit{Homer} ruled as his demesne,\\
{\vin} Yet did I never breathe its pure serene\\
Till I heard \textit{Chapman} speak out loud \& bold.\\
Then felt I like some watcher of the skies\\
{\vin} When a new planet swims into his ken;\\
Or like stout \textit{Cortez}, when with eagle eyes\\
{\vin} He stared at the Pacific -- and all his men\\
Looked at each other with a wild surmise --\\*
{\vin} Silent, upon a peak in Darien.
\end{verse}

\subsection{}

\settowidth{\versewidth}{Let the dead bury their dead.}
\begin{verse}[\versewidth]
Let the dead bury their dead.\footnotetext{Matthew 8.22}
\end{verse}

\end{document}

这是我编译上述代码时出现问题的屏幕截图:

在此处输入图片描述

答案1

在此处输入图片描述

verseverse是由一个项目trivlist组成的显示环境。

因此,在诗句之前打破的惩罚是在之前打破的惩罚,\item所以它为负数(-51),表示打破的好地方。

您可以将其设置为 10000,这样此时发生故障的可能性最大。在本地,或者如果没有您不想使用此设置的列表,您可以在序言中设置它。

上面的设置与您的示例相同,并添加了

\makeatletter

\@beginparpenalty=10000

\makeatother

\begin{document}

答案2

也许在之前和之后添加一些空格和粘连\subsection有助于解决问题。(这个 MWE 确实如此,必须在实际文档中尝试)

从类中获取的值book

\makeatletter
\renewcommand\subsection{\@startsection{subsection}{2}{\normalparindent}%
    {-3.25ex\@plus -1ex \@minus -.2ex}%
    {1.5ex \@plus .2ex}%
    {\normalfont\bfseries}}
\makeatother

放在 之前\begin{document}

测试敏感度:

(1)尝试用九FILLER\\行:完整的 I.3 小节转到下一页。

(2)删除一两FILLER\\行:完整的 I.3 小节仍然转到下一页。

(3)然后删除三处:整个小节I.3与I.2保留在同一页上。

(4)最后用 11FILLER\\行进行测试。完整的 I.2 保留在页面中。

原始 MWE 9FILLER\\

a9

有 7 条FILLER\\线

b7

有 6 条FILLER\\线

c6

相关内容