I am trying to center figures along their horizontal axis using the example in Sec. 5.4 of subfig, but no matter what I do, this is what I'm seeing. Even when I exaggerate the figures' widths so that there's no way they could overlap, like so:

the problem

I am using the following code and packages. The block of code was copied directly from the example in the subfig documentation.



  \subfloat[Big figure]{\usebox{\tempbox}}%
  \subfloat[Small figure]{%
    \vbox to \ht\tempbox{%
  \caption{Two more sub-floats.}


I would have preferred to use subcaption, but it does not appear to be compatible with the template I'm required to use for my dissertation.

What can I do to fix this?

Edit: I wasn't clear about the scope of the problem. I am trying to get the figures to sit next to each other, not stack vertically. Everything I do seems to just adjust the figures' sizes, still one above the other, not side-by-side. I'll try and come up with a MWE.

Edit #2: Updated with a proper code example. This is the document generated using the above code:

Update #3

Edit #3: Updated with a more illustrative code example, one which does not use demo in graphicx. The image above has been replaced with the one using the updated code. I am trying to center the two figures on their respective horizontal axes, like this:

|      |    ___
|      |   |   |
|      |   |___|

I have also updated the post tile to clarify the "centerline" issue. I'm bad at explaining things today.

  • I apologize, I should have been clearer, and will update the post to clarify. I am trying to get the figures next to each other, not stacked vertically. Everything I do just results in them changing size, still stacked vertically. – amizener Aug 12 '16 at 15:42
  • We need something we can compile in order to reproduce the problem. Or try floatrow. – cfr Aug 12 '16 at 15:44
  • @cfr I realized that after posting. I'm working on one now. – amizener Aug 12 '16 at 15:47
  • Duly updated with a proper example. My apologies. – amizener Aug 12 '16 at 15:53

Is this the output you were after?


enter image description here




    \subfloat[Small figure]{%
    \subfloat[Big figure]{%
    \caption{Two more sub-floats.}
| improve this answer | |
  • @amizener Then I don't undestand what you desire. Please explain better. I thought you wanted the two figures side-by-side. And what do you mean by you last comment here? conseals what? – Runar Aug 12 '16 at 19:17
  • I apologize, I hit enter too early and then my internet immediately went down for a few minutes. I was not intending to be rude. No, but it appears that that is because the 'demo' option in graphics hides the problem. This code does not center the two figures next to each other, which is what I am trying to do. I will update the original post with a more accurate image and code. – amizener Aug 12 '16 at 19:18
  • @amizener looks centred to me. – Runar Aug 12 '16 at 19:19
  • On the page, yes, but not with respect to their respective horizontal axes. – amizener Aug 12 '16 at 19:27
  • @amizener okey, see updated answer – Runar Aug 12 '16 at 19:37

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.