Doubt about Latex image reference

Asked

Viewed 8,943 times

4

I’m trying to put sequential numbering on 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}

1 answer

3

One way to solve this problem semi-definitively is to use the commands together \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}

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.