I am trying to used the command \ref{} to reference a figure (which has a label), but am receiving the error message 'Undefined control sequence', and the reference is not working. Here is an example of what I'm trying to do:

    \includegraphics[width=10cm, height=10cm]{ch-results/Figures/filename}
    \caption{Caption here}
Notice how cool figure \ref{fig:example} is!

The figure shows up fine, but the resulting line of text is: enter image description here

Instead I want this to say:

enter image description here

For reference, the relevant part of my header is

\documentclass[12pt,lot, lof]{puthesis}
\usepackage[skip=2pt, font=scriptsize,labelfont=bf]{caption}
\hypersetup{colorlinks, bookmarksnumbered}

I am new to LaTeX and the majority of this is coming from a template, so I have no idea where to begin looking for the issue - I've tried googling around quite a bit, but I haven't been able to find anything that works - any help would be greatly appreciated!

closed as unclear what you're asking by user31729, Troy, Stefan Pinnow, TeXnician, Bobyandbob Apr 23 '18 at 16:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Welcome to TeX.SE. Try deleting the instruction \usepackage{subfigure} and recompiling twice. The subfigure package is incompatible with the caption and subcaption packages. (If the template you've acquired loads both packages, the template's author should hang his/her head in shame...) Moreover, subfigure has been deprecated for a decade or more and shouldn't be used any longer. – Mico Apr 18 '18 at 1:13
  • 2
    Or better, if possible, dot not use templates. Start with a clean preamble and then add only what you really need/understand. Templates are useful at first to learn about some packages and commands, and take ideas about document layouts, but they rarely can prevent you from knowing what you are doing ... and debug third templates is a pain in the ass. – Fran Apr 18 '18 at 7:40

Browse other questions tagged or ask your own question.