# LaTeX：添加缩写/命名列表

Mukesh Chapagain 2016-06-06 00:00:00    Mukesh Chapagain笔记

 1 2 \usepackage{nomencl} \makenomenclature

 1 2 \nomenclature{$\sigma$}{The total mass of angels per unit area} \nomenclature{NLP}{Natural Language Processing}

 1 \printnomenclature

 1 \printnomenclature[0.5in]

 1 makeindex filename.nlo -s nomencl.ist -o filename.nls

 1 2 3 pdflatex filename makeindex filename.nlo -s nomencl.ist -o filename.nls pdflatex filename

 1 \renewcommand{\nomname}{List of Abbreviations}

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 \documentclass{article}   \usepackage{nomencl} \makenomenclature   \renewcommand{\nomname}{List of Abbreviations}   \begin{document}   \printnomenclature \hfill % add blank space   NLP is a field of computer science, artificial intelligence, and linguistics concerned with the interactions between computers and human (natural) languages.   \nomenclature{NLP}{Natural Language Processing}   $\sigma$ is the eighteenth letter of the Greek alphabet, and carries the 's' sound. In the system of Greek numerals, it has a value of 200.   \nomenclature{$\sigma$}{The total mass of angels per unit area}   \end{document}

# LaTeX: Add List of Abbreviations / Nomenclature

Mukesh Chapagain 2016-06-06 00:00:00

You might need to print the list of symbols or list of abbreviations for your LaTeX document. nomencl package can be used for this purpose.

You need to load the nomencl package in the preamble of your document. The command \makenomenclature will instruct LaTeX to open the nomenclature file filename.nlocorresponding to your LaTeX file filename.tex and to write the information from your \nomenclature commands to this file.

 1 2 \usepackage{nomencl} \makenomenclature

Then, you need to define your nomenclature abbreviation and its description in your document.

 1 2 \nomenclature{$\sigma$}{The total mass of angels per unit area} \nomenclature{NLP}{Natural Language Processing}

You need to use printnomenclature macro where you want to print your nomenclature.

 1 \printnomenclature

You can also specify distance between the symbol/abbreviation and its description text.

 1 \printnomenclature[0.5in]

Finally, you need to use MakeIndex program to generate the nomenclature list. Without makeindex, the list will not be generated.

In the following command, we instruct MakeIndex to use filename.nlo as our input file, use nomencl.ist as our style file, and write output to the file filename.nls.

 1 makeindex filename.nlo -s nomencl.ist -o filename.nls

You need to build your main latex file before and after makeindex.

 1 2 3 pdflatex filename makeindex filename.nlo -s nomencl.ist -o filename.nls pdflatex filename

By default, the title of the nomenclature is Nomenclature. We can change it to our desired name with the renewcommand. Below, we have changed the title of the nomenclature to List of Abbreviations.

 1 \renewcommand{\nomname}{List of Abbreviations}

Here is the complete code to create a document with list of symbols/abbreviations:

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 \documentclass{article}   \usepackage{nomencl} \makenomenclature   \renewcommand{\nomname}{List of Abbreviations}   \begin{document}   \printnomenclature \hfill % add blank space   NLP is a field of computer science, artificial intelligence, and linguistics concerned with the interactions between computers and human (natural) languages.   \nomenclature{NLP}{Natural Language Processing}   $\sigma$ is the eighteenth letter of the Greek alphabet, and carries the 's' sound. In the system of Greek numerals, it has a value of 200.   \nomenclature{$\sigma$}{The total mass of angels per unit area}   \end{document}

Below is the pdf file generated after you compile the above LaTeX source:

You can find about other nomenclature plugins over here: http://en.wikibooks.org/wiki/LaTeX/Indexing