项目化环境中的悬挂标题缩进错误?

项目化环境中的悬挂标题缩进错误?

我想在悬挂标题中使用 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}

相关内容