5

I would like to know if it is possible to generate a resume option similar to that in the enumitem package for the paralist package. Note that it is not possible to add something like [resume] or [start] to the environments defined in the paralist package. See MWE below:

\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}

enter image description here

  • After a quick look into paralist docs - no (edit: that is, not without modifying paralist's macros). But current versions of enumitem support so-called "inline" enumerations, i.e., enumerations within a paragraph. – mbork Mar 29 '13 at 19:21
  • @mbork Could you provide a mwe illustrating the above output with desired outcome in the resume enumeration. – azetina Mar 29 '13 at 19:28
  • Yes, but not before a few hours. – mbork Mar 29 '13 at 19:54
5

Add code that remembers the value of the counter at the end of tabbedenum and define a new environment tabbedenum* that uses the previous value:

\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}

enter image description here

You can see that using tabbedenum resets the numbering.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.