我被要求将这个答案作为一个具有自答性的单独问题,以便其他用户可以找到它。
简而言之,我想要默认的 KOMA 标题缩进行为,但除此之外,当我想要时还可以强制换行。
答案1
这是期望的最终状态:
不幸的是,nooneline 参数(来自另一个问题和第一个修复想法的提示)破坏了它。
以下是对我有用的方法:
我在序言中用到了这一点:
%\KOMAoption{captions}{belowfigure,nooneline,tableheading}
% nooneline was necessary for linebreaks:
% cf.http://tex.stackexchange.com/questions/66111/linebreaks-in-koma-script-captions
\KOMAoption{captions}{tableheading,belowfigure}
\newcommand{\capsize}{\fontsize{8}{9.5}\selectfont}
\setkomafont{caption}{\capsize}
\setcapwidth[c]{.8\textwidth}
% --- following two change a lot, try
%\setcapindent{0pt}
%\addtokomafont{caption}{\centering}
\addtokomafont{captionlabel}{\bfseries}
% cf. here: http://tex.stackexchange.com/questions/66116/puzzled-as-to-centering-of-koma-script-captions
% cf. for multiline solution --> avoiding nooneline (because it uncenters the caption)
% last answer here:
% http://tex.stackexchange.com/questions/101595/how-to-add-line-break-to-caption-without-using-caption-package
然后在文档中:
\begin{figure}[htbp]
\begin{center}
\rule{2cm}{2cm}
\caption[Some caption short]{\tabular[t]{@{}l@{}}Some caption foobarbuz \\ source: Here and There\endtabular}
\end{center}
\end{figure}
玩得开心 :)