Hi all,
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!
Graphics, Figures & Tables ⇒ \Ref and \label format
NEW: TikZ book now 40% off at Amazon.com for a short time.
\Ref and \label format
What document class are you using? If I'm not mistaken, report and book classes both produce the numbering you want.
Anyway, check the following. It should renew the print format of the figure counter:
If the figure counter is correctly defined, it will restart after each chapter.
For customizing figure and table captions, take a look at the caption package.
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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
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
I have a similar problem with tables. The twist is that when I refer to my table in the text (using \ref{mytable}), I get the format chapternumber.sectionnumber, while the numbering by the \caption gives chapternumber.tablenumber. I want the latter in both cases. How to fix this?
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
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
My problem resolved when i put the label inside the caption:
\caption{Blabla. \label{myTable}}
Aron
\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}