Graphics, Figures & Tables ⇒ \Ref and \label format
\Ref and \label format
How can I change the numbering of my figures from "chapternr.sectionnr.figurenr" to simply "chapternr.figurenr"?
This cannot be very difficult. I have been googling for a while, but did not find a solution.
Thanks in advance!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
\Ref and \label format
Anyway, check the following. It should renew the print format of the figure counter:
Code: Select all
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
For customizing figure and table captions, take a look at the caption package.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\Ref and \label format
This is not the default setting of chapter based classes. Please provide a minimal working example (MWE) that reproduces this behaviour.kees wrote:[...] How can I change the numbering of my figures from "chapternr.sectionnr.figurenr" to simply "chapternr.figurenr"? [...]
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 2
- Joined: Wed Jun 24, 2009 2:47 pm
Re: \Ref and \label format
The way it is now, I get the same number for different tables as long as they are in the same section, when I refer to them using \ref{mytable}.
I've tried with \renewcommand but that only changes the number by \caption, the number by \ref{} remains unchanged.
Aron
-
- Posts: 2
- Joined: Wed Jun 24, 2009 2:47 pm
Re: \Ref and \label format
\caption{Blabla. \label{myTable}}
Aron
\Ref and \label format
Hi Aron,aron.wahlberg wrote:My problem resolved when i put the label inside the caption:
\caption{Blabla. \label{myTable}}
Aron
What you were probably doing is putting the \label command before the caption. You don't need to write the label inside the caption, but after the caption:
\caption{Caption text.}
\label{mytable}