Indextools 套件和自訂索引。 (部分和任何櫃檯)

Indextools 套件和自訂索引。 (部分和任何櫃檯)

我的問題是我需要創建一個顯示的不僅僅是頁面的自訂索引。像這樣:Word, s.5,o.6,p.9 ,其中 s.是部分,o。一個虛擬計數器,以及 p。頁。

我的MWE:

\documentclass{book}
\usepackage{showidx}
\usepackage[splitindex,xindy]{indextools}
\usepackage{blindtext}
\usepackage{fontspec}



%\makeindex[options=-M sectionindex_sectionpage.xdy]
%\makeindex[name=foo,title=Test,options=-M sectionindex_sectionpage.xdy]

\makeindex[options=-M module.xdy]
\makeindex[name=foo,title=Test,options=-M module.xdy]

%\makeatletter
% Global redefinition of indexentry to use section, then page%
%\renewcommand{\imki@wrindexentrysplit}[3]{%
% \expandafter\protected@write\csname#1@idxfile%\endcsname{}%
  %  {\string\indexentry{#2}{s\arabic{section},o
 %\arabic{onet},p\thepage}}%
%}%
%\makeatother



\makeatletter
\def\indtl@wrindexsplit#1#2{%
\indtl@wrindexentrysplit{#1}{#2}{s\arabic{section},o\arabic{onet},p\thepage}%
\endgroup\indtl@showidxentry{#1}{#2}%
\@esphack%
}
\makeatother

\makeatletter
\def\indtl@wrindexunique#1#2{%
\indtl@wrindexentryunique{#1}{#2}{s\arabic{section},o\arabic{onet},p\thepage}%
\endgroup\indtl@showidxentry{#1}{#2}%
\@esphack%
}
\makeatother

\begin{filecontents*}{module.xdy}
( define-location-class "module"
                        ("alpha" :sep "" "arabic-numbers" :sep "," "alpha" :sep "" "arabic-numbers" ))
\end{filecontents*}

\newcounter{onet}


\begin{document}
\section{1}
\refstepcounter{onet}
Test1\index{Test1}
\refstepcounter{onet}
Test2\index[foo]{Test2}
\newpage
\section{1}
\refstepcounter{onet}
Test3\index{Test3}
\refstepcounter{onet}
 Tset\index{Test3!γλῶσσα}
 \refstepcounter{onet}
Test4\index[foo]{Test4}


\printindex

\printindex[foo]
\end{document}

我使用indextools是因為我需要與bidi.我嘗試調整答案這裡,但沒有用...我真的需要使用 xindy 和 splitindex 選項。

相關內容