LaTeX:添加缩写/命名列表

阅读:5288

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


您可能需要打印LaTeX文档的符号列表或缩写列表。nomencl包可以用于这个目的。

您需要nomencl在文档的前导中加载包。该命令\makenomenclature将指示LaTeX打开与filename.nlo您的LaTeX文件filename.tex对应的命名文件,并将信息从您的\nomenclature命令写入此文件。


1

2

\usepackage{nomencl}

\makenomenclature


然后,您需要在文档中定义您的命名缩写及其说明。


1

2

\nomenclature{$\sigma$}{The total mass of angels per unit area}

\nomenclature{NLP}{Natural Language Processing}


您需要使用printnomenclature宏在其中打印您的命名。


1

\printnomenclature


您还可以指定符号/缩写及其描述文本之间的距离。


1

\printnomenclature[0.5in]


最后,需要使用MakeIndex程序生成命名列表。没有makeindex,不会生成列表。

在以下命令中,我们指示MakeIndex使用filename.nlo作为我们的输入文件,nomencl.ist用作我们的样式文件,并将输出写入文件filename.nls


1

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


你需要在makeindex之前和之后构建你的主要乳胶文件。


1

2

3

pdflatex filename

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

pdflatex filename


默认情况下,命名的标题是命名我们可以改变它到我们想要的名称renewcommand下面,我们将命名的标题改为List of Abbreviations


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源后生成的pdf文件:


您可以在这里找到其他命名插件:http : //en.wikibooks.org/wiki/LaTeX/Indexing

分享这个:


LaTeX: Add List of Abbreviations / Nomenclature

阅读:5288

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

Share this:


相关标签:
latex