1

I am having some problems with the figures numeration in my text. The code is what follows.

\documentclass[brazil,sumario=tradicional]{abntex2}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage[alf]{abntex2cite}
\usepackage[brazilian,hyperpageref]{backref}

\begin{document}

\begin{figure}[h]
  \centering
  \begin{minipage}[b]{0.47\textwidth}
    \includegraphics[width=\textwidth]{selection.jpeg}
    \label{fig:elefante}
    \caption{``Para uma seleção justa, todos devem prestar o mesmo exame: por favor, escalem aquela árvore.''}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.45\textwidth}
    \includegraphics[width=\textwidth]{genius.jpeg}
    \label{fig:genios}
    \caption{O mundo está cheio de gênios.}
  \end{minipage}
\end{figure}

A tirinhas\footnote{Elas podem ser encontradas em
\url{https://rlpearson67.files.wordpress.com/2013/08/for-a-fair-selection-everybody-has-to-take\\-the-same-exam-please-climb-that-tree.jpg} e \url{http://cinismoilustrado.com/post/121761541173/genios, respectivamente. Acesso em 11 de novembro de 2015.}} 
nas Figuras \ref{fig:elefante} e \ref{fig:genios} 
refletem o funcionamento da avaliação classificatória.

\end{document}

However, the numerations don't really match to what is on the code. When I use \ref, the numeration on the text is 4.1 and 4.2 respectively, but in the caption the numeration is 1 and 2. Is there any problem in the code or do I just need to use another figure environment with this package?

Franciele Daltoé
  • 219
  • 1
  • 2
  • 5

1 Answers1

1

You have figure labels before captions, consequently they actually refer to previous section number. Put labels after captions:

\begin{figure}[h]
  \centering
  \begin{minipage}[b]{0.47\textwidth}
    \includegraphics[width=\hsize]{example-image}
    \caption{``Para uma seleção justa, todos devem prestar o mesmo exame: por favor, escalem aquela árvore.''}
    \label{fig:elefante}%<--- I change position in your code
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.45\textwidth}
    \includegraphics[width=\hsize]{example-image}
    \caption{O mundo está cheio de gênios.}
    \label{fig:genios}
  \end{minipage}
\end{figure}

and you will get right referencing numbers.

Zarko
  • 296,517