我想在悬挂标题中使用 itemize 环境,但缩进与正文中的缩进相同。我希望列表从悬挂标题缩进。
\documentclass{scrbook}
\usepackage{caption}
\begin{document}
foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\begin{itemize}
\item bar
\end{itemize}
\begin{figure}
\captionsetup{singlelinecheck=off}
\caption[foo bar]{foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\begin{itemize}
\item this listing belongs to the caption
\item but looks as if it was part of the body
\end{itemize}}
\end{figure}
\end{document}
答案1
这样的设置似乎可能是一种例外,而不是常态。因此,使用\textbullet
适当的itemize
间距手动设置项目。
\documentclass{scrbook}
\usepackage{caption}
\begin{document}
foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\begin{itemize}
\item bar
\end{itemize}
\begin{figure}
\captionsetup{singlelinecheck=off}
\caption[foo bar]{foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\textbullet \hspace{\labelsep}this listing belongs to the caption
\textbullet \hspace{\labelsep}but looks as if it was part of the body
}
\end{figure}
\end{document}
您还可以在环境中设置内容tabularx
:
\documentclass{scrbook}
\usepackage{caption,tabularx}
\begin{document}
foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\begin{itemize}
\item bar
\end{itemize}
\begin{figure}
\captionsetup{singlelinecheck=off}
\caption[foo bar]{foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\medskip
\noindent
\begin{tabularx}{\linewidth}{@{\phantom{\figurename~\thefigure:~}} l @{\hspace{\labelsep}} X @{}}
\textbullet & this listing belongs to the caption \\
\textbullet & but looks as if it was part of the body
\end{tabularx}}
\end{figure}
\end{document}