I’m working on a book project with endnotes grouped by chapter using the enotez package in TeX Live 2024.
The goal is:
- Endnotes grouped by chapter
Chapter names replaced with custom titles (e.g. “KAPITULUA 1”, “HITZAURREA”, etc.)
Hyperlinks working in both directions:- Clicking the superscript in the text → jump to the note
Clicking the note number → jump back to the reference in the textCurrent issue
With the code below:
- The custom endnote headers work perfectly (the generic “Notes for chapter X” text disappears).
But hyperlinks stop working completely: clicking the superscript number in the text does nothing.
It doesn’t jump to the note, nor to the AMAI-OHARRAK chapter.- This happens consistently on TeX Live 2024.
MWE
(Uploaded here: main_nuevo_actualizado.tex — but reduced below for clarity.)
[\newcommand{\GetChapterTitle}[1]{%
\ifcsname ChapterTitle@#1\endcsname
\csname ChapterTitle@#1\endcsname
\else
Chapter #1
\fi
}
% Custom mapping
\expandafter\gdef\csname ChapterTitle@1\endcsname{HITZAURREA}
\expandafter\gdef\csname ChapterTitle@2\endcsname{SARRERA}
\expandafter\gdef\csname ChapterTitle@3\endcsname{KAPITULUA 1}
% (… and so on)
% Custom header override
\makeatletter
\renewcommand*\enotez@heading@chapter[1]{%
\par\bigskip
{\centering\Large\bfseries \GetChapterTitle{#1}\par}
\medskip
}
\makeatother
Effects:
Feature Works?
Custom chapter titles in endnotes ✔ Works
Correct grouping of notes per chapter ✔ Works
Hyperlinks to notesBroken
Hyperlinks back to textBroken
Question
Is there a way to keep the custom chapter-based endnote headings and preserve the hyperlink functionality?
It seems that redefining \enotez@heading@chapter disables something internal related to hyperref anchors, but I don’t know how to restore it.
Any hint, workaround, or correct approach is greatly appreciated.
Thank you!
- This happens consistently on TeX Live 2024.
- The custom endnote headers work perfectly (the generic “Notes for chapter X” text disappears).
- Clicking the superscript in the text → jump to the note