Creating a List of Figures in LaTeX: Solving the Referencing Problem

  • Context: LaTeX 
  • Thread starter Thread starter marraneth
  • Start date Start date
  • Tags Tags
    Latex List
Click For Summary

Discussion Overview

The discussion revolves around the challenges of creating a list of figures in LaTeX when figure captions include citations. Participants explore various methods to ensure that citation numbers in the captions correspond correctly to their order in the main text.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes a problem where figures are labeled incorrectly in the list of figures due to citations in their captions.
  • Some participants suggest placing citations in the text before or after the figures instead of in the captions.
  • Another approach proposed is to manually input citation numbers into the captions rather than using the \cite command.
  • There is a suggestion to write out the citation in the caption instead of using a reference format.
  • A participant expresses a desire for an automatic solution, indicating frustration with manual methods.
  • One participant asserts that LaTeX should handle citations in captions without issues and requests a minimal example to diagnose the problem.
  • Another participant provides a minimal example to illustrate how citations can be structured in the document.
  • There is a suggestion to use the bibliographystyle 'unsrt' and the package 'notoccite' to address the citation order issue.
  • A follow-up explains how to use 'nottocite.sty' to provide a short version of the caption for the list of figures, allowing for correct citation numbering.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method to resolve the citation issue, with multiple competing views and approaches presented throughout the discussion.

Contextual Notes

Some limitations include the dependence on specific LaTeX packages and the need for careful structuring of captions to achieve the desired citation order.

marraneth
Messages
3
Reaction score
0
I'm creating a large document in LaTeX, with several figures. Some of these figures have citations within the captions, which is causing problems since I am creating a list of figures, with captions, at the start of the document. A figure that appears midway through has a reference that should be number 30 based on its appearance in the main text, but because the list of figures is compiled first, it is labelled number 1. How do I get around this?
 
Physics news on Phys.org
try putting the citation in the text either prior to or just after the figure...
 
If you only have several figures, manually input the citation numbers into the captions.

eg. don't use \cite but type out ''[3]''
 
Try writing out the citation in the caption and not as a reference...
 
Thanks for the help, I had hoped there was some way to do it automatically, rather than just typing it out. I'm sure LaTeX must be capable of doing it somehow, I had thought maybe something using \protect. Oh well, I'll just have to admit defeat I guess.
 
Latex should not have a problem with citation in a caption (footnotes is a whole other matter). Can you recreate the problem in a minimal example and post it?
For eksample the following seems to work

Code:
\documentclass[article]{memoir}
\begin{document}
\listoffigures*\newpage
\begin{figure}\caption{ddfg 1\cite{citation-here}}\end{figure}
\begin{figure}\caption{ddfg 2}\end{figure}
\begin{figure}\caption{ddfg 3}\end{figure}
\begin{figure}\caption{ddfg 4}\end{figure}
\begin{figure}\caption{ddfg 5\cite{citation-here}}\end{figure}
\begin{figure}\caption{ddfg 6}\end{figure}
\bibliography{bib-file-here}
\bibliographystyle{plain} 
\end{document}

otherwise news:comp.text.tex might be able to help (but they will most likely ask for a minimal example as well).
 
There would be no problem ordinarily, but the references appear in the text also, and not in the same order as the figures appear. So perhaps an example would be something like:

Code:
\documentclass[article]{memoir}
\begin{document}
\listoffigures*\newpage
Blah blah blah \cite{citation-two}.
\begin{figure}\caption{ddfg 1\cite{citation-one}}\end{figure}
\begin{figure}\caption{ddfg 2}\end{figure}
\begin{figure}\caption{ddfg 3}\end{figure}
\begin{figure}\caption{ddfg 4}\end{figure}
\begin{figure}\caption{ddfg 5\cite{citation-two}}\end{figure}
\begin{figure}\caption{ddfg 6}\end{figure}
Blah blah blah \cite{citation-one}.
\bibliography{bib-file-here}
\bibliographystyle{plain} 
\end{document}

I want the order of the references to be as they are in the text.
 
\bibliographystyle{unsrt}
and
\usepackage{notoccite} should do the trick. Se the documentation in notoccite.sty for how it works,
http://www.tug.org/tex-archive/macros/latex/contrib/misc/notoccite.sty
 
Last edited by a moderator:
Follow up on nottocite.sty

As pointed out in nottocite.sty, all you really need to do is provide a short version of the caption (to be used in the list of figures) that does not include the citation:

\caption[short version in square brackets without citation, to appear in list of figures]{long version in curly braces with \cite{entrylabelx}, to appear in body with actual figure}

Therefore, the number assigned to \cite{entrylabelx} corresponds to the citation counter value when the long version of the caption is processed in the body of the document. There is no need to use nottocite.sty if you are ok with providing captions this way.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 11 ·
Replies
11
Views
4K