For a list of bullet-separated items, I want the separator to be swallowed if it is the first or last element of the line. That is, I want something like
\renewcommand{\and}{%
\ifnolinebreak% <=== HERE'S THE PROBLEM
{\hfill\textbullet\hfill\xspace}%
\else{}\fi
}
Aa Bb \and Cc Dd \and veryveryverylongE \and Ff Gg \and H
to end up like
Aa Bb * Cc Dd
veryveryverylongE
Ff Gg * H
I know that \discretionary can be exploited in the following way:
\renewcommand{\and}{\discretionary{}{}{\mbox{~~{\textbullet}~~}}}
This does the job, but unfortunately I can't find a way to insert a stretchable skip in the discretionary definition. Thus, it looks awkward in justified mode:
Aa Bb * Cc Dd
veryveryverylongE
Ff Gg * H
Any ideas how to implement the \ifnolinebreak?
If it matters, for this project I use LuaLaTeX...
