Closed kbloom closed 11 months ago
This is something that should be reported to the maintainer of the memoir class. In memhfixc.sty
the class redefines \label
and \nameref
. The last redefinition is the problem here. In texlive 2021 it wasn't a problem, as hyperref changed the definition again, but now the packages are loaded in a different order and the memoir definition harms.
A small example would be
\documentclass[]{memoir}
\usepackage{pdfpages}
\usepackage{hyperref}
\newcommand{\song}[2]{\includepdf[addtotoc={1,section,1,#1,#2}]{#2}}
\newcommand{\songref}[1]{\nameref{#1}, page \pageref{#1}}
%\makeatletter
% \RenewDocumentCommand\nameref{s}
% {\IfBooleanTF{#1}{\@namerefstar}{\T@nameref}}
%\makeatother
\begin{document}\ShowCommand\nameref
\tableofcontents
\chapter{abc}
\song{Yom Zeh Shiru La'el}{example-image.pdf}
\songref{example-image.pdf}
\end{document}
This is fixed in the next memoir update where we replace the memoir title referencing stuff with native nameref and specific support for it.
The new version of memoir is now on ctan and in texlive. So I close here.
In my document at https://github.com/kbloom/sheetmusic/blob/pdfs/songbook.tex, I'm using \includepdf with the addtotoc option to include individual pieces of sheet music in a book, and include them in the TOC at the section level, with assigned titles. Elsewhere in the document, I'm using \nameref to try to refer to some of these pieces by name (as well as by page number). In texlive version 63035 (a pdf that I generated on January 15, 2023), the \nameref commands insert the name of the piece sheet music, which I assigned in the addtotoc call. In texlive version 66587 (a PDF I generated today), the \nameref commands insert the name of the chapter that contains the PDF.
Any idea what's wrong here?