I'm trying to include images with custom caption label format defined using \DeclareCaptionLabelFormat from caption package. If I put \captionsetup inside \floatbox environment the caption and image are not aligned properly.



\DeclareCaptionLabelFormat{mycap1}{(#2) Caption label type 1}
\DeclareCaptionLabelFormat{mycap2}{(#2) Caption label type 2}


             {\caption {Caption for this figure}}

enter image description here

If I remove \captionsetup after \floatbox the image and caption are aligned properly, but I'll not be able to get custom label for the caption. What am I missing here?

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – texenthusiast Jul 12 '13 at 4:55
  • You should use \floatbox{figure}{\captionsetup{labelformat=mycap1}\caption {Caption for this figure}}{\includegraphics[scale=0.5]{sample.png}} instead since \floatbox has three (and not four) mandatory arguments. – Axel Sommerfeldt Jul 12 '13 at 7:36
  • Thats it. Fixed it. – Surya Jul 12 '13 at 8:13
  • @AxelSommerfeldt: An answer please ;-) – Marco Daniel Jul 12 '13 at 10:29

Axel Sommerfeldt wrote:

You should use

    {%first mandatory argument
    {%second mandatory argument
     \caption {Caption for this figure}%
    {%third mandatory argument

instead since \floatbox has three (and not four) mandatory arguments.

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.