I have a paper of about 35 pages. It has about 8 figures, which while writing, I embed in the text. For submission the journal wants me to put the figures on separate pages at the end of the text.
When the figures are embedded in the text, the numbering and referencing is correct. When I simply move the lines embedding the figures (see below) to the end of the text, the figures are numbered correctly in the captions under the figures, but all references in the text are to Figure 5. I can see this in the .aux file.
Here is as sample of the lines to insert the figures. [removing \singlespacing makes no difference]
\begin{figure}[p!]
\centering
\includegraphics[width=0.5\textwidth]{ModalValues.pdf}
\singlespacing{ \caption{Modal values of the limit distribution.}
\label{fig:mode}
\end{figure}
Graphics, Figures & Tables ⇒ Figure references all have same number
NEW: TikZ book now 40% off at Amazon.com for a short time.

Figure references all have same number
After several hours of trial and error, I discovered that when the figures are in a separate file (input at the end of the document) or just moved to the end of the document, the \singlespacing to control the layout of the \caption matters.
Removing that got the referencing right. Though at the expense of having double spaced captions.
Removing that got the referencing right. Though at the expense of having double spaced captions.
- Stefan Kottwitz
- Site Admin
- Posts: 10340
- Joined: Mon Mar 10, 2008 9:44 pm
Figure references all have same number
Hi Adamant,
welcome to the forum!
The command
This would be different:
Stefan
welcome to the forum!
The command
\singlespacing
is a simple switch. It switches to single spacing. It is not a command that takes an argument. By using the curly braces, the \caption
command got its own local scope, grouped in braces. So it did not step up the figure counter, since the caption command effect stays local within the braces.This would be different:
Code: Select all
Code, edit and compile here:
\begin{figure}[p!]\centering\includegraphics[width=0.5\textwidth]{ModalValues.pdf}\singlespacing\caption{Modal values of the limit distribution.\label{fig:mode}\end{figure}
LaTeX.org admin
Figure references all have same number
Thanks for that.
The odd thing is that when the figures were embedded in the text, rather than all put together at the end, that syntax (error) for \singlespacing{\caption{...}} didn't matter---caption still stepped up the counter. Only when the figures were bunched at the end did it matter.
But thanks---that was the problem.
The odd thing is that when the figures were embedded in the text, rather than all put together at the end, that syntax (error) for \singlespacing{\caption{...}} didn't matter---caption still stepped up the counter. Only when the figures were bunched at the end did it matter.
But thanks---that was the problem.
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Figure references all have same number
Sorry to reply to a "solved" post, but you might check out the endfloat package, which would satisfy your journal's request without you having to do essentially anything at all with the figures. (Now that you have solved the singlespace scoping problem.)