Graphics, Figures & Tables\ref not quite right in appendix environment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
stevenm
Posts: 1
Joined: Wed Jun 23, 2010 1:32 pm

\ref not quite right in appendix environment

Post by stevenm »

Hello all,

I've managed to stave off signing up to a forum for the 6 months of my thesis, but I've finally been beat and need some help....

note: labels are definitely after captions :-D

Inside the appendix environment I have several equations, figures, and tables. When using \ref to reference some things inside the appendix environment it doesn't work how I would expect it to. \ref is referencing the equations correctly e.g. "Equation \ref{eq:eq1}" gives "Equation A.1", and it's referencing figures outside of the appendix environment ok too e.g. "Figure \ref{fig:sec1-3}" gives "Figure 1.3".

But when I try to reference figures or tables which are created inside the appendix environment the output isn't complete e.g. "Figure \ref{app:fig1}" gives "Figure A", where I want "Figure A.1".

mwe - main:

Code: Select all

\usepackage[toc]{appendix}

\begin{appendices}
\begin{center} \textbf{\Huge{Appendicies}} \end{center}

\newpage
\section{Settlement}
\label{settlechanges}
\input{APPsettlementchanges}

\end{appendices}
mwe - APPsettlementchanges:

Code: Select all

Table \ref{tab:modelchange} displays the....

\begin{table}[H]
\textit{\caption{Distribution of total costs using different settlement models.}}
\begin{center}
{
\begin{tabular}{|c|}

\hline
1 \\ \hline

\end{tabular}
}
\end{center}
\label{tab:modelchange}
\end{table}
In the above "\ref{tab:modelchange}" is just giving me "A" where I'd like to get "A.1".

Any ideas?

The hyperref package is being used, I believe that can sometimes cause problems with \ref, could that be the issue?


Thanks in advance!

Recommended reading 2024:

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

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

daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: \ref not quite right in appendix environment

Post by daleif »

Please provide a full minimal example. I cannot see which document class your are using.

And also, do not use the center environment inside a float, it created double spacing around the stuff in the float.
Post Reply