# Creating a ragged right, inline list, separated by bullets or line breaks

I'd like to create a ragged right inlist list, where each item is separated by either a bullet or a line break.

For example: I'd like the following

\usepackage{ragged2e}
\begin{minipage}[t]{0.31\textwidth}
\begin{flushleft}
\begin{mylist}
\item Apple
\item Berry
\item Rocky~Road
\item Cream
\item Jello
\item Fish
\end{mylist}
\end{flushleft}


To yield this:

So more specifically, each item should be separated by a bullet until we hit the end of a line, in which case a line break should be used instead.

Right now, I have to manually format the list like so:

\begin{flushleft}
Apple \textbullet{} Berry\\
Rocky~Road \textbullet{} Cream\\
Jello \textbullet{} Fish
\end{flushleft}


This latter way of doing it is extremely painful as any update to the list involves manually reformatting the whole list.

Paralist comes close to providing the functionality I need, but it precedes each item with a bullet, whereas I need to separate each item with either a bullet or a linebreak.

Thank you for your time!

## 1 Answer

\documentclass{article}

\newenvironment{mylist}{\def\item{\ifhmode\cleaders\hbox to 1.9em{\hss\textbullet\hss}\hskip2em\fi}}{}
\begin{document}

\begin{minipage}[t]{0.31\textwidth}
\begin{flushleft}
\begin{mylist}
\item Apple
\item Berry
\item Rocky~Road
\item Cream
\item Jello
\item Fish
\end{mylist}
\end{flushleft}
\end{minipage}
\hfill\vrule\hfill
\begin{minipage}[t]{0.61\textwidth}
\begin{flushleft}
\begin{mylist}
\item Apple
\item Berry
\item Rocky~Road
\item Cream
\item Jello
\item Fish
\end{mylist}
\end{flushleft}
\end{minipage}

\end{document}

• Remember to add some mortar to your bricks of code.
– Werner
May 31 '17 at 21:57
• @Anonymous the if just checks you are in horizontal mode and does nothing if in vertical mode (so does nothing before the first item at the start of the paragraph) May 31 '17 at 22:16
• @Anonymous I'm sure we have an answer explaining leaders, I'll see if I can find a link May 31 '17 at 22:51
• @Anonymous this one shows leaders being used in a similar way in the vertical direction tex.stackexchange.com/questions/186328/… May 31 '17 at 22:56
• @Anonymous also tex.stackexchange.com/questions/253291/… May 31 '17 at 23:13