Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Space Between List Environments and Section Headings #86

Open
rhelder opened this issue Mar 9, 2025 · 0 comments
Open

Incorrect Space Between List Environments and Section Headings #86

rhelder opened this issue Mar 9, 2025 · 0 comments

Comments

@rhelder
Copy link

rhelder commented Mar 9, 2025

Description of Issue

When titleps is loaded, there can be too little space before a section heading (e.g., when space is tight) when the section heading follows a list environment. (By 'too little', I mean less than LaTeX would tolerate if titleps were not loaded).

Steps to Reproduce

This problem can occur under various circumstances 'in the wild', but the easiest way to reproduce it here is to make \textheight very small:

\documentclass[letterpaper]{article}
\textheight=\dimexpr 8\baselineskip + \topskip\relax

\usepackage{titleps}

\begin{document}

\section{The First Section}

\begin{enumerate}
  \item Do
  \item Re
  \item Mi
\end{enumerate}

\section{The Second Section}

\end{document}

If you compile this example with pdfTeX, XeTeX, or LuaTeX, you should get output like this:

Image

For reference, if you increase the \textheight by one \baselineskip, even with titleps loaded, you get the correct spacing, which looks like this:

Image

If you remove \usepackage{titleps} from the MWE, you will see that LaTeX refuses to decrease the spacing between the list and the section heading to that degree, and it breaks the page after the enumerate environment instead. (Note that the same thing happens even if you load titlesec without the pagestyles option: LaTeX will break the page after the enumerate environment). So the reduced spacing we see in the example is incorrect, not merely undesirable.

The issue can be reproduced with other list environments:

\documentclass[letterpaper]{article}
\textheight=\dimexpr 8\baselineskip + \topskip\relax

\usepackage{titleps}

\begin{document}

\section{The First Section}

\begin{quote}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.
\end{quote}

\section{The Second Section}

\end{document}

This example isn't as visually striking (at least not to me), but you can verify that the spacing is incorrect by removing \usepackage{titleps}. As in the previous example, the page will break after the list environment.

I haven't been able to reproduce the problem unless the section heading is following a list environment.

Affected Use Cases

I frequently use titleps for page styles when typesetting handouts and syllabi. Because these kinds of documents have a lot of list material, and a lot of section headings, this issue comes up surprisingly often for me – and it often looks much worse than I was able to reproduce visually in my minimal examples here. And although this issue can probably be patched in most cases by adjusting the text height, I'm worried enough about failing to see the issue during proofreading that I will probably use a different package for now.

I wish I could lend a hand in finding the cause, but I'm too unfamiliar with the code at present. I also see that development for titlesec is on pause; although I see that you are still doing bug fixes, I want to register that I noticed that and will be grateful for whatever you can do, if anything. In any event, thanks for all your work on this valuable set of packages and on the LaTeX project in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant