# xpatch bug in texlive 2019?

I am running the slightly modified example with pdflatex and then makeindex (makeindex -s nomencl.ist -o myfile.nls myfile.nlo)

\documentclass[]{article}
\usepackage{xpatch}
\usepackage{nomencl}

\patchcmd{\thenomenclature}{\section*{\nomname}}{\relax}{\typeout{Success}}{\typeout{Failure}}

\makenomenclature

\begin{document}
text
\nomenclature[1]{$\mu$}{variable}
\printnomenclature[0.9in]
\end{document}


However, the section title Nomenclature is still there while it should not. The compilation also outputs success so I am lost. Is this a bug in the xpatch package?

• Is this a duplicate of xpatch bug in texlive 2019?
– Mico
Sep 9, 2020 at 22:17
• @Mico I've deleted the other one. I do not know what happened.. Sep 9, 2020 at 22:22
• @DavidCarlisle Not me. I have no clue why. I see this "xpatch.sty 2012/10/02 v0.3 Extending etoolbox patching commands". Not good. Sep 9, 2020 at 22:25

The nomencl package has been updated recently and now it uses by default the tocbasic package.

In order to use the old method, you need to call the package with the option notocbasic.

% arara: pdflatex
% arara: nomencl
% arara: pdflatex

\documentclass[]{article}
\usepackage{xpatch}
\usepackage[notocbasic]{nomencl}

\patchcmd{\thenomenclature}{\section*{\nomname}}{\relax}{\typeout{Success}}{\typeout{Failure}}
\makenomenclature

\begin{document}
text
\nomenclature[1]{$\mu$}{variable}
\printnomenclature[0.9in]
\end{document}


With the tocbasic method, you have to patch \tocbasic@listhead, but this might have adverse effects on other parts of the document.

\documentclass[]{article}
\usepackage{xpatch}
\usepackage{nomencl}

\makeatletter
\nomenclature[1]{$\mu$}{variable}

• ah ok done! Why is my xpatch package from 2012 though? Sep 9, 2020 at 22:26