3

I sometimes use \cite in the figure or table environment and use backref to be able to link to citations from the bibliography.

If I include a list of figures or list of tables the citation is repeated and the corresponding pagenumber is listed in the bibliography.

How can I prevent the count of the second citation, so that only the first one in the main text appears in the bibliography?

MWE:

test.tex:

\documentclass{book}

\usepackage{hyperref}
\usepackage[hyperpageref]{backref}
\renewcommand*{\backrefalt}[4]{%
\ifcase #1 %
Not cited.%
\or
Cited on page #2.%
\else
Cited on pages #2.%
\fi
}

\begin{document}
\mainmatter
\begin{figure}
\caption{Lorem ipsum \cite{One}.}
\end{figure}

\backmatter
\bibliographystyle{unsrtnat}
\bibliography{bib}
\listoffigures

\end{document}

bib.bib:

@Article{One,
title={This},
author={Me},
year=2013,
journal={My journal},
volume=1
}

Compile 3-4 times and both locations will show up in the bibliography.

  • You could use the optional argument (whose text in the ToC): \caption[Lorem ipsum]{Lorem ipsum \cite{One}.} (in the LoF and LoT it doesn't make much sense to have a citation, after all). – Gonzalo Medina Apr 25 '13 at 13:28
  • Could you elaborate on that? The optional argument is the caption text? – BandGap Apr 25 '13 at 13:31
  • Yes, sorry for the mistake in my previous comment. The optional argument will be used in the list of figures; the main argument will be used in the actual figure caption. – Gonzalo Medina Apr 25 '13 at 13:32
4

Since version 2012/07/24 v1.37 package backref provides options enable and disable that can here be used to change the recording of the back references:

\usepackage[hyperpageref]{backref}[2012/07/24]
...
\backrefsetup{disable}
\listoffigures
\listoftables
\backrefsetup{enable}
  • Ah, I didn't know of this option. Really useful. – Gonzalo Medina Apr 25 '13 at 13:48
  • If I put this before \begin{document} I get an error: "LaTeX Error: Missing \begin{document}". If I put it after \begin{... I get another instance of LoF and LoT and warnings about duplicate uses of destination identifiers... – BandGap Apr 25 '13 at 14:10
  • Also the current documentation of backref doesn't mention this. – BandGap Apr 25 '13 at 14:22
  • @BandGap The documentation backref.pdf does mention options enable and disable in section "2.1.3 Other options". – Heiko Oberdiek Apr 25 '13 at 14:27
  • @BandGap What's the difficulty putting \backrefsetup{disable} and \backrefsetup{enable} around your \listoffigures? – Heiko Oberdiek Apr 25 '13 at 14:31

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.