I'm number figures and tables by section using \counterwithin
. However, instead of numbering the figures 1.1, 1.2, 2.1, 2.2, etc., they are getting numbered 11, 12, 21, 22, etc. Is there a way to reinsert the decimal?
Here is a MWE:
\documentclass{article}
\usepackage{float}
\counterwithin{figure}{section}
\begin{document}
\section{foo}
\begin{figure}[H]
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{Should be 1.1}
\end{figure}
\begin{figure}[H]
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{Should be 1.2}
\end{figure}
\section{foo2}
\begin{figure}[H]
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{Should be 2.1}
\end{figure}
\begin{figure}[H]
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{Should be 2.2}
\end{figure}
\end{document}
\thefigure
macro, so you could try\makeatletter\def\thefigure{\thesection.\@arabic\c@figure}\makeatother
...