Odd and even itemize symbols
You can make a command that changes its own definition, and use that as the label, for example like this:
\documentclass{article}
\usepackage{enumitem}
\usepackage{fontawesome}
\usepackage{xcolor}
\makeatletter
\def\speech@bubble@a{%
\color{blue!70!white}\faCommenting
\global\let\speech@bubble\speech@bubble@b
}
\def\speech@bubble@b{%
\color{green!70!black}\faCommentingO
\global\let\speech@bubble\speech@bubble@a
}
\newlist{dialog}{itemize}{1}
\newlist{dialog*}{itemize}{1}
\setlist[dialog]{
before={\global\let\speech@bubble\speech@bubble@a},
label={\speech@bubble},
}
\setlist[dialog*]{
before={\global\let\speech@bubble\speech@bubble@b},
label={\speech@bubble},
}
\makeatother
\begin{document}
First person first:
\begin{dialog}
\item bla
\item bla
\item bla
\item bla
\item bla
\end{dialog}
Second person first:
\begin{dialog*}
\item bla
\item bla
\item bla
\item bla
\item bla
\end{dialog*}
\end{document}
Here is a solution with the \newtoggle
command from etoolbox
. To simplify the use of this solution, I defined a new itemize-like environment, alternitem
:
\documentclass{article}
\usepackage{enumitem}
\usepackage{fontawesome}
\usepackage{xcolor}
\usepackage{etoolbox}
%
\newtoggle{greeny}
\newlist{alternitem}{itemize}{1}
\setlist[alternitem]{label={\iftoggle{greeny}%
{\color{green!70!black}\faCommentingO\global\togglefalse{greeny}}%
{\color{blue!70!white}\faCommenting\global\toggletrue{greeny}}%
}}
\begin{document}
\begin{alternitem}
\item First person
\item Second person
\item First person
\item First person
\item Second person
\item First person
\end{alternitem}
\end{document}