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

Extra space in running header caused by \label or \index #1638

Open
FrankMittelbach opened this issue Jan 23, 2025 · 0 comments
Open

Extra space in running header caused by \label or \index #1638

FrankMittelbach opened this issue Jan 23, 2025 · 0 comments

Comments

@FrankMittelbach
Copy link
Member

Brief outline of the bug

This bug is older than 35 years ...

Minimal example showing the bug

\RequirePackage{latexbug}       % <--should be always the first line (see CONTRIBUTING)!
\documentclass{book}

\makeindex
\pagestyle{headings}
\begin{document}
\showoutput

\tableofcontents

\chapter{X \index{blub} X  X}
\section{Y \label{bla} Y  Y}

Shows 2 spaces in running header, but one (correct) in TOC
\newpage x \newpage x \newpage
\end{document}

Reason: LaTeX used \@gobble to silence \index and friends, which is fine if written to a file (hence TOC is ok) but not if the data ends up in a mark. Then you get spaces from both sides of the gobbled command.

Log file (required) and possibly PDF file

From the log:

.....\OT1/cmr/m/sl/10 1
.....\OT1/cmr/m/sl/10 .
.....\OT1/cmr/m/sl/10 1
.....\OT1/cmr/m/sl/10 .
.....\glue 4.44444 plus 4.99997 minus 0.37036
.....\glue 3.33333 plus 1.66666 minus 1.11111
.....\OT1/cmr/m/sl/10 Y
.....\glue 3.33333 plus 1.66498 minus 1.11221
.....\glue 3.33333 plus 1.66498 minus 1.11221
.....\OT1/cmr/m/sl/10 Y
.....\glue 3.33333 plus 1.66498 minus 1.11221
.....\OT1/cmr/m/sl/10 Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done in dev
Development

No branches or pull requests

1 participant