使用 Xindy 和 Imakeidx 进行自定义索引

使用 Xindy 和 Imakeidx 进行自定义索引

此主题,我们解决了自动作者姓名索引中正确排序的问题。它工作得很好,直到我将代码与 Enrico 在此主题为了将索引中的罗马页码以小写字母打印出来:

\newcommand{\scindex}[2][]{\index[#1]{#2|textsc}}   % NEW Enrico

    \DeclareIndexNameFormat{default}{%      
      \usebibmacro{index:name}
        {\scindex[nomi]}   %NEW Enrico
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffix}}

我正在运行的 ATM:

  • 韓萊特
  • Biber 在辅助
  • Xindy 在 nomi.idx 上
  • 再次使用 XeLaTeX

但我没有得到索引。

如果我删除 Enrico 对小型大写字母问题的重新定义,它就会再次起作用。

有没有办法让这两件事保持在一起?

这是我的 MWE:

% !BIB TS-program = biber
% !BIB program = biber
% !TEX encoding = UTF-8 Unicode
% !TeX TS-program = xelatexmk

\begin{filecontents}{archivio.bib}

@book{Dull,
    Address = {Cambridge},
    Author = {Mark Dull},
    Publisher = {Amazon KDP},
    Title = {Hello world},
    Year = {1999}}

@book{Dol2,
    Address = {Moskwa},
    Author = {Philip Döllinger},
    Publisher = {Sinodal'naja tip.},
    Title = {Sistematičeskoe opisanie rukopisej moskovskoj Sinodal'noj (patriaršej) biblioteki},
    Year = {1894}}


\end{filecontents}

\documentclass[11pt, openany]{book}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{latin, english, french}

\usepackage[]{csquotes}
\usepackage{xpatch}

\usepackage[style=verbose-trad2,
            language=auto,
            ibidpage=true,
            autolang=other,
            useprefix=true,
            giveninits=true,
            indexing=true,
            dateabbrev=false,
            backend=biber,
        ]{biblatex}


\addbibresource{archivio.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\usepackage[xindy]{imakeidx}
\makeindex[name=nomi] % texindy -L german-din5007 -C utf8 nomi.idx
\newcommand{\scindex}[2][]{\index[#1]{#2|textsc}}   %%%% Serve solo se voglio i numeri di pagina in smallcaps

\renewbibmacro*{citeindex}{%
  \ifciteindex
    {\ifnameundef{namea}{\indexnames{labelname}}{\indexnames{namea}}}
    {}}

\DeclareIndexNameFormat{default}{%      Formato del nome dell'autore
  \usebibmacro{index:name}
{\scindex[nomi]}%era    {\index[nomi]}. Così stampa le pagine in smallcaps
    {\namepartfamily}
    {\namepartgiveni}
    {\namepartprefix}
    {\namepartsuffix}}


\begin{document}


I should like to sort properly \cite{Dull} and \cite{Dol2}.



\printindex[nomi]       % Indice dei nomi   
\end{document}

相关内容