与 xindy 交叉引用

与 xindy 交叉引用

我正在使用 xindy 做索引。我想在其中添加交叉引用。但是当我这样做时,与交叉引用条目关联的页码消失了。

以下是 MWE:

\documentclass[10pt,a4paper]{article}
\newcommand{\lang}{english}
\newcommand{\inputec}{utf8}
\usepackage[utf8]{inputenc}
\usepackage[\lang]{babel}
\usepackage[T1]{fontenc}

\usepackage[xindy]{imakeidx}
\usepackage[hyperindex=false]{hyperref}

\def\xindyopt{ -I latex -M style_index1 -L english -C utf8}
\makeindex[program=truexindy, options=\xindyopt, intoc]                     


\begin{document}
toto    \index{toto}  \newpage 
toti \index{toti|seealso{toto}} \newpage
ta\index{ta|see{toto, toti}} \newpage
tata\index{tata}

\printindex

\end{document}

这是我的索引样式文件sytle_index1

(define-location-class "arabic-page-numbers" ("arabic-numbers")             
                    :min-range-length 2)                            

(define-attributes (("definition" "usage" "default" "hyperpage")))


(define-crossref-class "see")
(markup-crossref-list :class "see" :open "\seelinkk{" :sep "; " :close "}{}")

(define-crossref-class "seealso")
(markup-crossref-layer-list :sep ", ")
(markup-crossref-list :class "seealso" :open "\seealsolinkk{" :sep "; " :close "}{}")

(define-crossref-class "hyperindexformat")
(markup-crossref-list :class "hyperindexformat" :open
       "\hyperindexformat{" :sep "; " :close "}{}")


(define-location-class-order (
              "arabic-page-numbers"
              "see"
              "seealso"))

(markup-index :open  "~n\begin{theindex}
                    \providecommand*\lettergroupDefault[1]{}
                    \providecommand*\lettergroup[1]{%
                        \par\textbf{#1}\par
                        \nopagebreak
                    }
                    \newcommand{\targetindexentryy}[1]{\hypertarget{index:#1}{#1}}
                    \newcommand{\seelinkk}[1]{\see{\hyperlink{index:#1}{#1}}}
                    \newcommand{\seealsolinkk}[1]{\seealso{\hyperlink{index:#1}{#1}}}
                ~n"     
    :close "~n~n\end{theindex}~n"
    :tree)


(markup-indexentry :open "~n \item "            :depth 0)
(markup-indexentry :open "~n    \subitem "      :depth 1)
(markup-indexentry :open "~n      \subsubitem " :depth 2)


(markup-locref-list :sep ", ")
(markup-locclass-list :open "\dotfill " :close "" ) ;; :sep ", "


(markup-locref :open "\hyperpage{" :close "}")
(markup-locref :open "\hyperpage{" :close "}" :attr "hyperpage")   


(markup-keyword-list :open "\targetindexentryy{" :close "}" )

答案1

我找到了解决问题的方法。

我必须添加另一个没有交叉引用的条目。因此,我们应该在 .tex 文件中:

 toti \index{toti|seealso{toto}} \index{toti} \newpage

相关内容