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
Assignees
Labels
bug category base (latex) fixed in dev Fixed in development branch, not in stable release

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
@FrankMittelbach FrankMittelbach self-assigned this Jan 23, 2025
@github-project-automation github-project-automation bot moved this to Pool (unscheduled issues) in upcoming LaTeX2e releases Jan 23, 2025
@FrankMittelbach FrankMittelbach added this to the Release 2025 Spring milestone Jan 23, 2025
FrankMittelbach added a commit that referenced this issue Jan 23, 2025
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to Done in dev in upcoming LaTeX2e releases Jan 23, 2025
FrankMittelbach added a commit that referenced this issue Jan 24, 2025
* fix for #1638

* update rollback code

* extend the test to also cover extended syntax

* updates after review

* new text suggestion

* add a comment about commands defined elsewhere
@FrankMittelbach FrankMittelbach added fixed in dev Fixed in development branch, not in stable release and removed fixed in branch labels Jan 24, 2025
FrankMittelbach added a commit that referenced this issue Jan 26, 2025
* firstaid for index package

* add index package to testing

* adding a firstaid means changes to several hook tests ...

* test file changed

* fix for #1638

* update rollback code

* update test file

* and update the test ...

* drop a few unnecessary %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category base (latex) fixed in dev Fixed in development branch, not in stable release
Projects
Status: Done in dev
Development

No branches or pull requests

1 participant