是否可以设置一条xindy
规则,使条目根本不出现在索引中?
这是 MWE
\documentclass{article}
\usepackage[xindy]{imakeidx}
\def\xindyopt{-M texindy -L german-din}
\makeindex[program=truexindy,options=\xindyopt]
\begin{document}
Lala \index{Test}
\printindex
\end{document}
我需要Test
从索引中删除什么规则?
答案1
就是这样。我将“Test”分类到单独的字母组“DontIndex”中,然后用代码包围该组,这些代码会吃掉它。您可以将其他键添加到同一组中,如下面的代码所示,它们将被一起吃掉。
\RequirePackage{filecontents}
\begin{filecontents*}{DontIndex.xdy}
(require "texindy.xdy")
(define-letter-group "DontIndex" :prefixes ("~b") :before "default")
(merge-rule "^Test$" "~b") ;$
(merge-rule "^XYZ$" "~b") ;$
(markup-letter-group :group "DontIndex" :open "\def\DontShowMe#1{}\DontShowMe{" :close "}")
\end{filecontents*}
\documentclass{article}
\usepackage[xindy]{imakeidx}
\def\xindyopt{-M DontIndex -L german-din}
\makeindex[program=truexindy,options=\xindyopt]
\begin{document}
Disappear \index{Test} \index{XYZ}
More \index{abc}\\
Still more \index{xyz}
\index{=}
\\
And now testing \index{Testing}
\printindex
\end{document}