6

I am making an index using makeidx.

Is the following not okay? This does not work for me.

\index{Brazil!\textit{subentry text}}

The same without italics (\index{Brazil!subentry text}) works fine.

2
  • \index{Brazil!\textit{subentry text}} works for me, so I've deleted my first comment. You should say what does not work then!
    – user31729
    Aug 1, 2015 at 23:28
  • 4
    Doesn't work in what sense? Do you get an index entry but non-italicised? An error? (Which?!) No entry? Partial entry? Also, since it works in general, we need you to provide a small document which we can copy-paste-compile to reproduce the problem (whatever it is). Without understanding the problem, we can't suggest a solution. So 'Is the following not okay?' gets the answer 'No, it's fine.' Now what? Help make it not work for us ;).
    – cfr
    Aug 2, 2015 at 0:01

1 Answer 1

9

The sort order of the subentries will be wrong likely, because \textit is included in the sort string. The @-notation can be used to specify a sort key without markup commands:

\documentclass{article}
\usepackage{makeidx}
\makeindex

\begin{document}
\null
\index{Brazil!aaa}
\index{Brazil!zzz}
\index{Brazil!\textit{wrong entry}}
\index{Brazil!subentry text@\textit{subentry text}}
\printindex
\end{document}

Commands:

pdflatex test
makeindex test
pdflatex test

Result

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .