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

I have a table whose table number should be right-aligned and its caption should be center-aligned on the next line like this:

                          Table 1
|    |       |        |         |

I found the caption package which is a powerful tool for changing caption styles, but it doesn't allow to solve my problem.

share|improve this question

migrated from stackoverflow.com Oct 23 '12 at 11:46

This question came from our site for professional and enthusiast programmers.

With the caption package, you may declare a new format that will add \hfill at the very start of the caption (hereby making its first line raggedright).

(In the following example, I also use the floatrow package to center the tabular material and to allow switching the caption's position from below to above.)




\newcommand{\sometext}{Lorem ipsum dolor sit amet, consectetuer
    adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
    adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
    libero, nonummy eget, consectetuer id, vulputate a, magna.}


This is normal text. \sometext

(Tabular material)
\caption{This is a table caption. \sometext}


enter image description here

share|improve this answer
I believe that loading floatrow just to avoid \centering is exaggerated. :) – egreg Oct 23 '12 at 12:10
@egreg It also allows to switch the caption's position. ;-) – lockstep Oct 23 '12 at 12:12
@lockstep many thanks! it works like a charm! :) – martemiev Oct 23 '12 at 13:55
@martemiev You're welcome -- and don't forget to accept my answer. ;-) – lockstep Oct 23 '12 at 13:57

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.