latex3 / latex2e

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

User-defined marks swallowed if inside multicols #1421

Open cspiel opened 3 months ago

cspiel commented 3 months ago

Brief outline of the bug

I find that even with the latest (released) multicol.sty, v1.9h, user-defined marks are recorded as proven by the log file but they do not quite make it to \FirstMark or \LastMark if the insertion points are within a multicols environment.

Otherwise the \NewMarkClass mechanism works flawlessly.

In the example given below I'd expect the head to show a-n, however what I get is a-b.

The problem may share a distant relationship with issue #1130.

Minimal example showing the bug

\RequirePackage{latexbug}
\documentclass{article}

\usepackage{multicol}

\NewMarkClass{DictMark}
\DebugMarksOn

\makeatletter
\def\@oddhead{\FirstMark{DictMark}--\LastMark{DictMark}\hfill\thepage}
\let\@evenhead=\@oddhead
\makeatother

\begin{document}
\InsertMark{DictMark}{a}a
\InsertMark{DictMark}{b}b

\begin{multicols}{2}
\InsertMark{DictMark}{m}m
\InsertMark{DictMark}{n}n
\end{multicols}

%%--\InsertMark{DictMark}{z}z
\end{document}

Log file (required) and possibly PDF file

l3marks.log l3marks.pdf

FrankMittelbach commented 3 months ago

The problem is that multicol is still not yet enabled to support the new mark mechanism. I'm aware of that but haven't found the time to address this.

github-actions[bot] commented 1 month ago

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