Skip to content

Commit

Permalink
fix for #1638
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 23, 2025
1 parent 9e537e1 commit 510f09c
Show file tree
Hide file tree
Showing 6 changed files with 401 additions and 11 deletions.
9 changes: 7 additions & 2 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2025-01-21 Frank Mittelbach <[email protected]>
2025-01-23 Frank Mittelbach <[email protected]>

* ltoutput.dtx (subsection{Floats}):
Support extended syntax for \label, \index, and \glossary (gh/311)
* ltsect.dtx (subsection{Table of Contents etc.}):
Make \label, \index, and \glossary truely invisible
when typesetting (gh/1638)

2025-01-21 Frank Mittelbach <[email protected]>

* ltoutput.dtx (subsection{Floats}):
* ltsect.dtx (subsection{Table of Contents etc.}):
Support extended syntax for \label, \index, and \glossary (gh/311)

Expand Down
14 changes: 14 additions & 0 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,20 @@ \subsection{Process global options once per package}
%
\githubissue{1619}

\subsection{Make \cs{label}, \cs{index}, and \cs{glossary} truely invisible in running headers}

\LaTeX{} had a bug since its initial implementation, in that it
correctly ignored any \cs{label}, \cs{index}, or \cs{glossary}
appearing in a mark, but neglected to handle the spaces around the
command. As a result one could end up with two spaces in the running
header when only one should be present. This was detected as part of
working on issue~311 and has now been corrected.
%
\githubissue{1638}




%\section{Changes to packages in the \pkg{amsmath} category}

\section{Changes to packages in the \pkg{graphics} category}
Expand Down
11 changes: 7 additions & 4 deletions base/ltoutput.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
%%% From File: ltoutput.dtx
%<flafter>\ProvidesPackage{flafter}
%<fltrace>\ProvidesPackage{fltrace}
%<flafter,fltrace> [2025/01/21 v1.4l
%<flafter,fltrace> [2025/01/23 v1.4m
%<flafter> Standard LaTeX floats after reference (FMi)]
%<fltrace> Tracing LaTeX floats algorithm (FMi)]
%
Expand Down Expand Up @@ -2201,10 +2201,13 @@
% {Move \cs{label} and \cs{index} (from patch file)}
% \changes{v1.4l}{2025/01/21}{Support extended syntax
% for \cs{label}, \cs{index}, and \cs{glossary} (gh/311)}
% \changes{v1.4m}{2025/01/23}
% {Make \cs{label}, \cs{index} and \cs{glossary} truely invisible
% when typesetting (gh/1638)}
% \begin{macrocode}
\let\label\@gobble@om
\let\index\@gobble@som
\let\glossary\@gobble@om
\let\label\@gobble@with@sphack@om
\let\index\@gobble@with@sphack@som
\let\glossary\@gobble@with@sphack@om
% \end{macrocode}
%
% \begin{macrocode}
Expand Down
22 changes: 17 additions & 5 deletions base/ltsect.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
%%% From File: ltsect.dtx
%<*driver>
% \fi
\ProvidesFile{ltsect.dtx}[2025/01/21 v1.1g LaTeX Kernel (Sectioning)]
\ProvidesFile{ltsect.dtx}[2025/01/23 v1.1h LaTeX Kernel (Sectioning)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltsect.dtx}
Expand Down Expand Up @@ -819,23 +819,35 @@
%
%
%
% \begin{macro}{\@gobble@om,\@gobble@som}
% Two commands that accept an optional and a mandatory argument or
% \begin{macro}{\@gobble@om,\@gobble@som,\@gobble@with@sphack@om,\@gobble@with@sphack@som}
% Four commands that accept an optional and a mandatory argument or
% a star, optional and mandatory argument and then do nothing. Used
% to disable commands such as \cs{index} in certain situations.
% \changes{v1.1g}{2025/01/21}
% {Support extended syntax for \cs{label}, \cs{index} and \cs{glossary} (gh/311)}
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2025/06/01}%
%<latexrelease> {\@gobble@som}{Extended index/label}%
% \end{macrocode}
%
% Just getting rid of the input in an expandable way is done by these two.
% \changes{v1.1g}{2025/01/21}
% {Support extended syntax for \cs{label}, \cs{index} and \cs{glossary} (gh/311)}
% \begin{macrocode}
\DeclareExpandableDocumentCommand\@gobble@om{+o+m}{}
\DeclareExpandableDocumentCommand\@gobble@som{s+o+m}{}
% \end{macrocode}
%
% When something needs to be suppress during typesetting one often
% also wants to make sure that we don't end up with two spaces (in
% case there is one before and one after). This can't happen expandably.
% \changes{v1.1h}{2025/01/23}
% {Make \cs{label}, \cs{index} and \cs{glossary} truely invisible
% when typesetting (gh/1638)}
% \begin{macrocode}
\DeclareDocumentCommand\@gobble@with@sphack@om{+o+m}{\@bsphack\@esphack}
\DeclareDocumentCommand\@gobble@with@sphack@som{s+o+m}{\@bsphack\@esphack}
% \end{macrocode}
% \end{macro}
%
%
Expand Down
22 changes: 22 additions & 0 deletions base/testfiles/github-1638.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
% Showed 2 spaces in running header, but one (correct) in TOC

\documentclass{book}

\input{regression-test}

\makeindex
\pagestyle{headings}

\showoutput

\begin{document}

\START

\tableofcontents

\chapter{X \index{blub} X X}
\section{Y \label{bla} Y Y}
x \newpage x \newpage x \newpage
\OMIT
\end{document}
Loading

0 comments on commit 510f09c

Please sign in to comment.