TransWikia.com

How to display unique nomenclature parameters?

TeX - LaTeX Asked by JChat on March 2, 2021

I am using the nomenclature package to define nomenclatures in various chapters of a thesis. I am new to using this package and doing this using e.g.

nomenclature[z-ANN]{ANN}{Artificial Neural Network}. 

However, the same term may occur in different chapters- as (unintentionally), I have defined some terms more than once and as a result, they are appearing multiple times in the main thesis document.
The nomenclatures are displayed using printnomenclature.

Is there a way to only display the unique nomenclature contents (e.g. ANN is only displayed once in the main nomenclature, even though it may have been defined multiple times. Thanks

EDIT- Turns out that there is a simple way of doing this with the acro package!

One Answer

Not a solution with the nomencl package but an alternative using the acro package (as per request in a comment to the question): acro allows the creation of “local” list of acronyms which only list the acronyms that were used in between two uses of acbarrier. In addition a list of all acronyms can be created. This way there is no need to define acronyms mutiple times.

printacronyms % complete list
acbarrier
...
printacronyms[local] % local list
acbarrier
...
printacronyms[local] % another local list
acbarrier

These barriers can be called automatically, for example by adding them to the section command. The example below demonstrates this using preto (provided by the etoolbox package).

documentclass{article}

usepackage{acro}
acsetup{
  barriers/use = true ,
  barriers/reset = true
}

newcommandprintsectionacronyms[1]{%
  printacronyms[local,heading=none,preamble=subsection{Acronyms to Section #1}]
}

DeclareAcronym{ANN}{
  short = ANN ,
  long = Artificial Neural Network
}
DeclareAcronym{xx}{
  short = xx ,
  long = just a test
}
DeclareAcronym{yy}{
  short = yy ,
  long = another test
}

usepackage{etoolbox}
% make every section a barrier:
pretosection{acbarrier}

begin{document}

printacronyms[name=All Acronyms in the Document]

section{Foo}
subsection{Foo Subsection}
ac{xx} and ac{ANN}

printsectionacronyms{Foo}

section{Bar}
subsection{Bar Subsection}

ac{ANN} and text

printsectionacronyms{Bar}

section{Baz}
subsection{Baz Subsection}

ac{xx} and ac{yy}

printsectionacronyms{Baz}

end{document}

enter image description here

Correct answer by cgnieder on March 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP