texlive 2019のxpatchバグ?

Sep 09 2020

少し変更した例をpdflatexで実行してから、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}

ただし、セクションのタイトルNomenclatureは表示されるべきではありませんが、まだ表示されています。コンパイルも出力されるsuccessので迷ってしまいます。これはxpatchパッケージのバグですか?

回答

2 egreg Sep 09 2020 at 22:25

nomenclパッケージには、最近更新されており、現在ではデフォルトで使用するtocbasicパッケージを。

古いメソッドを使用するには、オプションを指定してパッケージを呼び出す必要があります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}

このtocbasic方法では、パッチを適用する必要がありますが\tocbasic@listhead、これはドキュメントの他の部分に悪影響を与える可能性があります。

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

\makeatletter
\patchcmd\tocbasic@listhead{\section*}{\@gobble}{}{}
\makeatother

\makenomenclature

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