I want to generate the figure numbers depending on the sections, for example, if section number is 1.1 then I want to generate the figure numbers as 1.1.1, 1.1.2 and so on.
Thanks in advance
Add
\usepackage{chngcntr}
\counterwithin{figure}{section}
to your preamble.
Reference:
Add
\renewcommand{\thefigure}{\arabic{section}.\arabic{subsection}.\arabic{figure}}
to your document. This will redefine the figure number to contain the section and subsection number.
MWE:
\documentclass{article}
\usepackage{graphicx}
\renewcommand{\thefigure}{\arabic{section}.\arabic{subsection}.\arabic{figure}}
\begin{document}
\section{title}
\subsection{subtitle}
\begin{figure}[htbp]
\includegraphics[width=\textwidth]{example-image-duck}
\caption{content...}
\end{figure}
\end{document}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With