# multienum package within enumerate

Is it possible to use the multienum package within the enumerate environment? The following code does not display correctly (the last column moves to the next line):

\begin{enumerate}
\item \begin{multienumerate}
\mitemxxx{Not1}{Linear1}{Not1}
\mitemxxx{Not2}{Linear2}{Not2}
\end{multienumerate}
\end{enumerate}


Also, if this is possible, how could I change the numbering? Since multienumerate is nested within the enumerate environment, I would like to have each item tagged with alph characters (a,b,c...). If this is not possible, could someone please suggest an alternative approach.

Ideally, what I would like to create is the following:
1. Question 1 Preamble
(a) part a (b) part b (c) part c
(d) part d (e) part e (f) part f
2. Question 2 Preamble
(a) part a (b) part b (c) part c
(d) part d (e) part e (f) part f

where parts a-c and d-f span the linewidth and the labels are vertically aligned.

-
Perhaps the shortlst or multicol package could be good alternatives. Thoughts? – richtera Jun 1 '12 at 23:04
The problem with the shortlst package is that the horizontal and vertical spacing does not look good. The problem with the multicols package is that the numbering is vertical instead of horizontal. – richtera Jun 1 '12 at 23:41

You can change \hsize to \linewidth inside multienumerate, so the environment is aware of the current value for the line width (the package uses \textwidth by default); the representation for the counter used can be changed ny redefining \labelenumi. Another option, if your inner items are naturally balanced would be to use three columns built, for example with the multicol package. The following example shows both alternatives:

\documentclass{article}
\usepackage{enumitem}
\usepackage{multienum}
\usepackage{multicol}

\begin{document}

\noindent Using \texttt{multienum}:
\begin{enumerate}
\item
\setlength\hsize{\linewidth}
\begin{multienumerate}
\setcounter{enumi}{0}
\renewcommand{\labelenumi}
\mitemxxx{Not}{Linear}{Not}
\end{multienumerate}
\end{enumerate}

\noindent Using \texttt{multicol}:
\begin{enumerate}
\item \begin{multicols}{3}
\begin{enumerate}
\item Not
\item Linear
\item Not
\end{enumerate}
\end{multicols}
\end{enumerate}

\end{document}


Perhaps the best option is to use the enumerate* environment from the enumitem package with the inline package option and to control the spacing between items using \hfill:

\documentclass{article}
\usepackage[inline]{enumitem}

\begin{document}

\noindent With \texttt{enumitem}:
\begin{enumerate}
\item
\begin{enumerate*}[itemjoin=\hfill]
\item Not
\item Linear
\item Not
\end{enumerate*}
\end{enumerate}

\end{document}


With the edit to the original question, a better option seems to be the use of a tabularx environment (from the tabularx package) of width equal to \linewidth and with automatic cell numbering:

\documentclass{article}
\usepackage{array}
\usepackage{tabularx}

\newcounter{row}
\renewcommand\therow{\alph{row}}

\begin{document}

\begin{enumerate}
\item
\begin{tabularx}{\linewidth}[t]{*{3}{>{\stepcounter{row}\makebox[1.8em][l]{(\therow)\hfill}}X}}
part 1 & part 2 & part 3\\
part 4 & part 5 & part 6\\
\end{tabularx}
\item
\setcounter{row}{0}
\begin{tabularx}{\linewidth}[t]{*{3}{>{\stepcounter{row}\makebox[1.8em][l]{(\therow)\hfill}}X}}
part 1 & part 2 & part 3\\
part 4 & part 5 & part 6\\
\end{tabularx}
\end{enumerate}

\end{document}


And, of course, if this structure is to be used several times, you can define a new environment to simplify the writting:

\documentclass{article}
\usepackage{array}
\usepackage{tabularx}

\newcounter{row}
\renewcommand\therow{\alph{row}}

\newenvironment{rowenum}
{\setcounter{row}{0}%
\par\noindent\tabularx{\linewidth}[t]
{*{3}{>{\stepcounter{row}\makebox[1.8em][l]{(\therow)\hfill}}X}}%
}
{\endtabularx}

\begin{document}

\begin{enumerate}
\item Question 1 preamble
\begin{rowenum}
part 1 & part 2 & part 3 \\
part 4 & part 5 & part 6 \\
\end{rowenum}
\item Question 2 preamble
\begin{rowenum}
part 1 & part 2 & part 3 \\
part 4 & part 5 & part 6 \\
\end{rowenum}
\end{enumerate}

\end{document}


-
If there is more than one row, multicols numbers vertically. How can I change it so that it numbers horizontally? – richtera Jun 1 '12 at 23:47
If I use multienumerate, how can I change the labels to alph characters? Also, is there a way to make the \hsize property change global to avoid having to add that line every time I call the environment? – richtera Jun 1 '12 at 23:49
@richtera please see my updated answer; the last option (the one using only enumitem) is the best option. – Gonzalo Medina Jun 2 '12 at 0:14
In the last example, if you add a second row, the labels do not line up. – richtera Jun 2 '12 at 0:35
@richtera I updated my answer with a simplified version using a newly defined environment. – Gonzalo Medina Jun 2 '12 at 1:33