Проблема разрыва страницы после \subsection в формате LNCS

Проблема разрыва страницы после \subsection в формате LNCS

Я использую LNCSшаблон для написания статьи. Но, как ни странно, в случайный момент, если я добавляю, \subsectionмежду «Аннотацией» и «Первым разделом» появляется разрыв страницы:

\documentclass[runningheads,a4paper]{llncs}

\usepackage{amssymb}
\setcounter{tocdepth}{3}
\usepackage{graphicx}

\usepackage{url}
%\urldef{\mailsa}\path|{alfred.hofmann, ursula.barth, ingrid.haas, frank.holzwarth,|
%\urldef{\mailsb}\path|anna.kramer, leonie.kunz, christine.reiss, nicole.sator,|
%\urldef{\mailsc}\path|erika.siebert-cole, peter.strasser, lncs}@springer.com|    
\newcommand{\keywords}[1]{\par\addvspace\baselineskip
\noindent\keywordname\enspace\ignorespaces#1}

\begin{document}

\mainmatter  % start of an individual contribution

% first the title is needed
\title{XXXXXX}
% a short form should be given in case it is too long for the running head
%\titlerunning{Lecture Notes in Computer Science: Authors' Instructions}

% the name(s) of the author(s) follow(s) next
%
% NB: Chinese authors should write their first names(s) in front of
% their surnames. This ensures that the names appear correctly in
% the running heads and the author index.
%
\author{}
%\author{Alfred Hofmann%
%\thanks{Please note that the LNCS Editorial assumes that all authors have used
%the western naming convention, with given names preceding surnames. This determines
%the structure of the names in the running heads and the author index.}%
%\and Ursula Barth\and Ingrid Haas\and Frank Holzwarth\and\\
%Anna Kramer\and Leonie Kunz\and Christine Rei\ss\and\\
%Nicole Sator\and Erika Siebert-Cole\and Peter Stra\ss er}
%
%\authorrunning{Lecture Notes in Computer Science: Authors' Instructions}
% (feature abused for this document to repeat the title also on left hand pages)

% the affiliations are given next; don't give your e-mail address
% unless you accept that it will be published
\institute{}
%\institute{Springer-Verlag, Computer Science Editorial,\\
%Tiergartenstr. 17, 69121 Heidelberg, Germany\\
%\mailsa\\
%\mailsb\\
%\mailsc\\
%\url{http://www.springer.com/lncs}}

%
% NB: a more complex sample for affiliations and the mapping to the
% corresponding authors can be found in the file "llncs.dem"
% (search for the string "\mainmatter" where a contribution starts).
% "llncs.dem" accompanies the document class "llncs.cls".
%

%\toctitle{Lecture Notes in Computer Science}
%\tocauthor{Authors' Instructions}
\maketitle


\begin{abstract}
Dummy abstract
\keywords{}
\end{abstract}


\section{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\section{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\section{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\section{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\subsection{XXXXXX}

\section{XXXXXX}

%\subsection{XXXXXX}% Uncomment this to see the problem

\end{document}

Удивительно, что я добавляю \subsectionв конце, а разрыв появляется в самом начале, после первой страницы. Может ли кто-нибудь дать мне подсказку, как это исправить?

решение1

Ваш минимальный пример не совсем отражает типичный документ, но вывод такой, как и ожидалось. Вот почему...

Во время строительства каждый из секционных блоков проходит через один и тот же макрос \@startsection.Этот макросусловия, касающиеся того, должен ли заголовок раздела быть "встроенным" или "отображаемым". В отображаемом разделе заголовок размещается на одной строке, а содержимое абзаца следует на отдельной строке. Однако, чтобы избежать свисающих заголовков разделов внизу страницы, \nobreakвыдается a. Это позволяет объединить/склеить (а не разделить) заголовок раздела с последующим абзацем (ну, невсеего), либо оставив их оба на текущей странице, либо сбросив оба на следующую страницу.

В вашей настройке вытолькоиспользовали секционные блоки для построения вашего документа ( \sections и \subsections). Оба эти секционные заголовки устанавливаются как отображение и, следовательно, вызывают a \nobreak. Со всеми заголовками, выдающими \nobreaks, они фактически «склеены». Как только нужно выдать разрыв страницы, весь блок секционных блоков можеттолькобыть перенесен на следующую страницу, поскольку аннотация — единственный фрагмент текста, где можно вставить надежный разрыв страницы.

Это всего лишь особый сценарий, и он не должен вызывать беспокойства в обычном (реальном) документе, который также содержит текст абзаца.

Связанный контент