Page LayoutShow glossaries as chapter in text but show as sections in contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Oleiro
Posts: 2
Joined: Thu Oct 04, 2018 12:02 pm

Show glossaries as chapter in text but show as sections in contents

Post by Oleiro »

Hello everyone!

I am using the glossaries package to create two different glossaries.

Code: Select all

\newglossary*{Abbs}{List of Abbreviations}
\newglossary*{ICPs}{List of Institutions, Companies \& Policies}
I am trying to display them just like the list of figure or list of tables within the document. So show them in the same style as a chapter and start on the right page. However, I would like them to be displayed in the style of a section in the contents. So exactly as when I use:

Code: Select all

\addcontentsline{toc}{section}{\listfigurename}
\listoffigures
The way I have glossaries in the preambel implemented is the following:

Code: Select all

\usepackage[nogroupskip, 
						nonumberlist,
						toc,
						%section=section,
						nopostdot]{glossaries}
And then I call the glossaries in the standard way:

Code: Select all

\printnoidxglossaries
When I use "section=section" it shows the two lists correctly in the contents, however, they are not shown properly in the document. When I comment it out, the lists are shown properly in the document but not in the contents.


How can I have the chapter style in the document but the section style in the contents for both glossaries?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Show glossaries as chapter in text but show as sections in contents

Post by kaiserkarl13 »

Do you actually want the glossaries as sections, or is it more that you want them as unnumbered chapters? It would be weird to have a chapter-level entity (such as a glossary) as a subsection of the previous chapter, but if that's what you want...try this:

Code: Select all

\documentclass{report}
\usepackage[nonumberlist,toc,nopostdot,section=section]{glossaries}
\makeatletter
\renewcommand*{\@@glossarysec}{section}%
\makeatother

\makenoidxglossaries
\newglossary*{Abbs}{List of Abbreviations}
\newglossary*{ICPs}{List of Institutions, Companies, and Policies}
\newglossaryentry{abbr}{name={Toodles},description={Howdy}}
\newglossaryentry{company}{name={Big Corporation},description={Blah}}
\begin{document}
\tableofcontents
\chapter{My chapter}
\section{Its first section}
Here's my \gls{abbr} term.
\section{Its second section}
Here's another \gls{company} entry.
\printnoidxglossaries
\end{document}
Oleiro
Posts: 2
Joined: Thu Oct 04, 2018 12:02 pm

Show glossaries as chapter in text but show as sections in contents

Post by Oleiro »

Hey kaiserkarl13,

Thanks for your reply. Maybe I was a bit unclear. I don't want them as actual sections but they are supposed to have the same look as the one that you get from using \listoffigures or \listoftables.

I have tried a very basic approach by using \addcontentsline. Here is the code

Code: Select all

\tableofcontents

\addcontentsline{toc}{section}{\listtablename}
\listoftables 
	
\addcontentsline{toc}{section}{\listfigurename}
\listoffigures
\cleardoublepage
	
\addcontentsline{toc}{section}{List of Abbreviations}
\printnoidxglossaries
\addcontentsline{toc}{section}{List of Institutions, Companies \& Policies}
This gives me almost the desired result but obviously the page number of "List of Institutions..." is wrong.

I attached an image of the look that I need and of the look that I get when I simply use \printnoidxglossaries.
Attachments
What I do not want.png
What I do not want.png (14.79 KiB) Viewed 5318 times
What I want.png
What I want.png (26.74 KiB) Viewed 5318 times
Post Reply