Graphics, Figures & Tables ⇒ \ref and \autoref numbering figures like subsections
\ref and \autoref numbering figures like subsections
...blah.blah.blah of the full survey predicts $\sim200-1000$ quasars at
$6.5<z<7.5$ (\autoref{fig:z7:quasars}); such quasars should be...
\begin{figure}
\label{fig:z7:quasars}
\begin{center}
\includegraphics[angle=0,scale=0.5]{agn/agn_census_z7_quasars.pdf}
\caption{{\it Left:} $z-y$ vs. $y$ color-magnitude diagram
\end{center}
\end{figure}
Any ideas under what conditions it can mess up in this way?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
\ref and \autoref numbering figures like subsections
welcome to the board!
Use \label right after the \caption command, not before, see \label description.
Btw. inside figure environments I recommend to use \centering instead of \begin{center} ... \end{center}, see center vs. \centering. Further placement parameters for \begin{figure} like [htbp] could be useful.
Stefan
Re: \ref and \autoref numbering figures like subsections
Also, is there an \endcentering command? How does LaTeX know the scope
of \centering?
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
\ref and \autoref numbering figures like subsections
Did you compile two times to check that?sivertz wrote:Moving the \label after the \caption did not solve the numbering problem.
The scope is limited by the surrounding environment. That's why \end{figure} will end the effect of \centering. It's also possible to limit the scope by braces, likesivertz wrote:Also, is there an \endcentering command? How does LaTeX know the scope of \centering?
Code: Select all
{\centering ... your text ... }
Stefan