[Tex/LaTex] How to create both list of abbreviations and list of nomenclature using nomencl package

acronymsnomenclaturesubdividing

I have searched for the whole day online, but all the threads indicate only realizing one of the lists by using nomencl package. I want to create both list of abbreviations AND list of nomenclature using nomencl package. How do I differ two \printnomenclature so that LaTeX could separate them clearly?

Best Answer

I'm not aware of a way to do this with nomencl. However, there are other packages which can be used. I'll give two examples, one for my package acro and one for glossaries.

  1. acro

The acro package allows to assign acronyms to a class and print lists for each class (also for combined classes...). This fact can be used for the task. Entries are defined with the following syntax:

    \DeclareAcronym{<ID>}{
      short = <short> ,
      long  = <long> ,
      class = <class>
    }

Here is a full example:

    \documentclass{article}
    \usepackage{acro}
    
    % probably a good idea for the nomenclature entries:
    \acsetup{first-style=short}
    
    % class `abbrev': abbreviations:
    \DeclareAcronym{ny}{
      short = NY ,
      long  = New York ,
      class = abbrev
    }
    \DeclareAcronym{la}{
      short = LA ,
      long  = Los Angeles ,
      class = abbrev
    }
    \DeclareAcronym{un}{
      short = UN ,
      long  = United Nations ,
      class = abbrev
    }
    
    % class `nomencl': nomenclature
    \DeclareAcronym{angelsperarea}{
      short = \ensuremath{a} ,
      long  = The number of angels per unit area ,
      sort  = a ,
      class = nomencl
    }
    \DeclareAcronym{numofangels}{
      short = \ensuremath{N} ,
      long  = The number of angels per needle point ,
      sort  = N ,
      class = nomencl
    }
    \DeclareAcronym{areaofneedle}{
      short = \ensuremath{A} ,
      long  = The area of the needle point ,
      sort  = A ,
      class = nomencl
    }
    
    \begin{document}
    
    \ac{ny}, \ac{la} and \ac{un} are abbreviations whereas
    \ac{angelsperarea}, \ac{numofangels} and \ac{areaofneedle} are part of the
    nomenclature
    
    \printacronyms[include=abbrev,name=Abbreviations]
    
    \printacronyms[include=nomencl,name=Nomenclature]
    
    \end{document}

enter image description here

  1. glossaries

The glossaries package is much more powerfull. You can define as many glossaries as you like. Here we can use the fact that a glossary for acronyms is already defined. Similar to nomencl it requires you to run a script to sort the entries. If your file is called file.tex this is usually done by calling

    makeglossaries file

from the command line. Details can be found in the user manual (page 26, section 1.3.3).

The full example:

    \documentclass{article}
    \usepackage{longtable}
    \usepackage[acronym]{glossaries}
    
    % abbreviations:
    \newacronym{ny}{NY}{New York}
    \newacronym{la}{LA}{Los Angeles}
    \newacronym{un}{UN}{United Nations}
    
    % nomenclature:
    \newglossaryentry{angelsperarea}{
      name = $a$ ,
      description = The number of angels per unit area,
    }
    \newglossaryentry{numofangels}{
      name = $N$ ,
      description = The number of angels per needle point
    }
    \newglossaryentry{areaofneedle}{
      name = $A$ ,
      description = The area of the needle point
    }
    
    \makeglossaries
    \begin{document}
    
    \gls{ny}, \gls{la} and \gls{un} are abbreviations whereas
    \gls{angelsperarea}, \gls{numofangels} and \gls{areaofneedle} are part of the
    nomenclature
    
    \printglossary[type=\acronymtype,title=Abbreviations]
    
    \printglossary[title=Nomenclature]
    
    \end{document}

enter image description here