latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.94k stars 267 forks source link

Page breaks allowed between \subsection and a running heading #140

Open dpthurst opened 5 years ago

dpthurst commented 5 years ago

Brief outline of the bug

The amsart package will allow a page break after a \subsection heading, if the heading is immediately followed by a theorem environment. (Recall the \subsection is an inline heading, so without a theorem environment or equivalent there is no way to have a page break here.)

(This is separate from the earlier bug about page breaks after a \section heading: https://github.com/latex3/latex2e/issues/81)

Minimal example showing the bug

\RequirePackage{latexbug}
\documentclass{amsart}

\newtheorem{definition}{Definition}

\begin{document}
aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\
  \section{Conformal Setting}

  \subsection{Riemann surfaces}

\begin{definition}
  A Riemann surface is \dots
\end{definition}

\end{document}

Log file (required) and possibly PDF file

t.log t.pdf !! Use drag-and-drop (remember: .log file is required) !!

u-fischer commented 5 years ago

A similar effect can be seen with the standard class and e.g. \paragraph as inline heading:

\RequirePackage{latexbug}
\documentclass{article}

\newtheorem{definition}{Definition}

\begin{document}
aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\
  \section{Conformal Setting}

  \paragraph{Riemann surfaces}

\begin{definition}
  A Riemann surface is \dots
\end{definition}

\end{document}
car222222 commented 5 years ago

Any fix for this is probably relevant to the code for fixing #131 also.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity.