Change numbering of figures in Latex

4

Is there any way to change the numbering of the pictures in Latex?

For example it starts the figure as:

Figure 01: Legend

I'd like it to stay in this format starting at 2.1

Figure 2.1: Caption

    
asked by anonymous 13.04.2016 / 17:15

1 answer

4

I assume that 2.1 is figure 1 of section 2 ...

In this case in the preamble, we put together:

\usepackage{amsmath}
\numberwithin{figure}{section}

In order for the numbering of the figures to include the section number (adapt as desired)

Minimalist example:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\numberwithin{figure}{section}

\begin{document}
\section{Primeira sec.}

\section{Segunda sec.}

\begin{figure}[h]
  \centering
    \fbox{Substituir pela Imagem A}
    \caption{figura A}
\end{figure}
\end{document}
    
13.04.2016 / 18:53