如何在LaTeX中对齐表格的长标题?

vit*_*aut 1 latex

我有一个 LaTeX 长表,其标题不适合一行,例如

\begin{longtable}{lrrr}
\caption{This is a very long caption that does not fit into one line}
...
\end{longtable}
Run Code Online (Sandbox Code Playgroud)

生成的 PDF 如下所示:

Figure 1: This is a very long caption that does not fit
into one line
Run Code Online (Sandbox Code Playgroud)

我希望标题的第二行与标题的开头(而不是文本“图 1”)对齐,使其看起来像

Figure 1: This is a very long caption that does not fit
          into one line
Run Code Online (Sandbox Code Playgroud)

或者至少使标题文本居中。我怎样才能做到这一点?

phi*_*mue 5

您使用什么文档类?

如果您使用 komascript 中的某些内容,您的愿望应该是默认的。

所以我想,你不使用 komascript。然后,尝试该caption包。您必须指定该选项format=hang才能获得您想要的内容(即\usepackage[format=hang]{caption}.