4

I want to have something looking like this:

\item  
\item 1.  
      2

My intention is to have the first enumerated item in the same line as the itemize item. I read something about \leavemode, but it doesn't work for me. (The enumeration should be aligend)

Minimal example:

\begin{itemize}  
\item1      
\item2 blabla \leavemode \begin{enumerate} \itema   
          \itemb   \end{enumerate}  
\item3    
\end{itemize}
Andrew Swann
  • 95,762

2 Answers2

7

A solution comes from the enumitem package: the first item is introduced through the enumerate* environment (inline enumerate); it is declared to be the first element of a to be continued series — a notion introduced by enumitem in version 3.0. The other items come from an enumerate environment, belonging to the tobecont series, with suitable values of \topsep and \partopsep.

Here is an example, in which I afford the luxury of two inline items first:

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage{fourier} 

\usepackage[inline, shortlabels]{enumitem}

\begin{document}

    \begin{itemize}
    \item Blahblah

    \item Blahblah 
        \begin{enumerate*}[series = tobecont, itemjoin = \quad]
        \item a \item b
        \end{enumerate*}

         \begin{enumerate}[resume = tobecont, ,topsep = 0pt, partopsep = 0pt]
        \item c
        \item d
        \end{enumerate}

\item Blahblah
\end{itemize}

\end{document} 

enter image description here

Bernard
  • 271,350
2

If you are prepared to forego page breaks in the sublist and don't mind specifying the width, then you can use a minipage:

Sample output

\documentclass{article}

\begin{document}

\begin{itemize}
\item 1
\item 2 blabla
  \begin{minipage}[t]{0.4\linewidth}
    \begin{enumerate} \item a
    \item b \end{enumerate}
  \end{minipage}

\item 3
\end{itemize}

\end{document}
Andrew Swann
  • 95,762