# LyX and Nomenclatures

I'm using LyX and trying to use the `nomenclature` package to insert a bunch of acronyms into my document.

I've inserted a Nomenclature table (`Insert` -> `List/TOC` -> `Nomenclature`).

I've then created a Nomenclature entry (`Insert` -> `Nomenclature entry`), and I can insert one fine.

And I've also just figured out how to insert another one - you just delete the old text and enter in new details. It's not the most intuitive, and I would have thought LyX could supply you with a list of previously used acronyms to reinsert, but ah well.

However, how do I get the actual acronyms to print the text? As it is, I have to type in both the text I want displayed, and the acronym entry. I'm fairly certain there's an easier way, but I'm not sure if I can do it within LyX or I have to use LaTeX directly?

-
I am no LyX expert, but I know that `nomencl` uses `makeindex` to sort and generate the List of Nomenclatures. In the `nomencl` documentation it states `makeindex <filename>.nlo -s nomencl.ist -o <filename>.nls`. It is `<filename>.nls` that is used by `\printnomenclature` to actually typeset the List of Nomenclatures. Have you done something similar to this in LyX? Are you able to? – Werner Oct 10 '11 at 1:35

This has nothing to do with LyX in the first place, it is just `nomencl`’s standard behaviour. The `\nomenclature` command just stores the entry for the list, but it does not print any text. However, you can redefine the `\nomenclature` command in order to print the text as well. You could, for instance, put the following in the preamble of your document:
``````\let\nomenclOrig\nomenclature
The first line stores the `\nomenclature` command in `\nomenclOrig`. This is necessary, since we have to redefince the `\nomenclature` command. This is done in the second line. Since the `\nomenclature` command has two mandatory arguments and one optional argument, we have to specify 3 arguments (the `[3]` bit). The optional argument has no standard value (the `[]` bit). Then we print the second argument (which is the first mandatory argument, since the optional argument is always `#1`) as normal text and use the original command that we have stored in `\nomenclOrig`.
I tried this with LyX, without problems. Note, though, that the two lines will give an error in a document without a nomenclature entry or list, because then LyX will not load the `nomencl` package and thus the `\renewcommand` will throw an error.