Figure numbering; section numbering within a subsection

Viewed 313

I have an article class document in Latex. I want the figure numbering to just be counting within the section. 1.1, 1.2, 1.3 etc. for figures within subsection and not 1.1.1, 1.2.1, 1.2.2,...

I tried

\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\counterwithin{figure}{section}
\renewcommand{\thefigure}{\arabic{subsection}.\arabic{figure}}
\counterwithin{figure}{subsection}

and just

\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\counterwithin{figure}{section}

but then the figure count reset so it becomes 2.1, 2.1, 2.2, for every new subsection.

Thanks

0 Answers
Related