I am using LyX to write a report. The nomenclature is divided in groups. Within the "Roman Symbols" group the entries which start with math are sorted before all the non-math entries. See the image at the end of the question.

For example, the entry below should be sorted with the "R"s.


Starting with the second to last entry, the sorting works fine. After many correctly sorted entries (not shown in the image), the last two entries (also not shown) are out of place. They should be sorted with the "D"s. They are written below.



I have tried the solution here: Make nomenclature sort math correctly

This did not work for me. It might be because I use nomgroups. I do not know. Any ideas? Thanks.

I have written the preamble and the nomenclature entries for the file below. I am rather new to LaTeX so let me know if you need me to post more information.


% Preview source code

%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.


% the following is useful when we have the old nomencl.sty package
 breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=true]
\hypersetup{pdftitle={Title Here},
 pdfauthor={Author Here},
 pdfsubject={Subject Here},
 pdfkeywords={Keywords Here},


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

%For matlab2tex support

%For nomenclature
  \ifstrequal{#1}{R}{Roman Symbols}{%
  \ifstrequal{#1}{G}{Greek Symbols}{%
  \ifstrequal{#1}{X}{Other Symbols}{}}}}}]%



Nomenclature Entries:


%Roman Symbols (Sort as R)

%With math








\nomenclature[R]{$\left\Vert u_{i}\right\Vert $}{Ve}


\nomenclature[R]{$\left\Vert \overline{u}_{i}\right\Vert $}{Ave}




%Without Math



enter image description here


Nomenclature package pastes your prefix and entry to form the sorting label. Since $\Delta$ starts with backslash, makeindex sorts the entry \nomenclature[R]{${\Delta}Z_0$}{Lig} as R${\Delta$}, and the entry \nomenclature[R]{$D$}{Letter D} as R$D$. If you want \Delta to be sorted as D, use \nomenclature[R$D$]{${\Delta}Z_0$}{Lig} as well as \nomenclature[R$D$]{$\mathbf{C}$}{DM}, \nomenclature[R$A$]{$\tilde{A}$}{DM} etc.

In general if your math entry does not start with a letter, use R$LETTER$ as prefix.

  • Thanks for the quick and accurate response. It worked perfectly. I would up-vote your answer but I don't have enough reputation yet as I just registered this morning. – crgonzalez4611 Apr 9 '15 at 18:21
  • Well, I wrote the first version of this package long ago, so I try to answer questions about it... – Boris Apr 9 '15 at 19:13
  • It works very well for Roman symbols. However for sorting alphabetically Greek symbols, it is not evident. Do you have any recommendations? – uknown Apr 13 '20 at 13:01
  • Please see section 2.5 of the manual, where Greek letters are discussed in legth – Boris Apr 13 '20 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.