梅威瑟:
\documentclass{book}
\usepackage{multienum}
\begin{document}
\thispagestyle{empty}
\Large
\begin{multienumerate}
\mitemxx{This is the first sentence.}{This is the second sentence.---which I want numbered 1.}
\mitemxx{This is the third sentence.---which I want numbered 2.}{And this is the fourth sentence.---which I want numbered 2.}
\mitemxx{This is the fifth sentence.---which I want numbered 3.}{This is the last sentence.---which I want numbered 3.}
\end{multienumerate}
\end{document}
输出:
为了配对的目的---我如何重新编号显示,以便每列的第一项编号为 1。;每列的第二项编号为 2。;并且每列的第三项编号为 3。(如果有更多条目,依此类推)?
另外,如何为每列引入标题?有没有比使用更好的方法来实现这一点multienumerate
?
答案1
正如我在评论中指出的那样,最好使用并行列包,几个选择从中选择。
但是,为了快速解决问题,您可以修改实现\mitemxx
以防止增加第二列的计数器。
内部\mitemxx
调用另一个宏\itemxx
,它将实际列打印为标签、内容、标签、内容的序列。在两个标签/内容对之间,您可以添加命令\addtocounter{multienumi}{-1}
来撤消第一个标签引起的计数器增量。
请注意,这只会影响枚举的第一级,如果您有嵌套列表,这将无法正常工作。要解决这种情况,需要对包代码进行更复杂的更改,这将阻止此答案成为快速修复 :)
梅威瑟:
\documentclass{book}
\usepackage{multienum}
% definition modified from the source in multienum.sty
\renewcommand{\itemxx}[2]{\parbox[t]%
{\labelwidth}{\hfill{\labelname}}\hskip\labelsep
\parbox[t]{.5\remainxx}{\raggedright #1}%
\addtocounter{multienumi}{-1}%
\hfill\parbox[t]%
{\labelwidth}{\hfill{\labelname}}\hskip\labelsep
\parbox[t]{0.5\remainxx}{\raggedright #2}\smallskip}
\begin{document}
\thispagestyle{empty}
\Large
\begin{multienumerate}
\mitemxx{This is the first sentence.}{This is the second sentence.---which I want numbered 1.}
\mitemxx{This is the third sentence.---which I want numbered 2.}{And this is the fourth sentence.---which I want numbered 2.}
\mitemxx{This is the fifth sentence.---which I want numbered 3.}{This is the last sentence.---which I want numbered 3.}
\end{multienumerate}
\end{document}
结果: