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

  • LaTeX
  • Thread starter marraneth
  • Start date
  • Tags
    Latex List
In summary, the individual is having trouble with citations appearing in the wrong order in a list of figures. They are looking for a way to automatically fix this issue in LaTeX, but are also open to manually inputting citation numbers into captions. They have been advised to try using the \protect command or to seek help on the news:comp.text.tex forum. Finally, they have been suggested to use the nottocite.sty package or to provide a short version of the caption without the citation to ensure the correct numbering.
  • #1
marraneth
3
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
  • #2
try putting teh citation in the text either prior to or just after the figure...
 
  • #3
If you only have several figures, manually input the citation numbers into the captions.

eg. don't use \cite but type out ''[3]''
 
  • #4
Try writing out the citation in the caption and not as a reference...
 
  • #5
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.
 
  • #6
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).
 
  • #7
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.
 
  • #8
\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:
  • #9
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.
 

1. How do I add a list of figures in LaTeX?

To create a list of figures in LaTeX, you can use the \listoffigures command. This will automatically generate a list of all the figures in your document, along with their corresponding page numbers.

2. How do I label and reference figures in LaTeX?

To label a figure in LaTeX, you can use the \label{} command within the \caption{} command. To reference a figure, you can use the \ref{} command, followed by the label you assigned to the figure. This will automatically insert the correct figure number in your text.

3. How do I solve referencing problems in my list of figures?

If you are experiencing referencing problems in your list of figures, make sure that you have properly labeled and referenced all your figures. Also, check that the labels you are using are unique and not being used for other elements in your document.

4. How can I customize the appearance of my list of figures in LaTeX?

To customize the appearance of your list of figures, you can use the tocloft package. This package allows you to change the font, spacing, and layout of your list of figures. You can also use the caption package to change the formatting of your figure captions.

5. Can I include a list of figures in my table of contents?

Yes, you can include a list of figures in your table of contents by using the \addcontentsline{} command. This will add a new entry for your list of figures in your table of contents, allowing readers to easily navigate to it.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top