2

I want to start an enumerate after some words and I don't want to change to a new line. The style is like this

\documentclass{article}
\begin{document}
 \noindent Start an enumerate (1) The first line\\
  (2) The second line\\
  (3) The second line.
\end{document} 

But how to make it using package enumitem

\documentclass{article}
\usepackage{enumitem}
\begin{document}
  Start an enumerate 
  \begin{enumerate}[label=(\arabic*)]
    \item The first line is a new line.
  \end{enumerate}
\end{document} 

Any advice will be appreciated.

3

What about this? I assume you want all items but the first to start on a new line, hence my use of itemjoin=\\.

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

\begin{document}

  Start an enumeration:
  \begin{enumerate*}[label=(\arabic*),itemjoin=\\]
    \item The first item doesn't start on a new line.
    \item Second item.
    \item Third item.
  \end{enumerate*}

\end{document}

enter image description here

Here is another way where we define a new list type named mylist (same output as above):

\documentclass{article}
\usepackage{enumitem}

\newlist{mylist}{enumerate*}{1}
\setlist[mylist]{label=(\arabic*),itemjoin=\\}

\begin{document}

  Start an enumeration:
  \begin{mylist}
    \item The first item doesn't start on a new line.
    \item Second item.
    \item Third item.
  \end{mylist}

\end{document}
7
  • Thank you very much!
    – Misaya
    Apr 17 '20 at 9:11
  • You're welcome, I added another way.
    – frougon
    Apr 17 '20 at 9:12
  • Ok, thanks a second time. I once didn't know the parameter itemjoin. You've done me a great favour!
    – Misaya
    Apr 17 '20 at 9:14
  • Excuse me,how to handle the nested enumerate with inline option. I put an mwe here, where enumerate* nesting enumerate will cause an error. ``` \documentclass{article} \usepackage[inline]{enumitem} \begin{document} \begin{enumerate*}[label=(\arabic*),itemjoin=\] \item The first item doesn't start on a new line. \begin{enumerate} \item ee \end{enumerate} \end{enumerate*} \end{document} ```
    – Misaya
    Apr 17 '20 at 10:29
  • AFAICT, you can't use a non-inline list environment like enumerate inside an inline one like enumerate*, but you can use enumerate* for the inner list. The following works: \documentclass{article} \usepackage[inline]{enumitem} \begin{document} \begin{enumerate*}[label=(\arabic*),itemjoin=\\] \item The first item doesn't start on a new line. \begin{enumerate*} \item ee \item ff \end{enumerate*} \item Second. \end{enumerate*} \end{document}. If you prefer, you can pass [label=(\alph*),itemjoin=\\] to the inner enumerate* environment.
    – frougon
    Apr 17 '20 at 10:48

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.