我有以下使用 tabularx 定义的新环境
\newenvironment{factlist}{%
\newdimen\unbaseline
\unbaseline=\dimexpr-\baselinestretch\baselineskip\relax
\renewcommand\item[2]{%
\textsc{##1} & {\raggedright ##2\smallskip\\}\\[\unbaseline]}
\tabularx{\linewidth}{rX}}
{\endtabularx}
我的使用方法如下:
\begin{factlist}
\item{A}{aaaa}
\item{B}{bbbb}
...
\item{Z}{zzzz}
\end{factlist}
问题是,“事实列表”不能跨页拆分。我认为这是因为 tabularx 不能跨页显示。
我认为“tabu”包中的“longtabu”与 tabularx 具有相同的语法。但是,我无法在 newenvironment 中用 \begin{longtabu} 和 \end{longtabu} 替换 \tabularx 和 \endtabularx。它会引发 Runaway 参数异常。
我是 Latex 的新手。如果您能帮助我运行此代码,那就太好了。
我也愿意尝试其他方法,因为我想要做的就是能够跨页面拆分“事实列表”!
答案1
将这些内容设置为列表几乎总是更好的选择:
\documentclass{article}
\newenvironment{factlist}{%
\begin{enumerate}
\renewcommand\labelenumi{\textsc{\Alph{enumi}}}}
{\end{enumerate}}
\begin{document}
\begin{factlist}
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\item One two three four five.
\end{factlist}
\end{document}
可以根据具体要求调整确切的列表参数,