1

Page breaks right after glossary letter header. I would like the header to go to the new page. Answers to already posted question of similar title did not help me. Here is my MWE:

\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage[backref=page]{hyperref}
\usepackage{blindtext}
\usepackage[nopostdot]{glossaries}
\setglossarystyle{altlisthypergroup}
\glstoctrue
\makenoidxglossaries
\renewcommand{\glssymbolsgroupname}{\#}
\renewcommand{\glslistnavigationitem}[1]{\item[#1]\strut\par\bigskip}
\renewcommand{\glsseelastsep}{\space and\space} 

\newglossaryentry{aterm}{
    name={aterm},
    description={\blindtext}
}

\newglossaryentry{bterm}{
    name={bterm},
    description={An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. }
}

\newglossaryentry{cterm}{
    name={cterm},
    description={\blindtext}
}

\begin{document}
\mainmatter
\blindtext \gls{aterm}
\blindtext \gls{bterm}
\blindtext \gls{cterm}

\printnoidxglossaries

\end{document}
  • Answer to similar question is given in tex.stackexchange.com/questions/376312/… . This answer does not work with altlisthypergroup (or any listgroup) style. Therefore, adding \renewcommand*{\glsgroupheading}[1]{\glsgetgrouptitle{#1}\nopagebreak} does not work with listgroup styles, However, it is interesting that \renewcommand*{\glsgroupheading}[1]{\glsgetgrouptitle{#1}\pagebreak} does work with listgroup styles and it adds pagebreak after each heading. – vbobanac Mar 15 at 18:13
0

As a pragmatic solution, I added an empty glossary entry with suitably chosen sort name, so that the header in question is moved to the next page. Downside is that this adds an empty line to the bottom of the page, but this solution is the best I managed to come up with.

\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage[backref=page]{hyperref}
\usepackage{blindtext}
\usepackage[nopostdot]{glossaries}
\setglossarystyle{altlisthypergroup}
\glstoctrue
\makenoidxglossaries
\renewcommand{\glssymbolsgroupname}{\#}
\renewcommand{\glslistnavigationitem}[1]{\item[#1]\strut\par\bigskip}
\renewcommand{\glsseelastsep}{\space and\space}

\newglossaryentry{aterm}{
    name={aterm},
    description={\blindtext}
}

\newglossaryentry{bterm}{
    name={bterm},
    description={An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. An example to show how letter headers and group items become separated at page breaks. }
}

\newglossaryentry{cterm}{
    name={cterm},
    description={\blindtext}
}

\newglossaryentry{bu}{ %<-modified
    name={ },
    description={\pagebreak},
    sort={bu}
}

\begin{document}
\mainmatter
\blindtext \gls{aterm}
\blindtext \gls{bterm}
\blindtext \gls{cterm}
\glsadd[format=glsignore]{bu} %<-modified

\printnoidxglossaries

\end{document}

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.