7

I'm generating an author index using natbib, makeidx, and \citep and \citet in the document, with \citeindextrue. This works, but the author entries are of the form:

Hegselmann (2001), 142, 190

Hegselmann (2012), 55, 190

What I would like to appear is just:

Hegselmann, 55, 142, 190

The natbib documentation makes an elliptic reference (page 16) to: "The form of the index entries is set by the internal \NAT@idxtxt, which can be redefined by hackers if wanted (in the natbib.cfg file please). By default, it prints the short author list plus date or number in the current parenthesis style and citation mode."

I have tried '\renewcommand\NAT@idxtxt{\NAT@name\NAT@spacechar}' in the natbib.cfg file, but this doesn't seem to work (index entries are unchanged).

What should I be doing?

2

NAT@idxtxt is redefined each time a cite is generated, so I suggest you change NAT@index to use something like NAT@myidxtxt. In the preamble you can write:

\makeatletter
\renewcommand\NAT@index{\@bsphack\begingroup
   \def~{\string~}\@wrindex{\NAT@myidxtxt}}
\newcommand\NAT@myidxtxt{\NAT@name}
\makeatother
0

The reason that your redefinition of \NAT@idxtxt does not work is that natbib sets this definition at \begin{document}, so your earlier definition is overwritten. Hence we need an end run for the latest definition, using \AtBeginDocument.

\documentclass{article}

\usepackage{makeidx}
\usepackage{natbib}

\makeindex
\citeindextrue

\makeatletter
\newcommand{\setNATidxtxt}{%
  \renewcommand\NAT@idxtxt{\NAT@name}
}
\makeatother
\AtBeginDocument{\setNATidxtxt}

\begin{document}
\citet{StGu92}

\printindex

\bibliographystyle{chicago}
\bibliography{test}
\end{document}

Note that I also removed the \NAT@spacechar from your definition, as this was used in the original definition to separate names and year.

sample output

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.