On 12-10-15 2:04 AM, Christophe Genolini wrote:
Le 14/10/2012 00:00, Duncan Murdoch a écrit :
On 12-10-13 3:20 PM, Christophe Genolini wrote:
Hi the list,

I am about to submit an article describing an R package to the Journal of 
Statistical Software but I
encounter a strange behavior of LaTeX: the numbering of the figure is correct 
(1. 2. 3. ...), but
when I make a reference to a figure, the section (or the subsection) number 
appears instead of the
figure number.
I check if this behavior occurs with the file example provide in the jss 
package style: it does (I
joint the example to this mail). So does someone know what is wrong?

Sincerely
Christophe



This body part will be downloaded on demand.


I would guess you put the \label in the wrong place.  Put it in the \caption 
and it should be fine.

Duncan Murdoch

It works, thanks.
But it looks surprising for me. I use LaTeX for quite a long time and I always 
put the \label after
the \caption (and I find several website that advice to do so). Is it something 
specific to the jss
style?

According to http://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing:

"When a label is declared within a float environment, the \ref{...} will return the respective fig/table number, but it must occur after the caption. When declared outside, it will give the section number. To be completely safe, the label for any picture or table can go within the \caption{} command, "

so I don't think this is JSS specific.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to