我正在写一篇论文,想定义一些关键术语。现在,我只需使用 itemize 和缩进的小项目符号即可。看起来还不错,但我想 LaTeX 的一个优点是,我可以有更大的梦想,找到更多美学选择。
但是,当我在 Google 上搜索“LaTeX 中的单词定义环境”时,我得到的搜索结果都是与数学相关的主题。你们有没有什么好的建议,让我可以在一个环境中定义一个术语,使其与周围的文本偏移?
以下是我现在的做法:
\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
Many terms are important, including surprising ones. In this treatise, we use the word \textit{potato}, like so:
\begin{itemize}
\item Potato. Species of ghost native to Mexico.
\end{itemize}
Therefore, we propose that potatoes be dug up and reburied in accordance with proper rites.
\end{document}
但我更喜欢这样:
\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
Many terms are important, including surprising ones. In this treatise, we use the word \textit{potato}, like so:
Potato. Species of ghost native to Mexico.
% Where the above is nicely indented, offset from the rest of the paragraph, so readers can easily find it.
Therefore, we propose that potatoes be dug up and reburied in accordance with proper rites.
\end{document}
答案1
...缩进得很好,与段落的其余部分偏移,因此读者可以轻松找到它。
enumitem
在我看来,环境的列表格式化功能description
可以做到这一点:
\documentclass{article}
\usepackage{enumitem}
\newlist{worddefs}{description}{1}
\setlist[worddefs]{font=\sffamily\bfseries, labelindent=\parindent, leftmargin=6em, style=sameline}
\begin{document}
Many terms are important, including surprising ones. In this treatise, we use the word \textit{potato}, like so:
\begin{worddefs}
\item[Potato.] Species of ghost native to Mexico.
\item[Potato.] Species of ghost native to Mexico. Species of ghost native to Mexico.
Species of ghost native to Mexico. Species of ghost native to Mexico.
\item[Potatomato.] Species of ghost native to Mexico.
\end{worddefs}
Therefore, we propose that potatoes be dug up and reburied in accordance with proper rites.
\end{document}