How to align the long caption of the table in LaTeX

latex

I have a longtable in LaTeX with a caption that doesn't fit into one line, e.g.

\begin{longtable}{lrrr}
\caption{This is a very long caption that does not fit into one line}
...
\end{longtable}

The resulting PDF looks as follows:

Figure 1: This is a very long caption that does not fit
into one line

I would like the second line of the caption be either aligned with the start of the caption (not the text "Figure 1") to make it look like

Figure 1: This is a very long caption that does not fit
          into one line

or at least make the caption text be centered.
How can I do this?

Best Answer

What documentclass are you using?

If you use something from komascript, your wish should be the default.

So I suppose, you do not use komascript. Then, try the caption package. You have to specify the option format=hang in order to get what you want (i.e. \usepackage[format=hang]{caption}.