词汇表问题

词汇表问题

我有以下运行良好的代码:

\documentclass[10pt,a4paper]{report}
\usepackage[paper=a4paper,twoside=true,lmargin=2.5cm,rmargin=2.5cm, tmargin=2.5cm, bmargin=2.5cm, bindingoffset=0cm]{geometry}

\usepackage[nonumberlist, toc]{glossaries}

\makeglossaries

\newglossaryentry{smr}{name=SMR, description={Steam methane reforming}}
\newglossaryentry{x}{name=x, description={Percentage of Cerium in $ Ce_{x}Zr_{1-x}O_{2} $}}
\newglossaryentry{op}{name={OP},description={Oh Porra!}}

\begin{document}

\pagestyle{plain}

\pagenumbering{roman}

\tableofcontents
\cleardoublepage %for openright
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\cleardoublepage %for openright
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables


\cleardoublepage
\printglossaries

\chapter{Introduction}
\label{chapter:Introduction}

\section{Motivation}
\label{section:motivation}
%Relevance of the subject...

The production of hydrogen has been growing and one of the reasons is the fact that hydrogen has a key role in the future production of sustainable energy, fuel cells which eliminate toxic emissions and have higher efficiency than internal combustion engines for converting chemical energy of the fuel to electrical energy. Although, it's important to mention that the bigger source for the production of hydrogen is fossil fuels. The most used method is the steam methane reforming (SMR), that uses methane ($ \mathrm{CH_{4}} $) which comes from natural gas.

\end{document}

然后我执行 makeindex 并出现:

这是 makeindex,版本 2.15 [MiKTeX 2.9 64 位](kpathsea + 泰语支持)。扫描样式文件 ./Teste.ist................................已完成(重新定义了 29 个属性,忽略了 0 个)。扫描输入文件 Teste.glo...已完成(接受 0 个条目,拒绝 0 个条目)。Teste.gls 中未写入任何内容。成绩单已写入 Teste.ilg。

在此之后,我运行我的文件,但词汇表仍然没有出现,我不知道我做错了什么。

答案1

如果不使用\gls{...}应该在适当位置显示的特定条目或\glsaddall(对于不可见的添加)则词汇表将为空。

确保makeglossaries在编译后运行脚本,并在脚本之后重新编译(最多两次)!

无关:我使用mhchem包和\ce命令来为显示化学式提供更好的支持。

\documentclass[10pt,a4paper]{report}
\usepackage[paper=a4paper,twoside=true,lmargin=2.5cm,rmargin=2.5cm, tmargin=2.5cm, bmargin=2.5cm, bindingoffset=0cm]{geometry}
\usepackage[version=4]{mhchem}
\usepackage[nonumberlist, toc]{glossaries}

\makeglossaries

\newglossaryentry{smr}{name=SMR, description={Steam methane reforming}}
\newglossaryentry{x}{name=x, description={Percentage of Cerium in \ce{Ce_{x}Zr_{1-x}O2}}}
\newglossaryentry{op}{name={OP},description={Oh Porra!}}

\begin{document}

\pagestyle{plain}

\pagenumbering{roman}

\glsaddall

\tableofcontents
\cleardoublepage %for openright
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\cleardoublepage %for openright
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables


\cleardoublepage
\printglossaries

\chapter{Introduction}
\label{chapter:Introduction}

\section{Motivation}
\label{section:motivation}
%Relevance of the subject...

The production of hydrogen has been growing and one of the reasons is the fact that hydrogen has a key role in the future production of sustainable energy, fuel cells which eliminate toxic emissions and have higher efficiency than internal combustion engines for converting chemical energy of the fuel to electrical energy. Although, it's important to mention that the bigger source for the production of hydrogen is fossil fuels. The most used method is the steam methane reforming (SMR), that uses methane (\ce{CH4}) which comes from natural gas.

\end{document}

在此处输入图片描述

相关内容