
我正在運行稍微修改過的例子使用 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
?
答案1
該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}