This is a very general question, but I would like to make and index for my thesis, that indexes any word that I bf in the documents, and references the page number next to it. I am using the makeidx package.

I just need the command to work it. Thanks guys!

  • When you say "any word that I bf in the documents", does that mean you're highlighting words using the (deprecated) \bf command, and you want to create an index of all occurrences of those words? – Jake Feb 5 '14 at 15:23
  • 3
    Welcome to TeX.SX! It's better if you provide a minimal working example (MWE) illustrating what you've tried. – Nicola Talbot Feb 5 '14 at 15:25
  • When I say bf, I mean words like \textbf{nilpotent}, then continuing on. I just want one page at the end of the document that lists all words that have been made bold, and references the page. I haven't tried anything yet. – Calculus08 Feb 5 '14 at 15:37
  • Also see Mark indexed entries in the text itself. – Crissov Feb 5 '14 at 15:43
  • 1
    Fair enough @Jake I withdraw my comment, I am writing this only to let you know that. Sorry. – Alec Teal Feb 5 '14 at 20:15

As noted in Best practice for index construction -- recommendations and references, constructing an index requires time, dedication, and skill, and should almost certainly not be automated- the results could lead to a useless index.

However, the following code does what you requested: it makes an index entry for every entry that is contained in the textbf command.

Note, in particular, the arara directives at the top of the document; to compile the document (say, myfile.tex), simply run

arara myfile

Here's the complete code:

% arara: pdflatex
% arara: makeindex
% arara: pdflatex



\textbf{my text}


Instead of the package hvindex, I use this command \dfn in some documents:

%% \dfn[index entry]{defined term}

It highlights the mandatory parameter, i.e. the defined term, in bold and indexes it unless an optional parameter is provided which would take precedence. There are more advanced techniques in makeidx, of course, which ar enot supported by this convenient macro.

I would advise against renewcommanding \textbf.

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.