How to create both list of abbreviations and list of nomenclature using nomencl package?

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?

-
Welcome to TeX.SE! –  Vivi Dec 12 '12 at 6:27
Perhaps you can use the gloss package for the abbreviations? –  guillem Dec 12 '12 at 7:21
Have a look at glossaries, a package which is capable of dealing with multiple - well - glossaries. –  cgnieder Dec 12 '12 at 9:06
+1 for glossaries, Iused that myself, and it works great. I guess it is up to @cgnieder to make that an answer. –  mafp Dec 12 '12 at 16:36

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-classes=abbrev,name=Abbreviations]

\printacronyms[include-classes=nomencl,name=Nomenclature]

\end{document}


2. 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}


-
Forgive my ignorance, but what are those numbers in the end of each abbreviation / nomenclature entry ? –  joxnas Feb 3 at 9:14
@joxnas the page the respective acronym appeared –  cgnieder Feb 3 at 9:17

This also works (I couldn't get the above script working for a symbol list with units AND glossary..). Important is the order of lines here!

BasicFile.tex:

%Load the package
\usepackage[
nonumberlist, %do not show page numbers
acronym,      %generate acronym listing   -> Not used in this example (see line with %%% )
section]      %use section level for toc entries
{glossaries}

%Generate a list of symbols
\newglossary[slg]{symbols}{syi}{syg}{List of symbols}

%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}

%Activate glossary commands
\makeglossaries

%These commands sort the lists
%%%makeindex -s filename.ist -t filename.alg -o filename.acr filename.acn
%makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
%makeindex -s filename.ist -t filename.slg -o filename.syi filename.syg

\begin{document}

%Print the glossary
\printglossary[style=altlist,title=Glossary]

%%%%Print list of acronyms
%%%\printglossary[type=\acronymtype,style=long]

%Print list of symbols
\printglossary[type=symbols,style=long4col]
\clearpage

bla-bla \gls{h} \gls{nslats} \gls{illuminance}

\end{document}


nomenclature.tex:

%Some entries for the list of symbols
\newglossaryentry{nslats}{
name=$nslats$,
description={The number of slats},
sort=S, type=symbols, symbol=[$-$]}

\newglossaryentry{h}{
name=$h$,
description={Height},
sort=h, type=symbols, symbol=[$m$]}


glossary.tex

%Some glossary terms
\newglossaryentry{illuminance}{
name=Illuminance,
description={Light flux striking a surface, measured in Lux (lx).}
}

%%% In case you also want a list acronyms
%%%\newacronym{MS}{MS}{Microsoft}
%%%\newacronym{CD}{CD}{Compact Disc}


I don't use Perl so I type these lines directly in the command prompt after changes in any file (notice: if you didn't change anything concerning the glossary or the symbol list it is be okay to just pdflatex only once!):

pdflatex BasicFile.tex
pdflatex BasicFile.tex
makeindex -s BasicFile.ist -t BasicFile.slg -o BasicFile.syi BasicFile.syg
makeindex -s BasicFile.ist -t BasicFile.glg -o BasicFile.gls Report_Base_v6.glo
pdflatex BasicFile.tex
BasicFile.pdf

-
Welcome to TeX.sx! –  Kurt Feb 15 '13 at 13:28