Add second enumeration item on the same line?
Here's a general solution using the enumitem
package. What you want produces some strange looking lists, so I'm not sure I would recommend using it. It works for all three types of lists. The enumitem
package also implements inline lists for all of the three list types. I've added an example here to show that too.
For enumerate
and itemize
lists, any label argument is ignored and therefore you should not use an arbitrarily specified label with those sorts of list.
\documentclass{article}
\usepackage[inline]{enumitem}
\makeatletter
% This command ignores the optional argument for itemize and enumerate lists
\newcommand{\inlineitem}[1][]{%
\ifnum\enit@type=\tw@
{\descriptionlabel{#1}}
\hspace{\labelsep}%
\else
\ifnum\enit@type=\z@
\refstepcounter{\@listctr}\fi
\quad\@itemlabel\hspace{\labelsep}%
\fi}
\makeatother
\parindent=0pt
\begin{document}
% Pure inline list
This is an inline list.
\bigskip
\begin{enumerate*}
\item First item.
\item Second item.
\item Third item.
\item Fourth item.
\end{enumerate*}
\bigskip
% Combined inline list
This is a combined inline enumerated list.
\begin{enumerate}
\item First item \inlineitem Second item\inlineitem Third item.
\item Fourth item
\item Fifth item
\end{enumerate}
\bigskip
% Works with itemize
This is a combined inline itemized list.
\begin{itemize}
\item First item \inlineitem Second item \inlineitem Third item.
\item Fourth item
\item Fifth item
\end{itemize}
\bigskip
% Works with description lists
This is a combined inline description list.
\begin{description}
\item[Foo] First item \inlineitem[Bar]Second item\inlineitem[FooBar] Third item.
\item[Bar] Fourth item
\item[Foo] Fifth item
\end{description}
\bigskip
% Showing that it can be embedded and works with modified labels
The new command works with arbitrary labels and embedding.
\begin{enumerate}
\item
\begin{enumerate}[label=\Alph*.]
\item First item\inlineitem Second item \inlineitem Third item.
\item Fourth item
\item Fifth item
\end{enumerate}
\end{enumerate}
\end{document}
You could also use an line list for the portion you want inline, and then start a new list with the resume
feature available from the enumitem
package:
Notes:
- If you have more that one of these in your document, you should also add the
start=1
option when you start a new list to reset the label counter.
Further Enhancements:
- The inline version is intended for use in a paragraph where there is text preceding it, and an additional space is added at the beginning of the list. Hence, it does not align properly with the subsequent non-inline list. I have added
before=\hspace{-0.6ex}
which seems to make the necessary adjustment. However, there probably is a better way to do this rather than hard code a specific value. Otherwise there may be cases where this needs to be tweaked.
Code:
\documentclass{article}
\usepackage[inline]{enumitem}
\begin{document}
\begin{enumerate*}[series=MyList, before=\hspace{-0.6ex}]
\item Goes on first line.
\item Also goes on first line.
\end{enumerate*}
\begin{enumerate}[resume=MyList]
\item Goes on second line.
\end{enumerate}
\end{document}
I found that multicol package provides a simple solution by enclosing any of the itemize, description or enumerate environments. An example:
\usepackage{multicol}
\begin{multicols}{2}
\begin{enumerate}
\item \( \varphi(x,t)= A \mathrm{e}^{- \alpha (x- c t) } \)
\item \( \varphi(x,t)= A \mathrm{e}^{- 2 \alpha (x- c t) } \)
\item \( \varphi(x,t)= A \ln \left( k (x- c t) \right) \)
\item \( \varphi(x,t)= A \left( x- c t \right) \)
\item \( \varphi(x,t)= A \left( x- c t \right)^n \)
\item \( \varphi(x,t)= A \sin \left( k (x- c t) \right) \)
\item \( \varphi(x,t)= A \sin \left( \alpha (x^2- c^2 t^2) \right) \)
\item \( \varphi(x,t)= A \left( x+ c t \right)^{1/2} \)
\end{enumerate}
\end{multicols}
Notice that multicols is used when defining the environment.