0

I am looking for a simple solution to change index entries so that I get honey • 24 instead of honey, 24. I looked through a couple of articles on influencing the index style (idxlayout customized delimiters, Is there an easy way to hide comma (,) from the end of the indexed words?) but it seems that I am not advanced enough to make use of those ideas.

EDIT: I am looking explicitly for a xindy solution, i.e. how to make or change a (which?) *.xdy file.

Here's an MWE with all the preamble stuff (I left more or less everything important):

\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}

Does anyone have an idea of a simple solution for the needed change?

JamesT
  • 3,169
Dominik
  • 483
  • Would you please try to make your example a bit more "minimal"? I have the impression that most of the code is irrelevant to the issue. – campa Jan 11 '21 at 10:44
  • @campa Thanks for the hint. I left however more details in my "MWE", because there's an issue with correct sorting of index entries. They're in Vietnamese and therefore I use a workaround with that rawindex thing and then I have it properly sorted by xindy. – Dominik Jan 11 '21 at 11:23

1 Answers1

1

With a more 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}

NBur
  • 4,326
  • 10
  • 27
  • I keep the comma between pages with delim_n – NBur Jan 11 '21 at 11:04
  • I just tried to implement this, but it seems not working. I left more details in my "MWE", because there's an issue with correct sorting of index entries. They're in Vietnamese and therefore I use a workaround with that rawindex thing and then I have it properly sorted by xindy. Can you think of adding something to my big "MWE" for the desired result without having to change the way the indexing is done? – Dominik Jan 11 '21 at 11:22
  • Could it be that the *.mst-file doesn't work with xindy? – Dominik Jan 11 '21 at 12:03
  • Using your code (I just remove the \usepackage[T5,T1]{fontenc}) compiles fine here with lualatex + makeindex… I never use xindy. Have a look at https://tex.stackexchange.com/questions/198318/customize-xindy-index-layout – NBur Jan 11 '21 at 14:05
  • The problem was that only xindy was able to sort Vietnamese properly. I had it discussed a couple of years ago i.a. here. I've been more or less off the topic since then, so I don't really recall details of that any more. :-( – Dominik Jan 11 '21 at 18:03
  • I already before had a look at the link you provided, but as far as I remember that sadly wouldn't work for Vietnamese. – Dominik Jan 11 '21 at 18:04
  • For what I understand, we have to setup a xdy file instead of the mst. But I don't know what to write in it… – NBur Jan 11 '21 at 18:08
  • Thanks, good direction. I edited the question hence to make it more clear. – Dominik Jan 11 '21 at 18:25