How to make horizontal lists?

The enumitem package has an inline option which implements inline versions of the standard lists using starred versions of the basic list environments. As with other enumitem lists, labels and (horizontal) spacing can be set with key values as well as custom settings for the elements between the list items (typically punctuation).

\documentclass{article}

\usepackage[inline]{enumitem}

\begin{document}

Text before list.
\begin{enumerate*}
  \item My first in list.
  \item My second in list.
\end{enumerate*}
Text after list.

\end{document}

output of code


If you use the enumitem package, you can pass the option [inline]. Doing this enables starred environments corresponding to the regular ones which produce inline lists (\begin{enumerate*}, \begin{itemize*} etc.):

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

\begin{document}

Text before list.
\begin{enumerate*}[label=(\roman*)]
  \item My first in list.
  \item My second in list.
\end{enumerate*}
Text after list.

\end{document}

This package gives you a lot of control over the formatting of enumerate, itemize and description environments and lets you control their style globally or locally, to create custom environments based on the defaults, and to easily specify a range of formatting options. The above example produces an inline enumerated list with labels of the form (i). What I actually do is set up a customised environment for this so that I can use it as I wish:

\newlist{mylist}{enumerate*}{1}
\setlist[mylist]{label=(\roman*)}

Then I can just say

\begin{mylist}
  \item My first in list.
  \item My second in list.
\end{mylist}

and it is easy to change the configuration globally if I need to. By changing the definition of mylist, for example, you could switch all of the lists which used this environment from vertical to inline.


A solution with the package tasks by Clemens Niederberger is found at Wikibooks/Latex

\documentclass{article}
\usepackage{tasks}
\usepackage{amssymb}
\begin{document}

\settasks{label-format={\color{green!70!black}\large\bfseries}, label-align=center, label-offset={10mm}, label-width={10mm}, item-indent={5mm}, item-format={\scshape\small}, column-sep={3mm}, after-item-skip=-1mm, after-skip={3mm}
}


\bfseries Horizontal list with the same look as enumerate.\normalfont
\begin{tasks}[style=enumerate, item-format={\normalfont\tiny}, after-item-skip=4mm](6)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\task Eight
\task Nine
\task Ten
\end{tasks}


\bfseries Horizontal list:  1 = arabic \normalfont
\begin{tasks}[counter-format={tsk[1].}, label-align=left, label-offset={0mm}, label-width={5mm}, item-indent={5mm}, label-format={\bfseries}, column-sep=10mm](4)
\task One One One One One One
\task Two Two Two Two Two Two
\task Three Three Three Three
\task Four Four Four Four Four Four
\task Five
\task Six
\task Seven
\task Eight
\end{tasks}


\bfseries  Horizontal list: r= roman \normalfont
\begin{tasks}[counter-format={(tsk[r])}, label-align=left, label-offset={10mm}, label-width={10mm}, label-format={\bfseries}](4)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\end{tasks}


\bfseries  Horizontal list: R = Roman \normalfont
\begin{tasks}[counter-format={(tsk[R])}, label-align = right, label-width = {10mm}, label-offset={10mm}, label-format = {\bfseries}, after-skip={10mm}](4)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\end{tasks}
\bfseries Horizontal list: a = alphabetical \normalfont
\begin{tasks}[counter-format={tsk[a].}, label-format={\bfseries}](6)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\task Eight
\task Nine
\task Ten
\end{tasks}


\bfseries Horizontal list: A = Alphabetical \normalfont
\begin{tasks}[counter-format={(tsk[A])}, label-offset={10mm}, label-width={10mm}, label-format={\bfseries}](4)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\end{tasks}


\bfseries Horizontal list with the default look.\normalfont
\begin{tasks}[after-skip={10mm}](6)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\task Eight
\task Nine
\task Ten
\end{tasks}


\bfseries Horizontal list with the same look as itemize.\normalfont
\begin{tasks}[style=itemize, column-sep=-35mm, label-align=left, label-offset={0mm}, label-width={3mm}, item-indent={0mm}](6)%
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\task Eight
\task Nine
\task Ten
\end{tasks}


\bfseries Horizontal list with the same look as multiplechoice.\normalfont
\begin{tasks}[style=multiplechoice](6)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\task Eight
\task Nine
\task Ten
\end{tasks}


\bfseries Horizontal list with custom bullets "@@@".\normalfont
\begin{tasks}[label={@@@}, label-offset={10mm}, label-width={10mm}](4)
\task One
\task Two
\task Three
\task Four
\task Five
\task Six
\task Seven
\task Eight
\end{tasks}


\bfseries Horizontal list with variable formatting.\normalfont
\begin{tasks}[label=\textcolor{red}{$\bullet\bullet\bullet$}, label-format={\color{blue!80!black}\large\bfseries}, label-align=left, label-offset={5mm}, label-width={10mm}, item-indent={15mm},
% text aligned if item-indent = label-offset + label-width
item-format={\itshape\small}, column-sep={8mm}, after-item-skip=1mm, after-skip={1cm}](3)
\task Item
\task Item
\task Item
\task Item Item Item Item Item Item
\task Item Item Item Item Item Item
\task Item Item Item Item Item Item
\vglue5mm% 
% parbox: 1st parameter = vertical position =  bottom (b), center (c), top (t)
% parbox: 2nd parameter = height of parbox
% parbox: 3rd parameter = content position =  center, top, bottom or spread
\task \parbox[b][0em][b]{3cm}{Item Item \\ Item Item \\Item} 
\task \parbox[c][0em][c]{3cm}{Item Item \\ Item Item \\Item} 
\task \parbox[t][0em][t]{3cm}{Item Item \\ Item Item \\Item} 
\vglue5mm
\task* task* spans more than one column.
\task  Item
\task[\small$\blacksquare\textcolor{orange}{\blacksquare}\blacksquare$] Item
\task[\normalsize$\blacksquare\textcolor{orange}{\blacksquare}\blacksquare$] Item
\task[$\blacksquare\otimes\blacksquare$] Item
\task  Item
\task! task! spans all columns in any case.
\task[$\otimes\otimes\otimes$]  Item
\task! task! spans all columns in any case.
\task[\small$\blacksquare\textcolor{green}{\blacksquare}\blacksquare$] Item
\task[\small$\blacksquare\textcolor{orange}{\blacksquare}\blacksquare$] Item
\task*(3) task*(3) takes max. of 3 of remaining columns.
\task*(2) task*(2) takes max. of 2 of remaining columns.
\task  Item
\task*(3) task*(3) takes max. of 3 of remaining columns.
\task  Item
\task[\small$\blacksquare\textcolor{blue}{\blacksquare}\blacksquare$] Item
\task[\small$\blacksquare\textcolor{pink}{\blacksquare}\blacksquare$] Item
\task[\small$\blacksquare\textcolor{orange}{\blacksquare}\blacksquare$] Item
\task startnewitemline starts...  \startnewitemline
\task  Item
\task  Item
\task  Item
\end{tasks}

\end{document}

enter image description here enter image description here

Tags:

Inline

Lists