3

I would like to highlight one entry in an index.

If I have an index that appears several times in a document I would like to highlight one of these entries as the main one.

Something like

My Entry, 2, 4-5, 10, 15

Where page 10 is the main one.

Is there an easy way?

Edit

I am using imakeidx with several indexes. Something like this

\documentclass[a4paper,10pt,twoside,twocolumn,openany,justified,nomultitoc,bookmarksopen=true]{dndbook}

% nomultitoc is needed if the list of figures is not displayed
% the multitoc package need the lof,lot,loc options (and from version to version it seems not to work)
\usepackage[toc,lot,lof]{multitoc}

\usepackage[]{imakeidx}

\makeindex[name=Persone,title=Persone e mostri,intoc]
\makeindex[name=Luoghi,title=Luoghi,intoc]
\makeindex[name=Oggetti,title=Oggetti,intoc]

\indexsetup{noclearpage}

\begin{document}

Bla bla\index[Persone]{My Entry} bla bla

% [...]

Bla bla\index[Persone]{My Entry} bla bla

% to correct the PDF links
\phantomsection
\printindex[Persone]

% to correct the PDF links
\phantomsection
\printindex[Oggetti]

% to correct the PDF links
\phantomsection
\printindex[Luoghi]

\end{document}

But I am open to other options

  • 2
    Which index package are you using? – cmhughes Dec 3 '19 at 15:29
  • 1
    Possible duplicate of Placing of bold entries in the index – Rüdiger Voigt Dec 3 '19 at 18:18
  • @RüdigerVoigt Actually the linked answer is about ordering the bold entries first. – Matteo Dec 3 '19 at 18:48
  • @Matteo:... which includes code how to highlight an entry. However, I have to admit that the answer by Peter Wilson is cleaner / better code. – Rüdiger Voigt Dec 3 '19 at 20:51
7

On your main page:

\index[Persone]{My Entry|textbf}

will print the page number in the index in bold, whereas on other pages

\index[Persone]{My Entry} 

will print a normal page number.

  • I tried but it just prints My Entry, 10,textbf20,20 if the entry at page 20 is marked with \index[Persone]{My Entry|\textbf} – Matteo Dec 3 '19 at 18:51
  • In your answer I see |\textbf with the unnecessary `. If I try to edit it, the ` is not there. – Matteo Dec 3 '19 at 19:08
  • @Matteo Sorry, my typo, which I have corrected. It should have been just textbf not \textbf. – Peter Wilson Dec 3 '19 at 19:09
  • OK I tried to edit it, but my browser showed a cached version :-) – Matteo Dec 3 '19 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.