\titleformat (titlesec) 溢出 vbox 分页符问题

\titleformat (titlesec) 溢出 vbox 分页符问题

我目前正在编写一本规则手册,使用部分/子部分/子子部分/段落将规则分解成几个部分。我正在使用 titlesec 包来格式化这些部分;但是,我遇到的问题是,如果 \titleformat 的“悬挂”形状超出页面底部边距,则不会自动导致分页符(与“连续”形状相反)。有没有办法通过制作某种“悬挂/连续”混合来防止这种情况?

这是我的 titlesec 代码:

\titleformat{\section}[hang]{\bfseries\Large}{\thesection}{0.4em}{}
\titlespacing*{\section}{0pt}{2\baselineskip}{1.25\baselineskip}
\titleformat{\subsection}[hang]{\bfseries\large}{\thesubsection}{0.4em}{\mdseries\normalsize}
\titlespacing*{\subsection}{2em}{1\baselineskip}{1\baselineskip}
\titleformat{\subsubsection}[hang]{\bfseries\large}{\thesubsubsection}{0.4em}{\mdseries\normalsize}
\titlespacing*{\subsubsection}{4em}{1\baselineskip}{1\baselineskip}
\titleformat{\paragraph}[hang]{\bfseries\large}{\theparagraph}{0.4em}{\mdseries\normalsize}
\titlespacing*{\paragraph}{6em}{1\baselineskip}{1\baselineskip}

以下是内容:

\chapter{Rules}
\section{Distribution of Power}

    \subsection{The following list describes the hierarchy of power in the League:}
        \begin{enumerate}
            \item League Commissioner
            \item Deputy League Commissioner and Divisionals Commissioners
            \item Director of Operations and Deputy Divisional League Commissioners
            \item Deputy Director of Operations
            \item Forum Administrators
            \item Game Officials
            \item General Managers
            \item Assistant General Managers
        \end{enumerate}

    \subsection{Each rank listed above has veto power over all ranks listed below it on all domains.}

\section{Divisions, Promotion, and Relegation}

    \subsection{Divisions}

        \subsubsection{No division can have more than 16 teams}

            \paragraph{League officials have the right to promote/relegate teams if necessary to maintain the 16 team maximum.}

        \subsubsection{No division can have fewer than 4 teams.}

            \paragraph{If there is more than one division and one division has fewer than 4 teams, the teams from the next highest division must be promoted by the start of the following season to maintain the 4 team minimum.}

            \paragraph{If there is more than one division and the lowest division has fewer than 4 teams, the teams from that division must be promoted by the start of the following season to maintain the 4 team minimum.}

            \paragraph{League officials have the right to divide teams as they see fit to maintain the 4 team minimum.}

        \subsubsection{A new division must be made if all existing divisions have at least 12 teams and the new division has at least 4.}

        \subsubsection{Divisions with 8 or more teams shall be split into 2 conferences}

            \paragraph{Those conferences shall be referred to as the Eastern and Western conferences in this text; although, a Divisional Commissioner may provide a different name for each conference.}

        \subsubsection{Each division must have its own Commissioner, Deputy Commissioner, Director of Operations, Deputy Director of Operations, match hosts, match officials, and match streamers.}

            \paragraph{It is not necessary for smaller divisions (fewer than 8 teams) to have all these staff positions open. Divisional staff positions shall be opened by the League Commissioner (or Deputy Commissioner) when he or she feels it is appropriate.}

    \subsection{Promotion and Relegation}

        \subsubsection{At the end of each season, some teams will be promoted or relegated based on the number of teams in their division and their rank among that division.}

            \paragraph{If a division has 4-8 teams, 1 team gets relegated and 1 team gets promoted.}

            \paragraph{If a division has 9-12 teams, 2 teams get relegated and 2 teams get promoted.}

            \paragraph{If a division has 13-16 teams, 3 teams get relegated and 3 teams get promoted.}

            \paragraph{No team may be promoted from the highest ranked division, as there is no division for those teams to be promoted to.}

            \paragraph{No team may be relegated from the lowest ranked division, as there is no division for those teams to be relegated to.}

        \subsubsection{Promotion and Relegation in a Division With 4 to 8 Teams}

            \paragraph{The Divisional Champions get promoted. The last place team gets relegated.}

            \paragraph{If there are only 4 teams in the division, the semi-final losers play in a 5 game series. The losing team from those matches is relegated.}

        \subsubsection{Promotion and Relegation in a Division With 9 to 12 Teams}

            \paragraph{Both the team finished first overall and the divisional playoff winner gain automatic promotion.}

            \paragraph{If the team that placed first overall also wins the Divisional Championship, the semi-final losers play in a 3 game series. The winner of this series plays a 3 game series with the runner up. The winner of this series is promoted.}

            \paragraph{The last placed team is automatically relegated.}

            \paragraph{The second and third to last place teams play in a 3 game relegation series. The loser of this series is relegated.}

        \subsubsection{Promotion and Relegation in a Division With 13 to 16 Teams}

            \paragraph{Both the team finished first overall and the divisional playoff winner gain automatic promotion.}

\section{Goals, Assists, and Match Reports}
\section{Player Conduct Policy}
\section{Matches}
\section{Playoffs}
\section{Draft and Roster Limit}
\section{Affiliation}
\section{Waivers, Free Agency, and Trading}

这是不理想的结果(请注意 II.B.1.d 以下的所有内容都被截断了):

答案1

这里有一个解决方案:它包括用具有空名称和标签的定理环境替换\subsection和分段命令。使用该包,我定义了一个和一个\paragraphntheoremRulesubRule定理环境。很容易为不同的定理设置不同的缩进,并且特别指定计数器。最后,可以将定理标签添加到目录中;我不明白为什么您要添加 \Rule 和 \subRule 的内容,因为它们会重复。也许我错了?

无论如何,这里有一个代码可以完成我认为你想要的功能:

\documentclass[a4paper,11pt,twoside]{book}%english,
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[nomarginpar]{geometry}
\usepackage{etoolbox} 
\usepackage[nobottomtitles]{titlesec}

\setcounter{tocdepth}{4}
\titleformat{\section}[hang]{\bfseries\Large}{\thesection}{0.4em}{}
\titlespacing*{\section}{0pt}{2\baselineskip}{1.25\baselineskip}
\renewcommand*\thesection{\Roman{section}}

\titleformat{\subsection}[hang]{\bfseries\large}{\thesubsection}{0.4em}{\mdseries\normalsize}
\titlespacing*{\subsection}{2em}{1\baselineskip}{1\baselineskip}
\renewcommand*\thesubsection{\thesection.\Alph{subsection}}
%
%\titleformat{\subsubsection}[block]{\bfseries\large}{\thesubsubsection}{0.4em}{\mdseries\normalsize}
%\titlespacing*{\subsubsection}{4em}{1\baselineskip}{1\baselineskip}
%\renewcommand*\thesubsubsection{\thesubsection.\arabic{subsubsection}}
%
%\titleformat{\paragraph}[block]{\bfseries\large}{\theparagraph}{0.4em}{\mdseries\normalsize}
%\titlespacing*{\paragraph}{6em}{1\baselineskip}{1\baselineskip}
%\renewcommand*\theparagraph{\thesubsubsection.\alph{paragraph}}

\usepackage{ntheorem}
\theoremstyle{change}
\theoremheaderfont{\bfseries\large}
\theorembodyfont{\mdseries\normalsize}
\theorempreskip{1\baselineskip}
\theorempostskip{1\baselineskip}

{%
\theoremnumbering{arabic}
\theoremindent = 4em%4
\theoremseparator{\hspace{-0.25em}}
\newtheorem{Rule}{}[subsection]
    }%
\AtEndEnvironment{Rule}{\addcontentsline{toc}{subsubsection}{\theRule}}
\newcommand\RULE[1]{\begin{Rule}#1\end{Rule}}

\theoremindent = 6em
\theoremseparator{\hspace{-0.25em}}
\theoremnumbering{alph}
\newtheorem{subRule}{}[Rule]
\AtEndEnvironment{subRule}{\addcontentsline{toc}{paragraph}{\thesubRule}}
\newcommand\SubRule[1]{\begin{subRule}#1\end{subRule}}

\begin{document}
\sffamily


\tableofcontents

\chapter{Rules}
\section{Distribution of Power}

    \subsection{The following list describes the hierarchy of power in the League:}
        \begin{enumerate}
            \item League Commissioner
            \item Deputy League Commissioner and Divisionals Commissioners
            \item Director of Operations and Deputy Divisional League Commissioners
            \item Deputy Director of Operations
            \item Forum Administrators
            \item Game Officials
            \item General Managers
            \item Assistant General Managers
        \end{enumerate}

    \subsection{Each rank listed above has veto power over all ranks listed below it on all domains.}

\section{Divisions, Promotion, and Relegation}

    \subsection{Divisions}

    \RULE{No division can have more than 16 teams}

        \SubRule{League officials have the right to promote/relegate teams if necessary to maintain the 16 team maximum.}

    \RULE{No division can have fewer than 4 teams.}

        \SubRule{If there is more than one division and one division has fewer than 4 teams, the teams from the next highest division must be promoted by the start of the following season to maintain the 4 team minimum.}

        \SubRule{If there is more than one division and the lowest division has fewer than 4 teams, the teams from that division must be promoted by the start of the following season to maintain the 4 team minimum.}

        \SubRule{League officials have the right to divide teams as they see fit to maintain the 4 team minimum.}

    \RULE{A new division must be made if all existing divisions have at least 12 teams and the new division has at least 4.}

    \RULE{Divisions with 8 or more teams shall be split into 2 conferences}

        \SubRule{Those conferences shall be referred to as the Eastern and Western conferences in this text; although, a Divisional Commissioner may provide a different name for each conference.}

    \RULE{Each division must have its own Commissioner, Deputy Commissioner, Director of Operations, Deputy Director of Operations, match hosts, match officials, and match streamers.}

        \SubRule{It is not necessary for smaller divisions (fewer than 8 teams) to have all these staff positions open. Divisional staff positions shall be opened by the League Commissioner (or Deputy Commissioner) when he or she feels it is appropriate.}

    \subsection{Promotion and Relegation}

    \RULE{At the end of each season, some teams will be promoted or relegated based on the number of teams in their division and their rank among that division.}

        \SubRule{If a division has 4-8 teams, 1 team gets relegated and 1 team gets promoted.}

        \SubRule{If a division has 9-12 teams, 2 teams get relegated and 2 teams get promoted.}

        \SubRule{If a division has 13-16 teams, 3 teams get relegated and 3 teams get promoted.}

        \SubRule{No team may be promoted from the highest ranked division, as there is no division for those teams to be promoted to.}

        \SubRule{No team may be relegated from the lowest ranked division, as there is no division for those teams to be relegated to.}

    \RULE{Promotion and Relegation in a Division With 4 to 8 Teams}

        \SubRule{The Divisional Champions get promoted. The last place team gets relegated.}

        \SubRule{If there are only 4 teams in the division, the semi-final losers play in a 5 game series. The losing team from those matches is relegated.}

    \RULE{Promotion and Relegation in a Division With 9 to 12 Teams}

        \SubRule{Both the team finished first overall and the divisional playoff winner gain automatic promotion.}

        \SubRule{If the team that placed first overall also wins the Divisional Championship, the semi-final losers play in a 3 game series. The winner of this series plays a 3 game series with the runner up. The winner of this series is promoted.}

        \SubRule{The last placed team is automatically relegated.}

        \SubRule{The second and third to last place teams play in a 3 game relegation series. The loser of this series is relegated.}

    \RULE{Promotion and Relegation in a Division With 13 to 16 Teams}

            \SubRule{Both the team finished first overall and the divisional playoff winner gain automatic promotion.}

\section{Goals, Assists, and Match Reports}
\section{Player Conduct Policy}
\section{Matches}
\section{Playoffs}
\section{Draft and Roster Limit}
\section{Affiliation}
\section{Waivers, Free Agency, and Trading}

\end{document} 

生成的 .pdf 部分内容如下:

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

相关内容