# Horizontal enumeration in multiple columns

Consider the following minimal example:

\documentclass{article}

\setlength{\parindent}{0mm}

\usepackage{paralist}
\usepackage{tabto}

\begin{document}

\NumTabs{3}
\begin{inparaenum}
\item text
\tab\item text
\tab\item text
\tab\item text
\tab\item text
\tab\item text
\end{inparaenum}

\end{document}


Which results in:

It does exactly what I want, but I was wondering whether it was possible to create an environment, say tabbedEnum so that we can eliminate the use of the \tab, in particular, that the first case doesn't need a tab but all others do. Something of the form:

\begin{tabbedEnum}[3]
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedEnum}

-
If enumitem package is an option, then you can tweak the answer in tex.stackexchange.com/questions/46665/… to your liking – hpesoj626 Jan 6 '13 at 14:14

Just redefine \item to do what you want, but after the first use:

\documentclass{article}

\setlength{\parindent}{0mm}

\usepackage{paralist}
\usepackage{tabto}

\newenvironment{tabbedenum}[1]
{\NumTabs{#1}\inparaenum\let\latexitem\item
\def\item{\def\item{\tab\latexitem}\latexitem}}
{\endinparaenum}

\begin{document}

\begin{tabbedenum}{3}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedenum}

\bigskip

\NumTabs{3}
\begin{inparaenum}
\item text
\tab\item text
\tab\item text
\tab\item text
\tab\item text
\tab\item text
\end{inparaenum}

\end{document}


Since we are using the original \item command at the end, you can also use the optional argument after \item.

-
That's cleverer than mine :) – clemens Jan 6 '13 at 16:10
That's a very elegant solution! – Geoff Jan 6 '13 at 16:12
@cgnieder Minimalism. :) – egreg Jan 6 '13 at 16:12
How to add package enumerate inside like this 1) tex 2) Tex 3) Tex ... – minthao_2011 Jun 5 '13 at 1:26

Well, you can define your own environment that uses some \inner@tab that redefines itself on first use to call \tab and redefines \item to call \inner@tab before it issues the real \item:

\documentclass{article}

\usepackage{paralist}
\usepackage{tabto}
\usepackage{etoolbox}

\makeatletter
\newenvironment{tabbedEnum}[1][3]{%
\ifblank{#1}{\NumTabs{3}}{\NumTabs{#1}}%
\inparaenum
\let\orig@item\item
\def\inner@tab{\let\inner@tab\tab}%
\renewcommand\item[1][]{%
\inner@tab\ifblank{##1}{\orig@item}{\orig@item[##1]}}%
\ignorespaces
}{%
\endinparaenum
}
\makeatother

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\noindent
\begin{tabbedEnum}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedEnum}

\lipsum[2]

\end{document}


As an alternative you could use exsheets' {tasks} environment. It does not look exactly the same, though. Anyway, here it is:

\documentclass{article}
\usepackage{exsheets}

% all arguments except {name} are optional

\usepackage{lipsum}% for dummy text

\begin{document}

\lipsum[1]

\begin{tabbedEnum}
\item text
\item text
\item text
\item text
\item text
\item text
\end{tabbedEnum}

\lipsum[2]

\end{document}


-
I really like the tasks environment from exsheets! Note that it is now available as a standalone package, tasks. Thanks for pointing this out, it also solved an old problem of mine for formatting worksheets: tex.stackexchange.com/questions/133330/… – Chris Chudzicki Oct 22 '15 at 15:21