[Tex/LaTex] Give \printglossaries a section number and customize the name

chaptersglossariesindexing

When I print my glossary using \printglossaries it prints the glossary on a chapter level (at least it gives it the style of a chapter heading + it appears in the index on a chapter level). However, it doesn't get a chapter number. In the example below the result would be:
1. Content
A. First Appendix
Glossary

Does anybody know how I could give it the proper chapter number (= B. Glossary) in this case? Being able to customize the term "Glossary" on top of that would be even better.

\documentclass{article}

\usepackage{glossaries}

\newglossaryentry{sample}{name={sample},description={an example}}

\renewcommand{\glstextformat}[1]{\textit{#1}}

\begin{document}
\chapter{Content}

\gls{sample}.

\Appendix
\chapter{First Appendix}
\printglossaries

\end{document}

Thanks

Best Answer

The numbered is dealt with via the numberedsection package option. The title can be overridden using the title key in \printglossary:

\documentclass{report}

\usepackage[numberedsection]{glossaries}

\makeglossaries

\newglossaryentry{sample}{name={sample},description={an example}}

\renewcommand{\glstextformat}[1]{\textit{#1}}

\begin{document}
\chapter{Content}

\gls{sample}.

\appendix
\chapter{First Appendix}
\printglossary[title={Custom Title}]

\end{document}
Related Question