在 \item 中中斷文本

在 \item 中中斷文本
\documentclass{report}
\usepackage{enumitem}
\begin{document}

\begin{description}[style=unboxed,leftmargin=4.75cm,labelwidth=!,labelsep=0cm,align=left]
    \item[C]High-level programming language.
\item[Monovalent heat pump system]The entire demand for space heating, ventilation heating and heating of DHW is covered by the heat pump.
\end{description}
\end{document}

我該如何將「單價熱泵系統」分成兩條線?我嘗試使用 stackexchange 上另一個提示中的“style=unboxed”,但它沒有改變任何事情。

“單價
熱泵系統”

答案1

\documentclass{report}
\usepackage{enumitem}
\begin{document}

\begin{description}[style=multiline,leftmargin=4.75cm,labelsep=0cm]
    \item[C]High-level programming language.
\item[Monovalent heat pump system]The entire demand for space heating, ventilation heating and heating of DHW is covered by the heat pump.
\end{description}
\end{document}

答案2

在允許的結構中插入手動中斷:

在此輸入影像描述

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{description}[leftmargin=10em,labelwidth=!,labelsep=0pt,align=left]
  \item[C]High-level programming language.

  \item[\smash{\begin{tabular}[t]{@{}l}Monovalent heat \\ pump system\end{tabular}}]
    The entire demand for space heating, ventilation heating and heating of 
    DHW is covered by the heat pump.
\end{description}

\end{document}

上面我使用了左對齊的列(而不是tabular由於的結果而在左側)。它會刪除任何垂直高度/深度分量,這會導致右側的行高問題。l\tabcolsep@{}\smash

如果這是您的設定中反覆出現的主題,您可以考慮使用巨集:

\newcommand{\stackitemdesc}[1]{\smash{%
  \begin{tabular}[t]{@{}l} #1 \end{tabular}}}

相關內容