0

Consider this example:

\begin{figure}[H]
  \begin{center} 
    \subfigure[]{%
      \includegraphics[height=4cm,width=4.5cm]{Fig_10(a)_Current_NLL_Sag}}
      \label{subfig:real time single phase current NLL sag}
    \subfigure[]{%
      \includegraphics[height=4cm,width=4.5cm]{Fig_10(b)_Current_NLL_LL_Sag}} 
      \label{subfig:real time single phase current NLL LL sag}
    \subfigure[]{%
      \includegraphics[height=4cm,width=4.5cm]{Fig_10(c)_Voltage_NLL_LL_Sag}} 
      \label{subfig:real time single phase voltage NLL LL sag}
  \caption{%
    \small \sl
    Opal-RT results under voltage sag condition: $(a)$ load,
    source and compensating current with NLL only $(b)$ load,
    source and compensating current with NLL and LL $(c)$ source,
    load and series injected voltage with NLL and LL
  }
  \end{center} 
  \label{Fig:real time single phase sag}
\end{figure}

Contrary to what I expect the PDF shows only "??"

2
  • Wlcome to TeX.SE. Can you add all your Minimum Working Example?
    – Sebastiano
    Jan 2, 2017 at 17:21
  • 3
    By the way, \begin{center} should be \centering and \end{center} should be removed. If you really want additional vertical space (I doubt it), \label should be before \end{center}. Commands such as \sl have been deprecated for more than 20 years.
    – egreg
    Jan 2, 2017 at 17:34

1 Answer 1

1

You need

\subfigure[<caption>]{<image>\label{..}}

not

\subfigure[<caption>]{<image>}\label{..}

Note that the \label is placed before the last closing brace. Complete example below. I also replaced the center environment with \centering, cf. Weird figure numbering in RevTeX article

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfigure}

\begin{document}
\begin{figure}
\centering
        \subfigure[]{\includegraphics[height=4cm,width=4.5cm]{Fig_10(a)_Current_NLL_Sag}\label{subfig:real time single phase current NLL sag}}
        \subfigure[]{\includegraphics[height=4cm,width=4.5cm]{Fig_10(b)_Current_NLL_LL_Sag}\label{subfig:real time single phase current NLL LL sag}}
        \subfigure[]{\includegraphics[height=4cm,width=4.5cm]{Fig_10(c)_Voltage_NLL_LL_Sag}\label{subfig:real time single phase voltage NLL LL sag}}

        \caption{\small \slshape Opal-RT results under voltage sag condition: $(a)$ load, source and compensating current with NLL only $(b)$ load, source and compensating current with NLL and LL $(c)$ source, load and series injected voltage with NLL and LL}
    \label{Fig:real time single phase sag}
\end{figure}

Fig.~\ref{Fig:real time single phase sag} has
\ref{subfig:real time single phase current NLL sag},
\ref{subfig:real time single phase current NLL LL sag}, and
\ref{subfig:real time single phase voltage NLL LL sag}
\end{document}

But note that the subfigure package is considered deprecated, so it's generally recommended to move to the newer subcaption package (or possibly subfig). That package has a different syntax though. Here is one example with subcaption:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\captionsetup[figure]{textfont={small,sl}}
\begin{document}
\begin{figure}
\centering
        \subcaptionbox{\label{subfig:real time single phase current NLL sag}}{\includegraphics[height=4cm,width=4.5cm]{Fig_10(a)_Current_NLL_Sag}}
        \subcaptionbox{\label{subfig:real time single phase current NLL LL sag}}{\includegraphics[height=4cm,width=4.5cm]{Fig_10(b)_Current_NLL_LL_Sag}}
        \subcaptionbox{\label{subfig:real time single phase voltage NLL LL sag}}{\includegraphics[height=4cm,width=4.5cm]{Fig_10(c)_Voltage_NLL_LL_Sag}}
        \caption{Opal-RT results under voltage sag condition: $(a)$ load, source and compensating current with NLL only $(b)$ load, source and compensating current with NLL and LL $(c)$ source, load and series injected voltage with NLL and LL}
    \label{Fig:real time single phase sag}
\end{figure}

Fig.~\ref{Fig:real time single phase sag} has
\ref{subfig:real time single phase current NLL sag},
\ref{subfig:real time single phase current NLL LL sag}, and
\ref{subfig:real time single phase voltage NLL LL sag}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .