LaTeX forum ⇒ Theses, Books, Title pageslegrand-orange-book /label Topic is solved

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

legrand-orange-book /label

Postby siemj » Thu Jan 04, 2018 3:53 pm

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.
  1. \begin{figure}[h]
  2. \label{fig:figure}
  3. \centering\includegraphics[scale=0.5]{afigure}
  4. \end{figure}
  5.  
  6. \begin{figure}[h]
  7. \label{fig:figure2}
  8. \centering\includegraphics[scale=0.5]{anotherfigure}
  9. \end{figure}
  10.  
  11. 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.

Tags:

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

Postby siemj » Thu Jan 04, 2018 3:58 pm

I suck.
Writing a label after the caption inside the figure-element solves the issue.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9020
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Jan 04, 2018 5:40 pm

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
Site admin


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 1 guest