TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using subfloat, the caption centers with regards to the figure width. However I want to center it with regards to the axes. How to horizontally shift the captions (manually) for all the subfloats in a figure environment, to center to axes?

(My figures are in PDF format.)

caption is not centered to axes caption centered to axes

share|improve this question
up vote 5 down vote accepted

To shift the sub-captions to the left or right one could use the margin= option offered by the caption package. The following example document will shift the sub-captions 2cm to the right:

  \caption{Caption text}

Please note the usage of the additional option oneside which will make sure that the extra sub-caption margins will not be swapped in twoside documents.

enter image description here

(Of course this trick will work in conjunction with the subcaption package as well.)

share|improve this answer
Oh yes, this works perfectly. Been looking for something like this for a long time. Thank you! – SPK Jul 15 at 13:55

If you are willing to change the format of your figure calls to \bxfigure{caption}{image}, the boxhandler package can do this for you with their \FigureDeadMargin setting and the use of a \rule. It would look something like


\FigureDeadMargin 8ex
\bxfigure{This is the caption that should be offset 8ex to the right}
{\fbox{FIGURE DATA GOES HERE}\rule{8ex}{0ex}}


Note that the caption will be page left-right centered, while the figure will be shifted to the left by the offset.

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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