I'm writing my thesis in Latex and this is the first time ever for me to use it. I've figured out a lot of things except this one – I need custom captions for pictures that are connected with sections, subsections, etc. I've put this lines in my preamble
\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{figure}{subsection}
\counterwithin{figure}{subsubsection}
but when I'm using images in section it looks like this:
And it should look like this:
What I need is a way to keep this look in subsections and subsubsections, but not in sections.
Best Answer
We add the
figure
counter to the reset list of every relevant sectioning command; then we redefine\thefigure
to check (from top to bottom) which is the lowest level non zero sectional counter. Finally, with the help oftocloft
, we increase the space reserved for the figure numbers in the list of figures.