考虑以下代码
\documentclass{article}
\usepackage{makeidx}
\makeindex
\usepackage{filecontents}
\begin{filecontents}{\jobname.mst}
suffix_2p "~sq."
suffix_3p "~sqq."
\end{filecontents}
\begin{document}
Text.\index{A word}
\clearpage
Text.\index{A word}
Text2.\index{Another word}
\clearpage
Text2.\index{Another word}
\clearpage
Text2.\index{Another word}
\printindex
\end{document}
生成索引:
问题:我该如何修改代码,以便在索引中的每个页码后面都有一个逗号?即1, sq.' and
2, sqq。'
答案1
您只需将逗号添加到 makeindex 样式即可
\begin{filecontents}{\jobname.mst}
suffix_2p ",~sq."
suffix_3p ",~sqq."
\end{filecontents}