セクション前のページ区切りの自動判定の改善

セクション前のページ区切りの自動判定の改善

特定のセクション マクロがページの下部に近すぎる場合に限り、そのセクションのすぐ上に自動的に改ページを展開するようにしたいと思います。ここでの「近すぎる」とは、同じページにセクションの最初のエントリをタイプセットするのに十分なスペースがないことを意味します。

私はセクション分けを処理するために以下の2つの環境のいずれかを使用しています。「中程度の長さのプロフェッショナル」履歴書resume.cls:

% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
  \sectionskip
  \MakeUppercase{\bf #1} % Section title
  \sectionlineskip
  \hrule % Horizontal line
  \begin{list}{}{ % List for each individual item in the section
    \setlength{\leftmargin}{1.5em} % Margin within the section
  }
  \item[]
}{
  \end{list}
}

\newenvironment{rSection*}[2]{ % 2 input arguments - section name and parenthetical
  \sectionskip
  \MakeUppercase{\bf #1} % Section title
  {\bf (#2)} % parenthetical
  \sectionlineskip
  \hrule % Horizontal line
  \begin{list}{}{ % List for each individual item in the section
    \setlength{\leftmargin}{1.5em} % Margin within the section
  }
  \item[]
}{
  \end{list}
}

下記のような問題の発生を防ぐために、これらを修正したいと思います。それなし\pagebreak[N]些細なコマンドの使用は\enlargethispage{k}、私のユースケースのほとんどには不十分です。また、コードを最新のものにリファクタリングする必要もありません。モダンCV–型クラス。

説明したページ分割の問題の例。

上の画像では、小さな灰色の線が現在のページ区切りを示していることに注意してください。この例では、「国際協力活動」というタイトルのセクションは、最初のエントリ ( $C_{1}$) を含む次のページに自動的に移動されるはずです。

(注: MWE を提供しなくて済むようにしたいと思っています。数日後に誰も提案しない場合は、MWE を提供します。)

答え1

感謝デビッド・カーライルの使用するための優れた提案needspace(以前は知らなかったのですが)、私はこれを解決しました( についてrSection)。

以下のパッチで十分です:

\patchcmd{\rSection}{\sectionskip}{\sectionskip \needspace{6em}}{}{}

関連情報