索引中羅馬和阿拉伯頁碼的排序

索引中羅馬和阿拉伯頁碼的排序

當使用不同的頁面編號時,makeindex 套件首先引用羅馬編號頁面上的索引,然後引用阿拉伯編號頁面上的索引。我有一個帶有羅馬編號的附錄,因此我想更改這種排序:當我有一個關鍵字同時出現在主要部分和附錄中時,索引應該首先有主要部分的頁碼,然後是頁碼在附錄中。我怎樣才能實現這個目標?

最小的例子:

\documentclass{article}
\usepackage{makeidx}
\makeindex
\begin{document}
Testtext \index{index}
\newpage
\pagenumbering{roman}
Testtext \index{index}
\printindex
\end{document}

答案1

您必須在 makeindex 樣式檔中指定頁碼的排序順序。例如

%file romanindex.ist
page_precedence "nraRA"

n=數字,r/R=羅馬小寫/大寫,a/A=字母小寫/大寫)

然後運行 makeindex 命令:

makeindex -s romanindex.ist yourdocument.idx

並再次運行 LaTeX

相關內容