I want to set the font for captions and sub-captions in my Lyx document to 'large'. There is no issues with changing size of captions, but I can't change sub-captions. Here are the preambles I try to use and the errors I get. The errors are not caused by 'caption' package. Here are two preambles that I tried to use.

With subfigure package:

\usepackage[margin=10pt,font=large,labelfont=bf, labelsep=endash]{caption}

With subcaption package:

\usepackage[margin=10pt,font=large,labelfont=bf, labelsep=endash]{caption}

In both cases I receive following errors:


The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

               [ ---    ]{\begin{centering}
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

Lyx MWE can be downloaded here.

LaTex verson (I used Lyx option Export-> LaTeX(plain) to create it) can be downloaded here.

  • I cannot reproduce the error by copying/pasting the preambles you've tried. Please provide a minimum working example. – juliohm Oct 12 '13 at 15:08
  • 1
    @juliohm, link to MWE added to the question. – SS_Rebelious Oct 12 '13 at 15:25
  • Can you add a link to the .tex file for those like me that don't have Lyx? – karlkoeller Oct 12 '13 at 16:00
  • @karlkoeller, a link added in question. – SS_Rebelious Oct 12 '13 at 16:36
  • @SS_Rebelious You can't use both subfig and subcaption. By the way, the centering environment doesn't exist; one should only say \centering. – egreg Oct 12 '13 at 22:45

The error message you show in your question comes from not loading subfig, as it is subfig that defines \subfloat. Adding font=large as an option to subfig should work (requires the caption package as well, I think), i.e.


And of course, remove the subfigure package from the preamble.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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