I am wondering whether it could be possible to color the items sorted alphabetically. This is an extension of the previous question. Alphabetically display the items in itemize
Here is a MWE:
\documentclass{article}
\usepackage{datatool}% http://ctan.org/pkg/datatool
\newcommand{\sortitem}[1]{%
\DTLnewrow{list}% Create a new entry
\DTLnewdbentry{list}{description}{#1}% Add entry as description
}
\newenvironment{sortedlist}{%
\DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}% Create new/discard old list
}{%
\DTLsort{description}{list}% Sort list
\begin{itemize}%
\DTLforeach*{list}{\theDesc=description}{%
\item \theDesc}% Print each item
\end{itemize}%
}
\begin{document}
Sorted:
\begin{sortedlist}
\sortitem{ISDYNSTP:}
\sortitem{ISCDCA:}
\sortitem{\textcolor{magenta}{MVAR}}
\sortitem{IS2TL}
\end{sortedlist}
\end{document}
I would like "MVAR" to appear in a specific color. I also tried replacing the third item with \sortitem{color{magenta}MVAR}, but that doesn't seem to work either.
Any help would be greatly appreciated, thank you!
