BibTeX, biblatex and biberCorrect numbering of refs within figures

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
colmatrix
Posts: 6
Joined: Tue Oct 27, 2009 11:57 pm

Correct numbering of refs within figures

Post by colmatrix »

Hi,

The problem I'm having at the moment is that the numbering of my references is being thrown off by the fact that I have placed some citations within figures. For example, I have:

blah blah blah, \cite{ref A}.

\begin{figure}
........
\caption{Figure caption, from \cite{ref B}}
\end{figure}

blah blah blah, \cite{ref C}

I would like the references to be numbered in the order they appear in the final document, so in the example I would want above A to be numbered #1, B=2, etc. However, what I actually get is that the reference contained within the figure is labeled first, then the other references. So I would get B=1, A=2, C=3 in the above example. That way, when you read the compiled document, reference 2 appears before refernece 1... :cry:

I'm using the natbib bibliography style, formatted with unsrtnat.

Does anyone have any ideas on how I can sort this? Thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

colmatrix
Posts: 6
Joined: Tue Oct 27, 2009 11:57 pm

Re: Correct numbering of refs within figures

Post by colmatrix »

I've actually (kind of) sorted it. The problem was that there was a list of figures before the main document. This meant that, technically, references contained within figure captions appeared at the start of the document, which threw the numbering off. By removing the list of figures all the references are back in the correct order.

I could put the list of figures at after the main document, to keep the numbering correct, and then simply move the printed page to the start afterwards......unless anyone has a more elegant LaTeX based solution? ;)
magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

Correct numbering of refs within figures

Post by magicmoose »

Try using

Code: Select all

\caption[short caption for LoF/LoT]{Full caption with reference}
colmatrix
Posts: 6
Joined: Tue Oct 27, 2009 11:57 pm

Re: Correct numbering of refs within figures

Post by colmatrix »

That worked a treat. Thanks for your help! :)
Post Reply