4

My university came up with the brilliant idea of determining that the front matter of a thesis must not show the page's numbers. I applied the solutions of this answer: suppress page numbers in document's front matter and it worked but for the glossaries pages.

I'm using the glossaries package for displaying lists of symbols, acronyms and abbreviations. The class I'm using is a custom class based on the book class.

Edit:

MWE

\documentclass[a4paper,10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{etoolbox}
\usepackage[nonumberlist,symbols,acronyms,abbreviations]{glossaries-    extra}
\usepackage{blindtext}

\makeglossaries
\appto\captionsenglish{%
\renewcommand*{\acronymname}{List of Acronyms}%
}
\appto\captionsenglish{%
\renewcommand*{\glssymbolsgroupname}{List of Symbols}%
}
\appto\captionsenglish{%
\renewcommand*{\abbreviationsname}{List of Abbreviations}%
}
% abbreviations:
\newabbreviation{const}{Const.}{Constitution}
% acronyms
\newacronym{LED}{LED}{Light Emitting Diode}
% symbols
\newglossaryentry{pi}{name={\ensuremath{\pi}},sort=    {pi},type=symbols,category=symbol,description={Ratio between the circumference and the radius of a circle}}

\makeatletter
\renewcommand{\pagenumbering}[1]{\gdef\thepage{\csname     @#1\endcsname\c@page}}
\makeatother

\begin{document}

\pagestyle{empty} % No page numbers
\begingroup
\frontmatter
\patchcmd{\chapter}{plain}{empty}{}{} % Patching the command so lists have no page numbers
\pagenumbering{arabic} % For showing in the index

\listoffigures % OK, page number not shown
\listoftables % OK, page number not shown

\glsaddall
\printglossaries % Don't work, the glossaries displays the page     numbers

\tableofcontents
\endgroup

\clearpage
\pagestyle{plain} % Back to the page numbering

\mainmatter

\chapter{First chapter}

\Blindtext

\chapter{Second chapter}

\Blindtext

\end{document}

Edit: to my amusement, in the MWE it works, but in the custom class, it doesn't.

  • Please don't post such fragments of code – user31729 Jul 8 '16 at 15:20
  • @ChristianHupfer I've posted the fragment to exemplify that the \patchmd solution does not work. A MWE with the custom class I am forced to use is very impractical. Any suggestion of how to do it better so? – WDiniz Jul 8 '16 at 15:23
  • You could at least post a compilable version with a regular class (say book, such that we don't have to do all from scratch! – user31729 Jul 8 '16 at 15:25
  • @ChristianHupfer Thks for the advice, I produced an MWE with the book class, but strangely, it worked as it should've. Perhaps some of the many packages loaded by the custom class may be interfering with it. Think I'll have to bear with it alone :-( – WDiniz Jul 8 '16 at 15:50
  • Such customized classes aren't useful in many cases :-( – user31729 Jul 8 '16 at 15:52
3

Each glossary uses \glossarypreamble after the heading, so you just need to redefine this to override \thispagestyle{plain} issued by \chapter:

\renewcommand{\glossarypreamble}{\thispagestyle{empty}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.