Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.







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

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.
Document Class: thesis 2006/06/02 v0.1 User-refined LaTeX document class

Package epstopdf Warning: Shell escape feature is not enabled.

* Local config file subfigure.cfg used *
For additional information on amsmath, use the `?' option.
Implicit mode ON; LaTeX internals redefined
*hyperref using default driver hpdftex*

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

(/usr/share/texmf/tex/latex/oberdiek/twoopt.sty)) (./test.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(/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
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?

share|improve this question

closed as too localized by doncherry, Kurt, Speravir, egreg, Qrrbrbirlbel Mar 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

1 Answer 1

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.


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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.