0

I'm new to Latex and I'm struggling on making my acronyms list show up both in a page and in the table of contents. Here the snippet of code:

\documentclass[a4paper,12pt,oneside]{book}

\usepackage[toc,acronym]{glossaries} % to
\makeglossaries
\newacronym{cnn}{CNN}{Convolutional Neural Network}
% .... other acronyms

%---- Document -----
\title{Thesis Title}
\author{Name Surname}
\date{Day Month Year}


\begin{document}

% hacking the header
\pagestyle{fancy}
\makeatletter
\renewcommand\chaptermark[1]{%
  \markboth{\MakeUppercase{%
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \@chapapp\ \thechapter. \ %
      \fi
    \fi
    #1}}{}%
}
\renewcommand\@mkboth[2]{\markboth{#1}{}}
\makeatother

%% include frontispieces and chapters
\includepdf[pages={1}]{./frontispiece/frontA4.pdf}
% If you are italian, please consider to create a "frontA4ita" version of the frontispiece and add it 
after the english one.

\setcounter{page}{1}

\frontmatter
\afterpage{\null\thispagestyle{empty}\clearpage}
\input{0a_abstract.tex}
\afterpage{\null\thispagestyle{empty}\clearpage}
\input{0a_sommario.tex} % italian abstract
\afterpage{\null\thispagestyle{empty}\clearpage}
\input{0b_acknowledgments.tex}
\afterpage{\null\thispagestyle{empty}\clearpage}
\tableofcontents
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures} % this command adds the "List of Figures" page to the 
table of content as if it was a chapter.
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}         
\glsaddall                             %after the list of tables I want to put the acronyms list
\printglossary[type=\acronymtype]  
\afterpage{\null\thispagestyle{empty}\clearpage}
\input{0c_introduction.tex} 

\mainmatter
\input{1_sota.tex} 
\input{2_background.tex}
\input{3_methodology.tex} 
\input{4_results.tex} 
\input{5_conclusions.tex} 
%% print the bibliography
%\nocite{*}
\bibliographystyle{ieeetr} % IEEE has its own bibliography style. Bibtex is the baseline bibliography engine, you can use also biber to gain control on the layout.
\bibliography{bibliography.bib}
\end{document}

and if, for example, I write "\gls{cnn}" in one of those files, the acronym shows up, but the list or the page in the toc don't...any ideas? What I'm doing wrong?

1 Answer 1

1

Compile twice, run makeglossaries.exe on your file and compile twice again.

With TeXstudio you can run makeglossaries.exe pressing [F9]. Or from a command windows in the main.tex directory execute makeglossaries main (without the file extension)

a

b

\documentclass[a4paper,12pt,oneside]{book}

\usepackage[toc,acronym]{glossaries} % to
\makeglossaries
\newacronym{cnn}{CNN}{Convolutional Neural Network}
% .... other acronyms

%---- Document -----
\title{Thesis Title}
\author{Name Surname}
\date{Day Month Year}


\begin{document}
\frontmatter
\tableofcontents
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures} % this command adds the "List of Figures" page to the 

\listoftables
\addcontentsline{toc}{chapter}{List of Tables}         
\glsaddall                             %after the list of tables I want to put the acronyms list
\printglossary[type=\acronymtype]  
\mainmatter
\chapter{1sota} 
\gls{cnn}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .