1

Consider the code

\documentclass{book}
\begin{document}
\parindent 0pt
\begin{enumerate}
\item[I.] The first item. \item[II.] The second item. \item[III.] The third item.
\end{enumerate}
\vspace{15pt}
But what I would like to display is something like this---\\[5pt]

I. The first item. II. The second item. III. The third item.
\end{document}

which produces the output:

enter image description here

QUESTION: How may I produce an enumerate environment in which the items are listed horizontally instead of vertically, so that the list resembles a justified paragraph in the event of many items? Also, is there a way to specify the horizontal space between the items?

Thank you.

2 Answers 2

1

Using enumitem:

\documentclass{book}
\usepackage{enumitem}

\newlist{myinline}{enumerate*}{1}
\setlist*[myinline,1]{%
  label=(\Roman*.),
}

\begin{document}
\begin{myinline}
  \item item 1\hspace*{7pt}
  \item item 2\hspace*{7pt}  
  \item item 3
  \end{myinline}
\end{document}

I have adjusted, in this case, the horizontal space between the items with \hspace*{7pt}

The output:

enter image description here

2
  • You can adjust itemjoin as the gap between items in an inline list.
    – Werner
    Oct 24, 2023 at 23:36
  • Many thanks @Werner Oct 25, 2023 at 12:29
0

You may also use tasks package which is specialized for horizontal lists. In the example below the space between items was set to be 20pt.

\documentclass{book}
\usepackage{tasks}
\begin{document}
    \parindent 0pt
    \begin{tasks}[label=\Roman*.,column-sep=20pt,after-item-skip=10pt,label-align=right,label-offset=4pt](3)%<-- how many items per line
        \task The first item. 
        \task The second item. 
        \task The third item. 
        \task The fourth item.
        \task The fifth item.
        \task The sixth item.
    \end{tasks}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .