Text Formatting ⇒ Setting <section> as the parent counter of <figure>
Setting <section> as the parent counter of <figure>
Using the original class {article}, I insert several pictures into some sections and the captions of figures are counted as Figure 1, Figure 2... normally.
I wanna get such formats as "Figure 1.1" or "Figure 1.2" in Section 1, "Figure 2.1" or "Figure 2.2" in Section 2 and so on. I use \setcounter{figure}{0} after every \section{}.
Though the ideal results are outputted, I think there must be a simpler way. I guess the counter <section> can be set as the parent counter of <figure> before \begin{document}, in which the figures inside Section X can be counted as "Figure X.1" or "Figure X.2" automatically. However, I've searched the keywords online and "texdoc-"ed the packages {hyperref} and {caption} in cmd and have little clues. Is the simpler way feasible?
I would be deeply grateful to anyone who can solve it!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Setting <section> as the parent counter of <figure>
\counterwithin
command in section "Counters and Lengths" of "File t ltcounts.dtx" in 