1

I want to use \index{entry} inside of the bibliographic item. When I cite this item it appears in text on the current page (I use style=verbose-trad1) and also on the page where full bibliography is printed. I want to remove from my index page numbers related to \printbibliography section.

MWE:

\documentclass{article}

\usepackage[style=verbose-trad1]{biblatex}
\usepackage{imakeidx}
\makeindex

\begin{filecontents}{\jobname.bib}
@book{a1,
  author        = {Aniston, John},
  title         = {Be happy},
  location      = {London\index{London}},
  date          = {1953},
  pagetotal     = {100},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
Lorem \autocite{a1}.

\clearpage
\printbibliography
\printindex
\end{document}

Result: index

In Index we see page numbers 1 (because of citation on the page 1), and 2 (because of appearing in bibliography). How can I remove page 2 from index?

2

I suggest you use a new command, say \citeindex. Then we can redefine that command to do nothing in the bibliography

\documentclass{article}

\usepackage[style=verbose-trad1]{biblatex}
\usepackage{imakeidx}
\makeindex

\newcommand*{\citeindex}{\index}
\AtBeginBibliography{\renewcommand*{\citeindex}[1]{}}

\begin{filecontents}{\jobname.bib}
@book{a1,
  author        = {Aniston, John},
  title         = {Be happy},
  location      = {London\citeindex{London}},
  date          = {1953},
  pagetotal     = {100},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
Lorem \autocite{a1}.

\clearpage
\printbibliography
\printindex
\end{document}

Index
London, 1

Note that you can let biblatex index the location field automatically, e.g. with

\documentclass{article}

\usepackage[style=verbose-trad1, indexing=cite]{biblatex}
\usepackage{imakeidx}
\makeindex

\renewbibmacro*{citeindex}{%
  \ifciteindex
    {\indexnames{labelname}%
     \indexfield{indextitle}%
     \ifciteseen
       {}
       {\indexlist{location}}}
    {}}


\begin{filecontents}[force]{\jobname.bib}
@book{a1,
  author        = {Aniston, John},
  title         = {Be happy},
  location      = {London},
  date          = {1953},
  pagetotal     = {100},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
Lorem \autocite{a1}.

\clearpage
\printbibliography
\printindex
\end{document}
2
  • Thanks! Perhaps I can just add the line \AtBeginBibliography{\renewcommand*{\index}[1]{}} without introducing new command?
    – andc
    Oct 7 at 16:52
  • 1
    @andc If you don't want any indexing in the bibliography that should be safe. With a new name you can be sure that you only disable the indexing you added yourself in the .bib files.
    – moewe
    Oct 7 at 19:17

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.