防止词汇表条目在分页符处分隔字母标题和项目

防止词汇表条目在分页符处分隔字母标题和项目

词汇表信头后立即分页。我希望信头转到新页面。对已发布的类似标题问题的回答对我没有帮助。这是我的 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}

答案1

作为一个实用的解决方案,我添加了一个空的词汇表条目,并选择了合适的排序名称,这样有问题的标题就会移动到下一页。缺点是这会在页面底部添加一个空行,但这是我能想到的最好的解决方案。

\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}

相关内容