# List bold pages first with imakeidx

In my document, if an index is the title of a whole chapter, the index is bold. Otherwise, the index is just normal. If the index is from the appendix of my document, it will be italic.

An example would be the following:

Newton Mechanics: 7, 3, 200, 321
Quantum Mechanics: 12, 18, 400, 322

Is it possible that the page number after the index are sorted bold, ascending, and then italic so that it looks like the desired output?

MWE of the document:

\documentclass{book}

\usepackage{imakeidx}
\makeindex[title=Stichwortverzeichnis, columns=1]
\usepackage{filecontents}
\begin{filecontents}{\jobname.mst}
delim_0 "\\dotfill"
delim_1 "\\dotfill"
delim_2 "\\dotfill"
\end{filecontents}

\begin{document}

\section{Newton Mechanics\index{Newton Mechanics|textbf}}
\newpage
Blablabla\index{Newton Mechanics}

...

\section{appendix}
Newton\index{Newton Mechanics|textit}

...

\printindex

\end{document}


Is there a way of doing this with imakeidx or xindy and alikes?

• The sorting capabilities of makeindex are limited, perhaps it is possible with xindy, but from the LaTeX aspect this is not related to imakeidx or makeidx packages – user31729 Apr 15 '17 at 12:28
• @ChristianHupfer What tags do you recommend then? I haven't quite found a more suiting one than sorting... – Narusan Apr 15 '17 at 13:11
• I don't recommend other tags. I just noted that the makeindex processor has limited sorting skills, which will come to its end when seeing something like \bfseries or \textbf{} – user31729 Apr 15 '17 at 13:22