I'm using nomencl with a custom *.ist file. I found the required code snippets in various posts, I combined them to fit my needs, but unfortunately I never really understood properly what I was doing, especially for the 'style'-code between \makeatletter and \makeatother.

MikTex 2.9
TeXnicCenter 2.02

Problem Description

Now the output is almost what I would like, but each nomgroup has the same subheader, Symbol - Description - Unit (see example screenshot below). Where the Unit is mandatory for the Constants group, it is undesired for Acronyms or Superscripts groups. Therefore I would like to have a different subheader per group.

A manual workaround that helped so far is

  1. compiling several times until everything is ok
  2. open the *.nls file, searching the Unit and manually removing/changing it
  3. run the final compilation with the tweaked *.nls

Obviously this manual intervention needs to be repeated everytime I compile the document, since the *.nls is regenerated everytime.

My question(s)

  1. How/if I can use a boolean variable to trigger the appearance of Unit?
  2. How/if I can use a variable (maybe in the nomgroup definition?) that is placed at the position of Unit in the subheader?

My secondary question

I found so many MWEs for nomencl, requiring no additional packages but none does work for me neither on mine nor on my colleagues computer. The packages called in my MWE are required to enable use of nomencl for me (even for supersimple MWEs), especially \longtable, \nomentbl, \booktabs, of course \etoolbox is only required for more advanced modifications.



    % define and format nomenclature groups
      \ifstrequal{#1}{L}{Latin Symbols}{%
      \ifstrequal{#1}{G}{Greek Symbols}{%

    % nomenclature style
        #1\nom@verb\@tempa @{\nom@verb\@tempa}&%
        \begingroup\nom@verb\@tempb\endgroup &\begingroup#4\endgroup&%



    \nomenclature[l]{$l$}{Length No 1}{m}
    \nomenclature[l]{$l$}{Length No 2}{m} 
    \nomenclature[A]{$a$}{a test}{} 
    \nomenclature[S]{0}{Standard State}{} 
    \nomenclature[C]{$F$}{Faraday Constant}{96485\,As\,mol\textsuperscript{-1}} 


The *.ist file

actual '@'
quote '%'
delim_0   ""
delim_1   ""
delim_2   ""
item_0    ""
delim_t   " \\\\\n"
line_max  1000
heading_prefix   "\\multicolumn{4}{l}{\\nomgroup{"
heading_suffix   "}} \\\\\n\\nopagebreak\\\\*\n\\nopagebreak 
\\multicolumn{1}{l}{\\bfseries Symbol} & \\multicolumn{1}{l}{\\bfseries Description} & & %
\\multicolumn{1}{l}{\\bfseries Unit} \\\\ \\toprule \n\\nopagebreak"
headings_flag       1
group_skip        "\\\\*"
preamble "\n\\begin{thenomenclature}\n%
\\bfseries Symbol & \\bfseries Description & & \\bfseries%
Unit \\\\ \\toprule \\endhead"
postamble "\n\\end{longtable}\n\n\\end{thenomenclature}\n"
keyword "\\nomenclatureentry"

The final output (without manual tweaks of *.nls file) looks like: enter image description here

  • Your secondary question: You need nomentbl and longtable because you want your nomenclature in tabular form instead of a list form. And that probably is because you want to include the unit. The nomencl package has other solutions for these but these may be a little bit more complicated. And you have booktabs because you want a nice layout in the table. – Piet van Oostrum Dec 16 '16 at 20:48

In your .ist file, replace Unit with \\Unit.

In your .tex file, replace the \nomgroup definition with

% define and format nomenclature groups 
  \ifstrequal{#1}{L}{Latin Symbols}{%
  \ifstrequal{#1}{G}{Greek Symbols}{%

Then run makeindex and (pdf)latex again.

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.