I am having an unecessary dot on the numbering of my sections, figures etc, as you can see on the pictures below (i.e., in the figure labeling right before ":"). I would like to know how can this be removed and have a "normal" numbering.
This is the template that I am using:
template
Numbering of section, figures, tables etc with an additional dot
numbering
Related Solutions
Changing the numbering of (e.g.) figures involves two modifications:
Redefining whether or not the
figure
counter will be reset whenever the chapter/section counter is incremented;Redefining the "appearance" of the
figure
counter (\thefigure
), i.e., removing (or adding) the chapter/section prefix.
Standard solution: \counterwithout
The standard solution – which deals with modifications 1 and 2 mentioned above – is to use the \counterwithout
and \counterwithin
commands.
Since October 2018 the commands are in the LaTeX kernel; for earlier releases one needs \usepackage{chngcntr}
The following example shows how to achieve continuous figure numbering in the book
class:
\documentclass{book}
\counterwithout{figure}{chapter}
\begin{document}
\chapter{foo}
\begin{figure}
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{A figure}
\end{figure}
\end{document}
Conversely, here's how to achieve per-section figure numbering in the article
class:
\documentclass{article}
\counterwithin{figure}{section}
\begin{document}
\section{foo}
\begin{figure}
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{A figure}
\end{figure}
\end{document}
It works the same way for (e.g.) tables, custom-defined floats, equations, and footnotes. (Note that in many document classes featuring the \chapter
command, footnotes are numbered per chapter even though the footnote
counter does not show the chapter prefix.) The commands may also be used for theorem environments; it is easier, though, to specify the numbering of a new theorem environment when defining it:
\newtheorem{thm}{Theorem}% Continuous numbering
\newtheorem{prop}{Proposition}[section]% Per-section numbering
You may also customize the numbering of the sectioning headings themselves. To, say, accomplish continuous numbering of sections in the book
class (by default, those are numbered per chapter), but per-part numbering of chapters (which are by default numbered continuously), your preamble should contain
\counterwithout{section}{chapter}
\counterwithin{chapter}{part}
To influence the resetting of counters without changing their appearance, use the starred macro versions \counterwithout*
and \counterwithin*
. E.g., for per-section numbering of figures in the article
class – but without attaching a section prefix to \thefigure
–, add the following to your preamble:
\counterwithin*{figure}{section}
It is also possible to redefine a counter's resetting and appearance any number of times in the document body. Note that \counterwithout
, \counterwithin
and their variants won't affect the counter's current value; to change the latter, use \setcounter{<counter>}{<new value>}
.
AMSmath solution
The AMS classes and the amsmath
package feature the \numberwithin
macro which matches \counterwithin
. However, there is no AMS equivalent to \counterwithout
. Usage example: \numberwithin{equation}{section}
. See the full example by cmhughes. If you use math, you may prefer loading amsmath
anyway and using \numberwithin
.
Other solutions
The caption
package features the key–value options figurewithin
and tablewithin
which allow to change the numbering of (surprise) figures and tables. Permitted option values are chapter
, section
, and none
. (For the first code example above, this translates into \usepackage[figurewithin=none]{caption}
.)
The listings
package uses \AtBeginDocument
to define the lstlisting
counter of the environment of the same name. To turn off the environment's per-chapter numbering for classes that feature \chapter
, issue \lstset{numberbychapter=false}
in the document preamble. To enable per-section numbering for classes without \chapter
, add the following to your preamble:
\AtBeginDocument{\counterwithin{lstlisting}{section}}
You need the subfig
or the subcaption
package for that. Here is an example using the subfig
package:
\documentclass{article}
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure1.pdf}\label{fig:subfig-a}}\\
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure2.pdf}}\\
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure3.pdf}}\\
\subfloat[caption of the subfigure]{\includegraphics[height = 0.2\textwidth,width=0.8\textwidth]{Figure4.pdf}}...
\caption{caption of the whole figure}\label{fig:whole}
\end{figure}
The whole figure is~\label{fig:whole} and the first subfigure is~\label{fig:subfig-a}.
\end{document}
See subcaption vs. subfig: Best package for referencing a subfigure for differences between the two packages
Best Answer
The
sdqthesis
class is based onKOMAscript
.scrbook
adds an\autodot
after the last number in sections, subsections, figures, tables, etc.An easy way to get rid of that annoying extra point everywhere is to redefine
\autodot
to be empty.If you want to get the point back in the chapter numbering, change the
\chapterformat
. The same with the page headings.