Taking some code from How to sort an alphanumeric list, a mild change to your interface works for sorting via the datatool
package:
\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}
Default:
\begin{itemize}
\item ISDYNSTP: Is dynamic time step used ?
\item ISCDCA:
\item MVAR
\item IS2TL
\end{itemize}
Sorted:
\begin{sortedlist}
\sortitem{ISDYNSTP: Is dynamic time step used ?}
\sortitem{ISCDCA:}
\sortitem{MVAR}
\sortitem{IS2TL}
\end{sortedlist}
\end{document}
To allow for formatting of sorted elements, it's best to modify the syntax. To that end, the following MWE supplied an updated version of \sortitem[<sort label>]{<label/description>}
that takes an optional <sort label>
(used as the label to sort upon):
\documentclass{article}
\usepackage{datatool}% http://ctan.org/pkg/datatool
\newcommand{\sortitem}[2][\relax]{%
\DTLnewrow{list}% Create a new entry
\ifx#1\relax
\DTLnewdbentry{list}{sortlabel}{#2}% Add entry sortlabel (no optional argument)
\else
\DTLnewdbentry{list}{sortlabel}{#1}% Add entry sortlabel (optional argument)
\fi%
\DTLnewdbentry{list}{description}{#2}% Add entry description
}
\newenvironment{sortedlist}{%
\DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}% Create new/discard old list
}{%
\DTLsort{sortlabel}{list}% Sort list
\begin{itemize}%
\DTLforeach*{list}{\theDesc=description}{%
\item \theDesc}% Print each item
\end{itemize}%
}
\begin{document}
Default:
\begin{itemize}
\item ISDYNSTP: Is dynamic time step used ?
\item ISCDCA:
\item MVAR
\item IS2TL
\end{itemize}
Sorted:
\begin{sortedlist}
\sortitem{ISDYNSTP: Is dynamic time step used ?}
\sortitem[ISCDCA]{\textit{ISCDCA:}}
\sortitem[MVAR]{\textbf{MVAR}}
\sortitem{IS2TL}
\end{sortedlist}
\end{document}
If you want a case-insensitive comparison, just replace the \DTLsort
command by \DTLsort*
.