答案1
环境description
就是为此而创建的。环境中使用的长度(例如标签的宽度)可以通过使用enumitem
(请参阅文档了解详情)。
\documentclass{article}
\usepackage{enumitem}
\setlist[description]{
labelwidth=22mm,
labelsep=0mm,
leftmargin=22mm
}
\begin{document}
\section*{Glossary}
\begin{description}
\item[Dog] An animal that makes dog noises. Some more text to see if the line will break as it should.
\item[Cat] An animal that makes cat noises
\item[Mouse] An animal that makes neither dog nor cat noises
\item[Key] Not even an animal
\end{description}
\end{document}
答案2
\documentclass[a4paper, 12pt]{report}
\usepackage{tabto,enumitem}
\usepackage{lipsum}
\newcommand*{\mytab}[1]{\tabto{4.5cm}\parbox[t]{%
\dimexpr\textwidth-4.5cm-\labelwidth-\labelsep}{#1}}
\begin{document}
Glossary
\begin{itemize}
\item[] Dog \mytab{An \texttt{animal} that makes dog noises and irritates me no end }
\item[] Cat \mytab{An \texttt{animal} that makes cat noises }
\end{itemize}
\end{document}