我想使用表格构建伪词汇表 - 如何复制悬挂缩进?

我想使用表格构建伪词汇表 - 如何复制悬挂缩进?

我想在论文中加入词汇表,但得出的结论是,这个glossaries包有点多余,因为我不想使用太多功能。我只想能够手动添加一些条目,然后自己处理排序顺序。所以我想我应该尝试构建一个合适的表格。然而,这并不像我想象的那么容易。以下是我到目前为止所做的,在进行过程中调整宽度和分隔以使其看起来正确:

\documentclass[12pt, a4paper, oneside, fleqn]{report}

\usepackage[showframe, top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm, includehead]{geometry}
\geometry{headheight=28pt, headsep=18pt,showframe}


\usepackage{array,booktabs}
%\renewcommand{\arraystretch}{1.5}

\newcommand{\glossrow}[1]{%
  \bfseries
  \begin{tabular}{@{}l@{}}
  \strut#1\strut
  \end{tabular}%
}

\usepackage{longtable}

\begin{document}

{
%\renewcommand{\arraystretch}{1.0}
\addtolength{\tabcolsep}{-5pt}

\begin{longtable}{p{0.05\textwidth}@{} p{0.25\textwidth} @{} p{0.7\textwidth} }

\multicolumn{2}{l}{\glossrow{Here is my new term}} & \\
& \multicolumn{2}{p{0.94\textwidth}}{This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term.} \\ \addlinespace

\multicolumn{2}{l}{\glossrow{Here is my new term}} & \\
& \multicolumn{2}{p{0.94\textwidth}}{This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term.} \\ \addlinespace

\multicolumn{2}{l}{\glossrow{Here is my new term}} & \\
& \multicolumn{2}{p{0.94\textwidth}}{This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term.} \\ \addlinespace

\end{longtable}
}

\end{document}

在每一行都输入有点麻烦\multicolumn{2}{l}。有人能建议一种更自动化的方法来生成类似于altlist格式的内容glossaries吗?也许我还是回到使用 会更容易glossaries

我的词汇表

答案1

您可以简单地使用描述环境来制作类似的东西。

\documentclass{article}

\begin{document}

\begin{description}
\item[Here is my new term] 

This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term.

\item[Here is my new term] 

This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term.

\item[Here is my new term] 

This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term. This is the definition of my new term.
\end{description}

\end{document}

如果您需要在新行上进行描述,则必须使用 enumitem-package。

\usepackage{enumitem}
...  
\begin{description}[style=nextline]
...  

相关内容