Doubt about reference of images Latex

4

I'm trying to put sequential numbering into two figures. Example: figura 3a , figura 3b . But when I do \ref{fig1a} in the text, it shows the later numbering (4b):

\documentclass[jou,apacite]{apa6}
\usepackage[brazil]{babel} 
\usepackage{color}

\begin{figure}[h]
  \centering
  \caption{Calculadora de Adução}
  \subfloat[cálculo para mudas]{
    \includegraphics[height=4.5cm]{img/adubacao_mudas.png}
    \label{fig03a}
  }
  \quad %espaco separador
  \subfloat[Calculadora de mudas]{
    \includegraphics[height=4.5cm]{img/inicial_lateral.png}
    \label{fig3b}
  }
\label{fig03}
\end{figure}
    
asked by anonymous 02.09.2017 / 16:18

1 answer

3

One way to solve this problem semi-definitively is to use the \ref and \subref :

\documentclass[jou,apacite]{apa6}
\usepackage[brazil]{babel} 
\usepackage{color}
\usepackage{subfig}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{figure}[h]
  \centering
  \caption{Calculadora de Adução}
  \subfloat[cálculo para mudas]{
    \includegraphics[height=4.5cm]{adubacao_mudas.png}
    \label{fig03a}
  }
  \quad %espaco separador
  \subfloat[Calculadora de mudas]{
    \includegraphics[height=4.5cm]{inicial_lateral.png}
    \label{fig3b}
  }
\label{fig03}
\end{figure}

As Subfiguras \ref{fig03}\subref{fig03a}  e \ref{fig03}\subref{fig3b} fazem parte da Figura \ref{fig03}.

\end{document}

    
02.09.2017 / 16:50