7

I want a customized environment to typeset exercises. Write

\newitem text text text
\newitem text text text
\newitem long text typeset on left column
\newitem text text text
\newitem text text text
\newitem text text text
\newitem long text typeset on left column
\newitem text

get

1. text text text      2. text text text
3. long text typeset on left column
4. text text text      5. text text text
6. text text text
7. long text typeset on left column
8. text

---EDIT---

I have tried the shortlst package but it has some shortcoming like

  1. doesn't support a float picture inside it for figure;
  2. couldn't embed an enumerate environment as conditions or conclusions list;
  3. couldn't set the number of columns in advance.

The multienum' package's implement doesn't fit my need.

Tau spit
  • 917
  • Please provide information regarding the shortcomings. For example, in terms of (1), not even the standard enumerate/itemize can take a floating environment. For (2), what do you mean here? Could you provide another "graphic" that illustrates what you're after? For (3), your original request didn't specify that you're after having a variable number of columns. Would you care to elaborate on the end use, and not just an intermediate look-and-feel as seems to be the case here? – Werner Nov 11 '11 at 03:10
  • You shouldn't be using floats for absolute placement inside a list. If you want this, then perhaps a simple \includegraphics would be better. Some use of a table may be more what you're looking for. – qubyte Nov 11 '11 at 06:47

2 Answers2

7

The shortlst package provides a very intuitive interface that matches that of the traditional enumerate and itemize environments. In this case, you would be interested in using the shortenumerate environment. In the example below, I've limited the text width to 0.6\textwidth via a minipage to allow for proper wrapping of the enumerated list.

enter image description here

\documentclass{article}
\usepackage{shortlst}% http://ctan.org/pkg/shortlst
\begin{document}
\begin{minipage}{0.6\textwidth}
  \begin{shortenumerate}
    \item text text text
    \item text text text
    \item long text typeset on left column
    \item text text text
    \item text text text
    \item text text text
    \item long text typeset on left column
    \item text
  \end{shortenumerate}
\end{minipage}
\end{document}

One downside is that it does not form part of the standard (free) distribution of MiKTeX or TeX Live. That is, it is "free for use but distribution for profit only by arrangement." You would have to add it to your TeX distribution manually. For that, follow the instructions presented in: How can I manually install a package on MiKTeX (Windows). It also translates well to TeX Live distributions.

Werner
  • 603,163
4

Try the multenum package.

\begin{multienumerate}
    \mitemxxo{text text text}{text text text}
    \mitemx{long text typeset on left column}
    \mitemxxo{text text text}{text text text}
    \mitemx{text text text}
    \mitemx{long text typeset on left column}
    \mitemx{text}
\end{multienumerate}

The result is this:

enter image description here

Werner
  • 603,163
qubyte
  • 17,299