我正在寻找一个简单的解决方案来更改索引条目,以便我得到honey • 24
而不是honey, 24
。我浏览了几篇关于影响索引样式的文章(idxlayout 自定义分隔符,有没有简单的方法可以隐藏索引词末尾的逗号(,)?) 但看来我还不够先进,无法运用这些想法。
编辑:我正在明确寻找xindy
解决方案,即如何创建或更改(哪个?)*.xdy
文件。
下面是包含所有序言内容的 MWE(我保留了差不多所有重要内容):
\documentclass[10pt,twoside,titlepage,headsepline,headings=small,BCOR=17mm]{scrbook}
\usepackage{scrlayer-scrpage} % scrpage2
\usepackage{cmap}
\usepackage{ulem}
\usepackage[utf8]{inputenc}
\usepackage[vietnamese=nohyphenation]{hyphsubst}
\usepackage[vietnamese,polish]{babel}
\usepackage[T5,T1]{fontenc}
\usepackage{longtable}
\usepackage{lmodern}
\usepackage{makeidx}
\usepackage[columns=2,itemlayout=abshang,initsep=1.8em plus 0.2em minus 0.2em]{idxlayout}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{etoolbox}
\newcommand{\rawindex}[1]{\expandafter\index\expandafter{\detokenize{#1}}}
\makeindex
\begin{document}
\mainmatter
Some text \rawindex{text} is written \rawindex{text!more text} here. What \rawindex{hello} do you think of me?
\backmatter
\cleardoublepage
\addcontentsline{toc}{chapter}{INDEKS}
\ihead[]{}
\sffamily
\setindexprenote{Hello!}
\printindex
\end{document}
有谁知道针对所需改变的简单解决方案吗?
答案1
随着 MWE 的增加……
\documentclass{scrbook}
\usepackage{makeidx}
\usepackage[columns=2,itemlayout=abshang,initsep=1.8em plus 0.2em minus 0.2em]{idxlayout}
\makeindex
\begin{filecontents}{\jobname.mst}
delim_0 " $\\cdot$ "
delim_1 " $\\cdot$ "
delim_2 " $\\cdot$ "
delim_n ", "
\end{filecontents}
\begin{document}
\mainmatter
Some text \index{text} is written \index{text!more text} here. What \index{hello} do you think of me?
\clearpage
Text\index{text}
\backmatter
\cleardoublepage
\addcontentsline{toc}{chapter}{INDEKS}
\sffamily
\setindexprenote{Hello!}
\printindex
\end{document}