我被要求將此答案作為一個帶有自我回答的問題,以便其他用戶可以找到。
簡而言之,我想要預設的 KOMA 標題縮進行為,但除此之外,我還想要強制換行。
答案1
這是期望的最終狀態:
不幸的是,nooneline-argument(來自另一個問題的提示和第一個修復想法)破壞了它。
這對我有用:
我在序言中使用了這個:
%\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}
玩得開心 :)