我想知道是否可以为 paralist 包生成resume
类似于enumitem
包中的选项。请注意,无法将类似[resume]
或的内容添加[start]
到包中定义的环境中paralist
。请参阅下面的 MWE:
\documentclass{article}
\setlength{\parindent}{0mm}
\usepackage{paralist}
\usepackage{tabto}
\usepackage{multicol}
\usepackage{amssymb,amsmath}
\newenvironment{tabbedenum}[1]
{\NumTabs{#1}\inparaenum\let\latexitem\item
\def\item{\def\item{\tab\latexitem}\latexitem}}
{\endinparaenum}
\begin{document}
\begin{multicols}{2}
Some long text to be used for sampling.
\begin{tabbedenum}{2}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedenum}\\[1cm]
Some long text to be used for sampling.
\begin{tabbedenum}{1}
\item Some long text to be used for sampling.
\end{tabbedenum}\\[1cm]
Some long text to be used for sampling.
\begin{tabbedenum}{3}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedenum}
\bigskip
Some long text to be used for sampling.
\NumTabs{3}
\begin{inparaenum}
\item text
\tab\item text
\tab\item text
\tab\item text
\tab\item text
\tab\item text
\end{inparaenum}
\end{multicols}
\end{document}
答案1
添加记住计数器末尾值的代码tabbedenum
并定义一个tabbedenum*
使用先前值的新环境:
\documentclass{article}
\setlength{\parindent}{0mm}
\usepackage{paralist}
\usepackage{tabto}
\usepackage{multicol}
\usepackage{amssymb,amsmath}
\newenvironment{tabbedenum}[1]
{\NumTabs{#1}\inparaenum\let\latexitem\item
\def\item{\def\item{\tab\latexitem}\latexitem}}
{\xdef\lastparaenum{\the\value{enumi}}\endinparaenum}
\newenvironment{tabbedenum*}[1]
{\NumTabs{#1}\inparaenum\let\latexitem\item
\def\item{\def\item{\tab\latexitem}\latexitem}%
\setcounter{enumi}{\lastparaenum}}
{\xdef\lastparaenum{\the\value{enumi}}\endinparaenum}
\def\lastparaenum{0}
\begin{document}
\begin{multicols}{2}
Some long text to be used for sampling.
\begin{tabbedenum}{2}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedenum}
Some long text to be used for sampling.
\begin{tabbedenum*}{1}
\item Some long text to be used for sampling.
\end{tabbedenum*}
\bigskip
Some long text to be used for sampling.
\begin{tabbedenum*}{3}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedenum*}
\bigskip
Some long text to be used for sampling.
\begin{tabbedenum}{3}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedenum}
\end{multicols}
\end{document}
您可以看到使用tabbedenum
重置编号。