词汇表不会显示在“documentclass”书中

词汇表不会显示在“documentclass”书中

因此,我注意到这是一种反复出现的问题,尽管我搜索并尝试了很多方法,但我的词汇表根本不会出现在我的 pdf 上。

现在,我只想说我对 LaTeX 还很陌生,目前正在使用 Overleaf 作为我的终端。

你们可能注意到我在瑞典斯德哥尔摩的 KTH 学习,我们使用我们自己的 kth-mag.cls,它非常庞大,我从来没有花时间真正浏览过它,如果你需要关于它上面的信息,请告诉我!

最后我很确定它是 documentclass 书,因为他们使用“mainmatter”。

任何帮助都是宝贵的!

    \documentclass[a4paper,11pt,twoside]{kth-mag}
    \usepackage[acronym]{glossaries}
    %\glsdisablehyper
    \usepackage{textcomp}
    \usepackage[table]{xcolor}
    \usepackage[hidelinks]{hyperref}
    \usepackage{todonotes}
    \usepackage{lmodern}
    \usepackage{amsmath}
    \usepackage{amsthm}
    \usepackage{url}
    \usepackage[swedish,english]{babel}
    \usepackage{modifications}
    \usepackage{multirow}
    \usepackage{textcomp}
    \usepackage{listings}
    \usepackage{color}
    \usepackage{amssymb}
    \usepackage{dirtree}
    \usepackage{array}
    \usepackage{pdfpages}
    \usepackage{longtable}
    \usepackage{biblatex}
    \usepackage{csquotes}
    \usepackage{graphicx}

    \addbibresource{references.bib}

    \extrafloats{1000}

    % ---------- Abbreviations ----------
    \newacronym{ny}{NY}{New York}
    \newacronym{la}{LA}{Los Angeles}
    \newacronym{un}{UN}{United Nations}
    % -----------------------------------

    % ---------- Nomenclature ----------
    \newglossaryentry{angelsperarea}{
      name = $a$ ,
      description = The number of angels per unit area,
    }
    \newglossaryentry{numofangels}{
      name = $N$ ,
      description = The number of angels per needle point
    }
    \newglossaryentry{areaofneedle}{
      name = $A$ ,
      description = The area of the needle point
    }
    % ----------------------------------

    \makeglossaries

    \title{Title goes here}

    \subtitle{Subtitle goes here}
    \foreigntitle{Title in Swedish goes here}

    \author{Student1\\Student2}
    \date{\today}
    \blurb{Bachelor's Thesis at ITM\\Supervisor: Supervisor goes here \\ Examiner: Examiner goes here}
    \trita{TRITA xxx yyyy-nn}

    \begin{document}
    \frontmatter
    \pagestyle{empty}
    \removepagenumbers
    \maketitle
    \selectlanguage{english}


    \clearpage
    \begin{abstract}

    Write the abstract here.

    \end{abstract}
    \clearpage
    \begin{foreignabstract}{swedish}

    Abstract in Swedish goes here.

    \end{foreignabstract}
    \clearpage

    \chapter*{Acknowledgements}

    I would like to thank...

    \clearpage
    \tableofcontents*
    \clearpage
    \listoffigures*
    \clearpage
    \listoftables*

    \printglossary[type=\acronymtype,title=Abbreviations]

    \printglossary[title=Nomenclature]

    \mainmatter
    \pagestyle{newchap}

    \chapter{Introduction}

答案1

将您的代码转换为 MWE 并执行此操作,pdflatex > makeglossaries > pdflatex > pdflatex您将在 pdf 中获得词汇表。

请注意添加\glsaddall 列出所有条目。

A

b

% !TeX TS-program = pdflatex 

\documentclass[a4paper,11pt,twoside]{book}
\usepackage[acronym]{glossaries}

% ---------- Abbreviations ----------
\newacronym{ny}{NY}{New York}
\newacronym{la}{LA}{Los Angeles}
\newacronym{un}{UN}{United Nations}
% -----------------------------------

% ---------- Nomenclature ----------
\newglossaryentry{angelsperarea}{
name = $a$ ,
description = The number of angels per unit area,
}
\newglossaryentry{numofangels}{
name = $N$ ,
description = The number of angels per needle point
}
\newglossaryentry{areaofneedle}{
name = $A$ ,
description = The area of the needle point
}
% ----------------------------------

\makeglossaries

\title{Title goes here} 

\glsaddall %  to list all entries <<<<<

\begin{document}
    \frontmatter
    \pagestyle{empty}
    
    \chapter*{Acknowledgements}
    
    I would like to thank...
    
    \printglossary[type=\acronymtype,title=Abbreviations]
    
    \printglossary[title=Nomenclature]
    
    \mainmatter
    
    \chapter{Introduction}

\end{document}

相关内容