我正在新环境中使用表格来创建定义列表,但一些被定义的东西是两个单词。我想将第一个单词放在一行,将另一个单词放在下一行,但我尝试的每件事都给出错误或不正确的结果。(如果只有一个单词,这种方法就没问题。)以下是我目前所得到的:
\documentclass{article}
\usepackage{fullpage}
\setlength\parindent{0pt}
\newenvironment{defn}[2]
{\begin{tabular}{p{1in} p{5in}}
\hfill\underline{#1} & #2
}
{\\ \end{tabular}}
\begin{document}
\begin{defn}
{Jib\\ Jab} {Here is the definition of the word Jib Jab}
\end{example}
\begin{defn}
{Def2} {Here is the definition of the word Def2}
\end{defn}
\end{document}
答案1
你喜欢获得这样的东西吗?
命令\underline{...}
不允许破坏带下划线的文本。例如,可以使用包来实现soul
:
\documentclass{article}
\usepackage{array}
\usepackage{soul}
\setlength\parindent{0pt}
\newenvironment{defn}[2]
{\begin{tabular}{>{\raggedleft}p{1in} p{5in}}
\hfill\ul{#1} & #2
}
{\end{tabular}}
\begin{document}
\begin{defn}
{Jib\\ Jab}{Here is the definition of the word Jib Jab}
\end{defn}
\begin{defn}
{Def2} {Here is the definition of the word Def2}
\end{defn}
\end{document}