Theses, Books, Title pageslegrand-orange-book /label

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
siemj
Posts: 2
Joined: Thu Jan 04, 2018 3:38 pm

legrand-orange-book /label

Post by siemj »

The Legrand Orange Book template is an excellent template, but after one hour of fiddling with it, I came acrosse a problem.

it looks like when the following code is written in a chapter, the reference sticks to 1.1.

Code: Select all

\begin{figure}[h]
\label{fig:figure}
\centering\includegraphics[scale=0.5]{afigure}
\end{figure}

\begin{figure}[h]
\label{fig:figure2}
\centering\includegraphics[scale=0.5]{anotherfigure}
\end{figure}

As you can see in figure \ref{fig:figure} and figure \ref{fig:figure2}.
The output is:
picture

picture

As you can see in figure 1.1 and figure 1.1.
This is not the case with footnotes for example. Referencing footnotes always succeeds.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

siemj
Posts: 2
Joined: Thu Jan 04, 2018 3:38 pm

legrand-orange-book /label

Post by siemj »

I suck.
Writing a label after the caption inside the figure-element solves the issue.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

legrand-orange-book /label

Post by Stefan Kottwitz »

Welcome to the forum!

Yes, that's correct: the \caption command increases the figure number and places an anchor for referencing via label. So the \caption command has always to come before the \label.

Stefan
LaTeX.org admin
Post Reply