如何删除标题文本“图形:”下方的空白 - 或者:如何使图形标题完全对齐(像一个块)

如何删除标题文本“图形:”下方的空白 - 或者:如何使图形标题完全对齐(像一个块)

我有图片和标题。字符串“Figure:”下方有很多空白。即,实际的标题是左对齐的,但“左行”从“Figure:”的冒号后开始,从而损失了很多空间,见图:

在此处输入图片描述

所以,我想消除这个空间——该怎么做呢?

以下是生成示例的(最小/标准)代码:

\documentclass[10pt,a4paper,oneside]{scrartcl}
\usepackage{graphicx}

\begin{document}

\begin{figure}
  \centering
  \includegraphics[width=.6\textwidth]{example-image-a}
  \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\end{figure}

\end{document}

答案1

添加\setcapindent{0pt}到序言中:

\documentclass[10pt]{scrartcl}% a4paper and twoside=false are defaults for scrartcl
\setcapindent{0pt}% <- added
\usepackage{graphicx}

\begin{document}
\begin{figure}
  \centering
  \includegraphics[width=.6\textwidth]{example-image-a}
  \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\end{figure}
\end{document}

在此处输入图片描述

答案2

这实际上是在包的手册中描述的:只需按如下方式caption使用其选项:plain

\documentclass[10pt,a4paper,oneside]{scrartcl}
\usepackage{graphicx}
\usepackage[format=plain]{caption}

\begin{document}

\begin{figure}
  \centering
  \includegraphics[width=.6\textwidth]{example-image-a}
  \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\end{figure}

\end{document}

...这将导致期望的结果:

在此处输入图片描述

相关内容