[Tex/LaTex] Why acronym appears under glossary

acronymsglossariestable of contents

Here is minimum working example:

% arara: pdflatex: {action: nonstopmode}
% !arara: makeindex
% arara: bibtex
% arara: makeglossaries
% arara: pdflatex: {action: nonstopmode}
% arara: pdflatex: {action: nonstopmode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt]{article}
\usepackage[slovak,english]{babel}
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HEADER AND FOOTER
\usepackage{fancyhdr}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THIS SHOULD BE DEFINED BEFORE glossaries
% COMPILATION ERROR IF THOSE TWO LINES ARE SWAPPED
\usepackage[bookmarks]{hyperref}
\usepackage{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% WORKING
\usepackage[acronym]{glossaries}

% DOES NOT WORKING:
% Package glossaries Error: Glossary type `acronym' has not been defined. }
% \usepackage{glossaries}

% Unknown option `intoc' for package `glossaries'. \RequirePackage
% \usepackage[intoc]{glossaries}

% Package glossaries Error: Glossary type `acronym' has not been defined. }
% \usepackage[toc]{glossaries}
\makeglossaries
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% USING PICTURES
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% WHAT DOES THIS DO ???
\usepackage{titling}
\usepackage{makeidx}
\makeindex
\usepackage[margin=2.5cm]{geometry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SETTING HEADER AND FOOTER
\pagestyle{fancy}
\lhead{LHEAD}
\rhead{RHEAD}
\renewcommand{\footrulewidth}{0.4pt}% default is 0pt
\cfoot{\thepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[sort&compress,numbers,square,comma,numbers]{natbib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TABLE OF CONTENT
\usepackage[nottoc,notlot,notlof]{tocbibind}
\settocbibname{References}
%%%%%%%%%%%%%%%%%%%%
% DOES NOT WORK: CONTENTS NAME REMAINS "Contents" INSTEAD OF "Table of Contents"
\settocname{Table of Contents}
%%%%%%%%%%%%%%%%%%%%
% DOES NOT WORK: INITIAL NUMBER BELLOW FOOTER REMAINS ALWAYS THE SAME (NUMBER OF PAGES BEFORE PARTICULAR SHEET - 1)
\setcounter{page}{10}
\setcounter{secnumdepth}{10}
%%%%%%%%%%%%%%%%%%%%
% SET MAX CONTENTS DEPTH
\setcounter{tocdepth}{5}
%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand{\citefull}[1]{\citeauthor{#1}~(\citeyear{#1})~\cite{#1}}
\DeclareRobustCommand{\citefulle}[1]{[\citeauthor{#1}~(\citeyear{#1})~\cite{#1}]}
\DeclareRobustCommand{\citebegin}[1]{In \citeyear{#1} \citeauthor{#1}}
\DeclareRobustCommand{\citeaccord}[1]{According to \citeyear{#1} \citeauthor{#1}}
%%%%%%%%%%%%%%%%%%%%
\begin{document}
  \input{glossary.tex}
  \input{acronyms.tex}

  \thispagestyle{empty}
  \begin{titlepage}
    \centering
    {\scshape\LARGE University\\
                    Faculty\par}
    \vspace{5cm}
    {\huge\bfseries Thesis Name\par}
    \vspace{1.0cm}
    {\scshape\Large Thesis submitted for the degree of\\
                    Academic Degree\par}
    \vspace{2cm}
    {\Large\itshape Author\par}
    \vfill
    supervised by\par
    ~Supervisor
    \vfill
    {\large \today\par}
  \end{titlepage}
  \pagebreak
%%%%%%%%%%%%%%%%%%%%
  \thispagestyle{empty}
  \begin{doublespace}
    \cleardoublepage
    \phantomsection
    \addcontentsline{toc}{part}{Abstract}
    \selectlanguage{slovak}
    \input{abstract_svk.tex}
    \pagebreak
%%%%%%%%%%%%%%%%%%%%
    \thispagestyle{empty}
    \selectlanguage{english}
    \input{abstract_eng.tex}
    \pagebreak
%%%%%%%%%%%%%%%%%%%%
    \thispagestyle{empty}
    \renewcommand{\abstractname}{Acknowledgements}
    \begin{abstract}
      Graditude
    \end{abstract}
    \pagebreak
  \end{doublespace}
%%%%%%%%%%%%%%%%%%%%
% TABLE OF CONTENT
  \thispagestyle{empty}  
  \tableofcontents
  \pagebreak
%%%%%%%%%%%%%%%%%%%%
% LIST OF FIGURES
  \thispagestyle{empty}
  \listoffigures
  \pagebreak
%%%%%%%%%%%%%%%%%%%%
% ACRONYMS
  \thispagestyle{empty}
  \printglossary[type=\acronymtype]
  \newpage
% GLOSSARY
  \thispagestyle{empty}
  \printglossary[type=main]
  \newpage
%%%%%%%%%%%%%%%%%%%%
  \begin{doublespace}
    % This returns: "First use Coordinated Universal Time (UTC) subsequent UTC"
    First use \gls{utc} subsequent \gls{utc}

    % This returns: "First use Application Programming Interface (API) subsequent API"
    % In this example https://tex.stackexchange.com/questions/8946/how-to-combine-acronym-and-glossary there is also refernce from Acronyms to Glossary
    First use \gls{api} subsequent \gls{api}

    % Why this one appears in Glossary instead of Acronyms?
    % Why this one is shown in Glossary as "Intrusion detection and prevention systems" instead of "Intrusion Detection and Prevention Systems" (case difference)?
    % Why this returns: "First use IDPS subsequent IDPS" instead of "First use Intrusion Detection and Prevention Systems (IDPS) subsequent IDPS" ?
    First use \gls{idps} subsequent \gls{idps}

    \input{1.tex}
    \pagebreak

    \input{2.tex}
    \pagebreak

    \input{3.tex}
    \pagebreak

  \end{doublespace}
  \pagebreak
%%%%%%%%%%%%%%%%%%%%
  \bibliographystyle{unsrtnat}
  \bibliography{mendeley-13-01-29}
\end{document}

Here is glossary.tex:

\newglossaryentry{apig}{
        name={API},
        description={An Application Programming Interface (API) is a
                    particular set
                    of rules and specifications that a software program can
                    follow to access and make use of the services and
                    resources provided by another particular software
                    program that implements that API}
    }

Here is acronyms.tex:

\newacronym{utc}{UTC}{Coordinated Universal Time}


\newglossaryentry{api}{
        type=\acronymtype,
        name={API},
        description={Application Programming Interface},
        first={Application Programming Interface (API)\glsadd{apig}},
        see=[Glossary:]{apig}
        }

\newglossaryentry{idps}{
        type=\acronymtype,
        name={IDPS},
        description={Intrusion Detection and Prevention Systems},
        first={Intrusion Detection and Prevention Systems (IDPS)}
        }

As you can see I'm using arara for compilation. My goal is to have both Acronyms and Glossary in document. Questions:

  1. Regarding this line: First use \gls{idps} subsequent \gls{idps}
    Why this one appears in Glossary instead of Acronyms? Why this one is shown (in Glossary) as "Intrusion detection and prevention systems" instead of "Intrusion Detection and Prevention Systems" (case difference)? Why this returns: "First use IDPS subsequent IDPS" instead of "First use Intrusion Detection and Prevention Systems (IDPS) subsequent IDPS" as it is in 2nd and 3rd question?

  2. Regarding this line: First use \gls{api} subsequent \gls{api} In this example there is also reference from Acronyms to Glossary, why it is not working in my example?

  3. Regarding this line: First use \gls{utc} subsequent \gls{utc} Should I use \newacronym over newglossaryentry?

  4. How can I include both Acronyms and Glossary in Contents? I've tried several things (see my comments in code) but neither worked.

Thank you very much

Best Answer

Here's a minimal example which uses your acronym and glossary definitions in a minimal wrapper. Both are added to the contents and the cross-referencing seems to work fine.

glossary and acronyms

\documentclass{article}
\usepackage[acronym,toc]{glossaries}
\makeglossaries
\newglossaryentry{apig}{
  name={API},
  description={An Application Programming Interface (API) is a particular set of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API}
}
\newacronym{utc}{UTC}{Coordinated Universal Time}
\newglossaryentry{api}{
  type=\acronymtype,
  name={API},
  description={Application Programming Interface},
  first={Application Programming Interface (API)\glsadd{apig}},
  see=[Glossary:]{apig}
}
\newglossaryentry{idps}{
  type=\acronymtype,
  name={IDPS},
  description={Intrusion Detection and Prevention Systems},
  first={Intrusion Detection and Prevention Systems (IDPS)}
}
\begin{document}

  \tableofcontents

  \section{First}

  \gls{utc}

  \gls{idps}

  \gls{api}

  \section{Subsequent}

  \gls{utc}

  \gls{idps}

  \gls{api}

\printglossary
\printacronyms

\end{document}
Related Question