Make nomenclature sort math correctly

Just add to all the entries that have math an ASCII version for sorting:

% arara: pdflatex
% arara: nomencl
% arara: pdflatex

\documentclass[oneside,paper=a4,fontsize=12pt,english]{scrreprt}
\usepackage[noprefix]{nomencl}
\makenomenclature

\begin{document}

\printnomenclature
\nomenclature[1a]{\(a\)}{Semimajor axis}
\nomenclature[1v]{\(v\)}{Velocity}
\nomenclature[1q]{\(\dot{q}\)}{Heat flux}
\nomenclature[2rho]{\(\rho\)}{Density}

Lorem ipsum.
\end{document}

enter image description here

With arara you don't need to remember the command for producing the .nls file. :)


To prevent symbols from being sorted by surrounding commands, such as \dot{q}, append the prefix with the math mode of the symbol without any additional commands like so:

\nomenclature[1\(q\)]{\(\dot{q}\)}{Heat flux}

In the full example we see that this additional syntax is only required for the single problem variable:

Output

\documentclass[oneside,paper=a4,fontsize=12pt,english]{scrreprt}
\usepackage[noprefix]{nomencl}
\makenomenclature
\begin{document}
    \printnomenclature
    \nomenclature[1]{\(a\)}{Semimajor axis}
    \nomenclature[1]{\(v\)}{Velocity}
    \nomenclature[1\(q\)]{\(\dot{q}\)}{Heat flux}
    \nomenclature[2]{\(\rho\)}{Density}
    % makeindex.exe Test.nlo -s nomencl.ist -o Test.nls
    Lorem ipsum.
\end{document}