如何避免描述项目标签中的语句超出行数?

如何避免描述项目标签中的语句超出行数?

有这样的描述:

\begin{description}
\item[One or several threads are operating concurrently on some data structure, which is bad because and also blablabla.]
\end{description}

如何避免将这个(确实很长的)标签写到一行?我希望它换行。目前它只写到一行,并且超出了文档范围 :(

答案1

我真的认为这是不是的预期目的\item[],但也许使用\parbox会有所帮助:

\begin{description}
\item[\parbox{10em}{One or several threads are operating concurrently
on some data structure, which is bad because and also blablabla.}]
\end{description}

答案2

enumitem

\setlist[description]{style=unboxed}

(3.x 的语法。2.x 使用\setdescription)。默认情况下,LaTeX 会将描述标签(实际上是所有列表标签)装箱,并style=unboxed执行显而易见的操作。

答案3

两种解决方案可能更适合您实际想要实现的目标。只需使用itemize或使用paragraphs 即可:

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{itemize}[label={}]
\bfseries
\item An extremely long description that is written in bold and so on which is long enough to wrap properly
\item Another item
\end{itemize}

Or you could just use paragraphs:

\paragraph{A very long item with lots of words in it and so on and then some normal text}

This text is normal
\end{document}

如果您还想要缩进,那么有一些软件包可以提供帮助。(要获取更多缩进的段落集合...)

相关内容