0

I'm using The Legrand Book Template. In chapter 3 I tried referring the placeholder image but it is not referring to it correctly as shown in image. enter image description here

\section{Figure}\index{Figure}
I'm referring to figure \ref{fig:placeholder}.
\begin{figure}[h]
\label{fig:placeholder}
\centering\includegraphics[scale=0.5]{placeholder}
\caption{Figure caption}
\end{figure}

You can find the complete code here.

What should I do to correct it?

  • 3
    \label must appear after \caption (or in the \caption{} content), but not before. You're referring to the last counter being increased with \refstepcounter, this is section counter in this case (done internally in the \section macro, effectively), it uses the counter information from the \section{Figure} here, which is not what you want. –  Jun 27 '17 at 17:12
  • @ChristianHupfer I only got \label must appear after \caption, not before. part of your comment. But it solved my problem so thank you. :) – Gaurish Gangwar Jun 27 '17 at 17:16
  • 2
    The rest of my comment is the short explanation what happens ;-) By the way, this is a very frequent error and I think any good introductory book on LaTeX will say that \label should be used after \caption ;-) –  Jun 27 '17 at 17:17

0 Answers0