[Tex/LaTex] Manually sorting nomenclature elements (with grouping)

nomenclaturesorting

I am using nomencl package and I have grouped Nomenclature section into List of Abbreviations and List of Symbols. The order in List of Symbols is not what I wanted. how is it possible to sort the List of Symbols subsection manually.
the sample code is:

\usepackage{nomencl}
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{
 \ifthenelse{\equal{#1}{A}}{\item[\bfseries\sffamily\large{List of Abbreviations}]}{
 \ifthenelse{\equal{#1}{S}}{\item[\bfseries\sffamily\large{List of Symbols}]}{}}
}
\begin{document}
\printnomenclature
\nomenclature[a]{PDF}{Probability Density Function}
\nomenclature[s]{$\gamma$}{Phase noise}
\nomenclature[s]{$\jmath$}{Imaginary unit}
\nomenclature[s]{$a$}{Vector of unknowns}
\nomenclature[s]{$\hat{a}$}{Vector of floats}
\nomenclature[s]{$\check{a}$}{Vector of fixed}
\end{document}

the order in symbol group will output as:
$\check{a}$ , $\gamma$, $\hat{a}$, $\jmath$ and $a$
so I want to manually sort it into $a$, $\hat{a}$, $\check{a}$, $\gamma$ and $\jmath$ as an example.

Best Answer

You can append numbers after the letter s, starting with the second item:

\nomenclature[a]{PDF}{Probability Density Function}
\nomenclature[s3]{$\gamma$}{Phase noise}
\nomenclature[s4]{$\jmath$}{Imaginary unit}
\nomenclature[s]{$a$}{Vector of unknowns}
\nomenclature[s1]{$\hat{a}$}{Vector of floats}
\nomenclature[s2]{$\check{a}$}{Vector of fixed}

For example, with

\documentclass{article}

\usepackage{nomencl}
\usepackage{ifthen}

\renewcommand{\nomgroup}[1]{
 \ifthenelse{\equal{#1}{A}}{\item[\bfseries\sffamily\large{List of Abbreviations}]}{
 \ifthenelse{\equal{#1}{S}}{\item[\bfseries\sffamily\large{List of Symbols}]}{}}
}

\makenomenclature

\begin{document}

\printnomenclature
\clearpage

\[a\gamma\jmath\hat{a}\check{a}\]

\nomenclature[a]{PDF}{Probability Density Function}
\nomenclature[s3]{$\gamma$}{Phase noise}
\nomenclature[s4]{$\jmath$}{Imaginary unit}
\nomenclature[s]{$a$}{Vector of unknowns}
\nomenclature[s1]{$\hat{a}$}{Vector of floats}
\nomenclature[s2]{$\check{a}$}{Vector of fixed}

\end{document} 

you will have

enter image description here

P.S.

If you have more than 10 items, append 01, 02, ..., instead of 1, 2, ... ; 001, 002, ... if you have more than 100 items