1. I am writing a tex file that uses the package biblatex-chicago and makeidx.
  2. I am using endnotes package to push all footnotes to the Notes section.
  3. All citations appear in the Bibliography section. This is acheived using \autocite.
  4. In the project, I want indexing inside pre- and post-notes of \autocite. Meaning that, in the Index section, a term will correspond to the relevant page in the Notes section. For example, in the following example, "clah" should appear in the Index along with the page number in the Notes section where in appears.

Q The problem I am facing is this- when I put \index in pre-notes it fails to compile. But \index inside post-notes works just fine. Could someone please clarify how to solve this problem?

For example,when I do

\autocite[blah blah][clah clah\index{clah}]{a-citekey}

it works! However,

\autocite[blah blah\index{blah}][clah clah]{a-citekey}

fails to compile.

Here is the MWE:



\renewcommand\nameyeardelim{, }


\usepackage{fancyhdr, blindtext}
\fancyhead[LE,RO]{\changefont \slshape \rightmark} %section
\fancyhead[RE,LO]{\changefont \slshape \leftmark} %chapter
\fancyfoot[C]{\changefont \thepage} %footer

\addcontentsline{toc}{section}{~~ \textit{Example \arabic{ExCount}: #1}}
\subsubsection*{~~ \textit{Example \arabic{ExCount}: #1}}



\title{A catchy title}
\author{Author One \and Author Two}





Testing the Wendy Doniger example from Penguin.\footcite[][p. 65]{doniger1999splitting}

This line is just to test index.\autocite[please refer to][for a detailed analysis{\index{analysis}}]{a-citekey}

% but this does not work
% This line is just to test index.\autocite[please   refer\index{refer} to][for a detailed analysis]{a-citekey}



\addcontentsline{toc}{chapter}{Index}    % adds Index to TOC


Here is the content of the bibfile question.bib

  title =        {Splitting the difference: Gender and myth in ancient
              Greece and India},
  author =       {Doniger, Wendy},
  year =         {1999},
  publisher =    {University of Chicago Press},
  location =     {Chicago}

  author =       {Author One},
  title =        {A long title: this is a really long title},
  booktitle =    {This is my book: proud to have written this},
  publisher =    {Elite Publishing House},
  year =         2006,
  editor =       {A bigshot editor},
  chapter =      7,
  url =          {http://www.example.com/a-link.html}
  • Thank you Duck Dodgers for the edit. Much clearer now. I appreciate it :) Aug 5 '19 at 10:52



instead of \index{<term>} in pre- and postnotes.

Depending on the style and the settings biblatex may apply additional formatting or other macros to the pre- and postnote fields. It may happen that the field contents are expanded in such a way that unexpandable macros cause issues. That's why you are on the safe side protecting uses of \index in pre- and postnotes with \protect even if it does not appear necessary on first glance.




Testing the Wendy Doniger example from Penguin.\autocite[65]{sigfridsson}

This line is just to test index.\autocite[refer][analysis\protect\index{analysis}]{sigfridsson}

This line is just to test index.\autocite[refer\protect\index{refer}][analysis]{sigfridsson}



In case of biblatex-chicago prenotes are problematic because of \MakeCapital in


With standard biblatex \index in postnotes is problematic because of \mkpageprefix and \mknormrange in


Full index of MWE

  • Thanks a lot @moewe ! You rock! \protect solves the problem. Aug 6 '19 at 6:03
  • Sorry I forgot to accept. Done now. Aug 6 '19 at 6:10

This site is temporarily in read only mode and not accepting new answers.

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