# Numbering figures and tables by their section

I am having trouble formatting my list of figures and list of tables.

Currently, my tex document is printing the list in the following manner:

1 Foreign Key Constraint Problem Due to Improper Table Design. . . . 3

2 Application Flow of Territory Maintenance Tool. . . . . . . . . . . . . 4

But I want to number figures by their sections:

3.1.2 Foreign Key Constraint Problem Due to Improper Table Design

-

Your question is the counterpart of this one. So: use the chngcntr package.

\documentclass{report}

\usepackage{chngcntr}
\counterwithin{figure}{section}

\begin{document}

\listoffigures

\chapter{foo}

\section{bar}

\begin{figure}
\centering
\rule{1cm}{1cm}
\caption{A figure}
\end{figure}

\end{document}

-
awesome, your solution worked perfectly! – Midnight Blue May 1 '11 at 22:47