# Glossary as section and its acronyms as chapter (glossaries package)

I am currently finishing my work on my bachelor thesis. I have one issue left, that I did not manage to fix myself. Again it is related to the glossaries package. The problem occurred when I had to move my glossary into the appendix.

Before showing you my MWE I'd like to explain how I am using the glossary. Beside the glossary entries it does also manage my acronyms. Acronyms shall be included before the thesis and therefore printed as chapter. Thats working fine. The glossary is part of of the appendix. Therefore it needs to become a section.

I found some questions on tex.stackexchange that are comparable. But none of those do use the acronyms: glossary as appendix or section numbering for glossary. Both presented solutions have the drawback that my acronyms become a section as well.

Is it possible to print the acronyms as chapter and the glossary as section? If this is not possible I probably have to put the glossary at last. This way it would not damage the appendix as much as it does currently.

here follows my minimal working example:

\documentclass[12pt]{scrreprt}
\usepackage[twoside, outer=4cm, inner=2cm, bottom=2.5cm, top=3.5cm]{geometry}
\usepackage[ngerman,english]{babel}
\usepackage{lipsum}

\usepackage[utf8]{inputenc}
\automark[section]{chapter}
\ofoot*{ }      % overwrite page number in footer

%---------------- glossary -----------------------------
\usepackage[acronym]{glossaries}
\makeglossaries

\newglossaryentry{apig}{
name=Application Programming Interface,
description={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}
}

%----------------- document -----------------------------
\begin{document}

\selectlanguage{english}

\tableofcontents

%\phantomsection
\printglossary[type=\acronymtype, title=Table of Acronyms, toctitle=Table of Acronyms]

\chapter{Introduction}
\acrfull{api} are ... The ... \Gls{apig} is used to ...
\lipsum[1]

\section{a example section}
\lipsum[2]

% ----------------- appendix -----------------------
\appendix

\cleardoublepage
% change numbering etc. \pagenumbering{Roman}

\chapter{appendix}
\label{ch:appendix}

%\phantomsection
\printglossary[title=Glossary, toctitle=Glossary]

% following sections are actually included through \include but thats not the issue
\section{first section in appendix}
\lipsum[2-6]

\section{second section in appendix}
\lipsum[6-9]

\section{third section in appendix}
\lipsum[9-11]

\end{document}


I am generating the document using pdflatex -> makeglossaries -> pdflatex (-> pdflatex if neccessary), using TexLive 2020.20210202-3 installed via debian repository.

A solution is create a section \section{Glossary}, then issue \printglossary with no title, and suppress the new page he wanted to start by locally nullifying \clearpage.

Lines added or changes are marked with <<<<<<

% !TeX TS-program = pdflatex

\documentclass[12pt]{scrreprt}
\usepackage[twoside, outer=4cm, inner=2cm, bottom=2.5cm, top=3.5cm]{geometry}
\usepackage[ngerman,english]{babel}
\usepackage{lipsum}

\usepackage[utf8]{inputenc}
\automark[section]{chapter}
\ofoot*{ }      % overwrite page number in footer

%---------------- glossary -----------------------------
\usepackage[acronym]{glossaries}
\makeglossaries

\newglossaryentry{apig}{
name=Application Programming Interface,
description={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}
}

%----------------- document -----------------------------
\begin{document}

\selectlanguage{english}

\tableofcontents

%\phantomsection
\printglossary[type=\acronymtype, title=Table of Acronyms, toctitle=Table of Acronyms]

\chapter{Introduction}
\acrfull{api} are ... The ... \Gls{apig} is used to ...
\lipsum[1]

\section{a example section}
\lipsum[2]

% ----------------- appendix -----------------------
\appendix

\cleardoublepage
% change numbering etc. \pagenumbering{Roman}

\chapter{appendix}
\label{ch:appendix}

%\phantomsection

\renewcommand{\clearpage}{} % clearpage does nothing
\printglossary[title=\normalsize\vspace*{-6\baselineskip}, toctitle=] % changed <<<<<<<<<<<
\lipsum[2-6] % test that pagebreak will work with longer glossaries
\endgroup

% following sections are actually included through \include but thats not the issue
\section{first section in appendix}
\lipsum[2-6]

\section{second section in appendix}
\lipsum[6-9]

\section{third section in appendix}
\lipsum[9-11]

\end{document}