[Tex/LaTex] Ordering Glossary in ToC before another entry

glossariestable of contents

I'm having difficulties getting my glossary to show up in the right place in my table of contents. It needs to come before the Acknowledgements and be in the same font type as the List of Figures etc.

\documentclass[12pt]{report}
\pagestyle{plain}

\usepackage[acronym,toc]{glossaries}  %Allows creation of a glossary page
\makeglossaries
\newglossaryentry{Ppump}
 {
  name=$P_{Pump}$,
  description={Pump wavelength (W)}
 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         Begin document              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{roman}

\doublespacing
\include{abstract}
\include{table_of_contents}
\singlespacing
\include{acknowledgements}

\end{document}

And for additional info, this is the code for my ToC (table_of_contents.tex).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           Sets up Table of Contents            %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents

\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables

\addcontentsline{toc}{section}{Glossary of Terms}
\printglossaries

\newpage
\addcontentsline{toc}{section}{Acknowledgements}

I am working on my thesis, so I do have quite a few .tex files for the different sections to make debugging easier (at least for me) as most of them are just different chapters then I can include them into the main document later. Anyways, if this question has already been asked, can someone please refer me to the link?

Best Answer

You are currently adding the glossary to the table of contents twice. The first time is when you add the contents line manually. The next is when you issue \printglossaries having passed the toc option to glossaries.

Method 1

Don't pass toc to glossaries:

\documentclass[12pt]{report}
\usepackage{filecontents}
\begin{filecontents}{table_of_contents.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           Sets up Table of Contents            %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents

\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables

\addcontentsline{toc}{section}{Glossary of Terms}
\printglossaries

\newpage
\addcontentsline{toc}{section}{Acknowledgements}
\end{filecontents}
\begin{filecontents}{abstract.tex}
    abstract
\end{filecontents}
\begin{filecontents}{acknowledgements.tex}
    acknowledgements
\end{filecontents}

\pagestyle{plain}

\usepackage[acronym]{glossaries}  %Allows creation of a glossary page
\makeglossaries
\newglossaryentry{Ppump}
 {
  name=$P_{Pump}$,
  description={Pump wavelength (W)}
 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         Begin document              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{roman}

\include{abstract}
\include{table_of_contents}
\include{acknowledgements}

\gls{Ppump}

\begin{figure}
    my figure
    \caption{exciting figure}
\end{figure}
\begin{table}
    \begin{tabular}{cc}
        a   &   table
    \end{tabular}
  \caption{exciting table}
\end{table}

\end{document}

Manual addition

Method 2

Configure toc to behave as you wish:

\documentclass[12pt]{report}
\usepackage{filecontents}
\begin{filecontents}{table_of_contents.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           Sets up Table of Contents            %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents

\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables

\clearpage
\printglossary[title={Glossary of Terms}]

\newpage
\addcontentsline{toc}{section}{Acknowledgements}
\end{filecontents}
\begin{filecontents}{abstract.tex}
    abstract
\end{filecontents}
\begin{filecontents}{acknowledgements.tex}
    acknowledgements
\end{filecontents}

\pagestyle{plain}

\usepackage[acronym, toc, section=section]{glossaries}  %Allows creation of a glossary page
\makeglossaries
\newglossaryentry{Ppump}
 {
  name=$P_{Pump}$,
  description={Pump wavelength (W)}
 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         Begin document              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{roman}

\include{abstract}
\include{table_of_contents}
\include{acknowledgements}

\gls{Ppump}

\begin{figure}
    my figure
    \caption{exciting figure}
\end{figure}
\begin{table}
    \begin{tabular}{cc}
        a   &   table
    \end{tabular}
  \caption{exciting table}
\end{table}

\end{document}

Configure automatic addition