我想做这个:
Term This is the definition of the word. No matter how much is typed
here it should always line up like this. How do I do this? I am
not sure since there is another word on the first line.
Next Term Not to mention, the alignment should be consistent for multiple
entries as well. The entries may span multiple pages as well.
我正在使用 LuaLaTeX。
答案1
使用enumitem
包:
\documentclass{article}
\usepackage{calc}
\usepackage{enumitem}
\newlength\widest
\begin{document}
red yellow blue, red yellow blue, red yellow blue,
red yellow blue, red yellow blue, red yellow blue,
\settowidth\widest{\textbf{word}}
\begin{description}[leftmargin=\dimexpr\widest+\labelsep\relax,labelindent=0pt,
labelwidth=\widest]
\item[word]
red yellow blue, red yellow blue, red yellow blue,
red yellow blue, red yellow blue, red yellow blue,
\item[that]
one two three four, one two three four, one two three four,
one two three four, one two three four, one two three four,
one two three four, one two three four, one two three four,
\end{description}
\end{document}
对于最宽标签的自动计算,您可以看到我的答案到根据最宽的标签自动设置描述列表“标签宽度”?。
答案2
\documentclass{article}
\begin{document}
\begin{description}
\item[word]
red yellow blue, red yellow blue, red yellow blue,
red yellow blue, red yellow blue, red yellow blue,
\item[that]
one two three four, one two three four, one two three four,
one two three four, one two three four, one two three four,
one two three four, one two three four, one two three four,
\end{description}
\end{document}
答案3
另一种选择是仅使用表格,但根据您真正想要在右列中放置的内容,这可能会受到限制:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\linewidth}{@{}lX}
Term & This is the definition of the word. No matter how much is typed here it should always line up like this. How do I do this? I am not sure since there is another word on the first line. \\
Next Term & Not to mention, the alignment should be consistent for multiple
entries as well. The entries may span multiple pages as well.
\end{tabularx}
\end{document}