# Using 'caption' package with 'thesis' class - undefined control sequence [closed]

I am trying to compile my PhD thesis. It worked a while ago (a few months or so) but something has somehow changes since then because I get an

undefined control sequence


error relating to the caption package.

I have stripped it all down to a minimal example. I've kept all the package declarations in the preamble though.

\documentclass[a4paper,oneside]{thesis}

\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\newcommand{\ANGLE}{180}
\usepackage[usenames,dvipsnames]{color}

\usepackage[normal]{subfigure}
\setlength{\abovecaptionskip}{15pt}
\usepackage{flafter}
\usepackage[section]{placeins}
\usepackage[hang,small]{caption}
\usepackage{rotating}
\usepackage{enumerate}
\usepackage{array}
\usepackage{times}
\usepackage{amsmath,amsfonts,mathrsfs}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage[round]{natbib}
\usepackage{hyperref}
\usepackage[version=3]{/home/qq002439/.tex/mhchem}

\begin{document}

\begin{figure}
\caption{figure}
\end{figure}

\end{document}


That's the code I'm trying to compile using pdfLaTeX. Here is the output log:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/openSUSE)
entering extended mode

(./test.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, german-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, ar
abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc
h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono
greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, ku
rmanji, latin, latvian, lithuanian, mongolian, mongolian2a, bokmal, nynorsk, po
lish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, span
ish, swedish, turkish, ukenglish, ukrainian, uppersorbian, welsh, loaded.
(/home/qq002439/.tex/thesis.cls
Document Class: thesis 2006/06/02 v0.1 User-refined LaTeX document class
(/usr/share/texmf/tex/latex/base/bk11.clo))
(/usr/share/texmf/tex/latex/geometry/geometry.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty)
(/usr/share/texmf/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texmf/tex/generic/oberdiek/ifvtex.sty))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texmf/tex/latex/pdftex-def/pdftex.def)))
(/usr/share/texmf/tex/latex/oberdiek/epstopdf.sty
(/usr/share/texmf/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texmf/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texmf/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texmf/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texmf/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texmf/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texmf/tex/generic/oberdiek/ltxcmds.sty))

Package epstopdf Warning: Shell escape feature is not enabled.

(/usr/share/texmf/tex/latex/latexconfig/epstopdf-sys.cfg)))
(/usr/share/texmf/tex/latex/graphics/color.sty
(/usr/share/texmf/tex/latex/latexconfig/color.cfg)
(/usr/share/texmf/tex/latex/graphics/dvipsnam.def))
(/usr/share/texmf/tex/latex/subfigure/subfigure.sty
****************************************
* Local config file subfigure.cfg used *
****************************************
(/usr/share/texmf/tex/latex/subfigure/subfigure.cfg))
(/usr/share/texmf/tex/latex/base/flafter.sty)
(/usr/share/texmf/tex/latex/placeins/placeins.sty)
(/usr/share/texmf/tex/latex/caption/caption.sty
(/usr/share/texmf/tex/latex/caption/caption3.sty))
(/usr/share/texmf/tex/latex/rotating/rotating.sty
(/usr/share/texmf/tex/latex/base/ifthen.sty))
(/usr/share/texmf/tex/latex/tools/enumerate.sty)
(/usr/share/texmf/tex/latex/tools/array.sty)
(/usr/share/texmf/tex/latex/psnfss/times.sty)
(/usr/share/texmf/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the ?' option.
(/usr/share/texmf/tex/latex/amsmath/amstext.sty
(/usr/share/texmf/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf/tex/latex/amsmath/amsopn.sty))
(/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texmf/tex/latex/jknapltx/mathrsfs.sty)
(/usr/share/texmf/tex/latex/base/textcomp.sty
(/usr/share/texmf/tex/latex/base/ts1enc.def))
(/usr/share/texmf/tex/latex/multirow/multirow.sty)
(/usr/share/texmf/tex/latex/natbib/natbib.sty)
(/usr/share/texmf/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texmf/tex/latex/oberdiek/hycolor.sty
(/usr/share/texmf/tex/latex/oberdiek/xcolor-patch.sty))
(/usr/share/texmf/tex/latex/hyperref/pd1enc.def)
(/usr/share/texmf/tex/latex/latexconfig/hyperref.cfg)
Implicit mode ON; LaTeX internals redefined
(/usr/share/texmf/tex/latex/ltxmisc/url.sty)
(/usr/share/texmf/tex/generic/oberdiek/bitset.sty
(/usr/share/texmf/tex/generic/oberdiek/intcalc.sty)
(/usr/share/texmf/tex/generic/oberdiek/bigintcalc.sty))
(/usr/share/texmf/tex/generic/oberdiek/atbegshi.sty))
*hyperref using default driver hpdftex*
(/usr/share/texmf/tex/latex/hyperref/hpdftex.def)
(/home/qq002439/.tex/mhchem.sty

LaTeX Warning: You have requested package /home/qq002439/.tex/mhchem',
but the package provides mhchem'.

(/usr/share/texmf/tex/latex/tools/calc.sty)
(/usr/share/texmf/tex/latex/oberdiek/twoopt.sty)) (./test.aux)
(/usr/share/texmf/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf/tex/latex/psnfss/ot1ptm.fd)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(/usr/share/texmf/tex/latex/hyperref/nameref.sty
(/usr/share/texmf/tex/latex/oberdiek/refcount.sty)) (./test.out) (./test.out)
! Undefined control sequence.
\captionlabelfont@default ->\cph@font

l.30 \caption{figure}

? ! Undefined control sequence.
\captionlabelfont@default ->\cph@font

l.30 \caption{figure}

? ! Undefined control sequence.
\captiontextfont@default ->\cpb@font

l.30 \caption{figure}

? ! Undefined control sequence.
\captionlabelfont@default ->\cph@font

l.30 \caption{figure}

? ! Undefined control sequence.
\captionlabelfont@default ->\cph@font

l.30 \caption{figure}

? ! Undefined control sequence.
\captiontextfont@default ->\cpb@font

l.30 \caption{figure}

? ! Undefined control sequence.
<argument> ...ngth {\baselineskip }{0pt}\@chapapp
\ \thechapter \hspace {\st...
l.33 \end{document}

? [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux) ){/usr/shar
e/texmf/fonts/enc/dvips/base/8r.enc}</usr/share/texmf/fonts/type1/urw/times/utm
r8a.pfb></usr/share/texmf/fonts/type1/urw/times/utmr8a.pfb>
Output written on test.pdf (1 page, 19428 bytes).
Transcript written on test.log.


As you can see, it actually writes out a .pdf file which looks okay, but it messes up my thesis compilation completely. Does anyone have any suggestions about how a LaTeX newbie could go about solving this?

-

## closed as too localized by doncherry, Kurt, Speravir, egreg, QrrbrbirlbelMar 31 '13 at 23:55

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to TeX.sx!. Your are using the old TeX Live version 2009. Update your system to TeX Live 2012 and your example compiles without errors. See: How do I update my TeX distribution? –  Marco Daniel Mar 31 '13 at 15:02
“I have stripped it all down to a minimal example. I've kept all the package declarations in the preamble though.” – this is pretty much a contradictio in adiecto; one of the most important parts of creating a MWE is getting rid of irrelevant packages. As it stands, your question is too localized and likely to be closed, but it can be reopened if you create a true MWE. If you need more hints on that, check out I've just been asked to write a minimal example, what is that?. –  doncherry Mar 31 '13 at 22:18

The detection of the thesis document class (http://www.ctan.org/pkg/thesis) was very naive in the old days of the caption package since I was not aware of other document classes which are called thesis as well. This was fixed on 2009/11/15, so it seems your caption package is older than that and you stumbled over a problem which was already solved more than 3 years ago.
If updating your TeX distribution is not an option you could either try renaming your document class (e.g. to mythesis or anything else than thesis), or as an alternative you could try loading the caption package with own labelfont= and textfont= settings, e.g.
\usepackage[hang,small,labelfont=,textfont=]{caption}

This will overwrite the labelfont and textfont support for the CTAN thesis document class, and therefore drop the support of \cph@font and \cpb@font which are internal commands of the CTAN-thesis document class.
BTW: The subfigure` package should not be used for new documents, it's only available for making old documents still compile.