![我的第一个词汇表页面上生成了两个“词汇表”元素](https://linux22.com/image/265078/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AA%E8%AF%8D%E6%B1%87%E8%A1%A8%E9%A1%B5%E9%9D%A2%E4%B8%8A%E7%94%9F%E6%88%90%E4%BA%86%E4%B8%A4%E4%B8%AA%E2%80%9C%E8%AF%8D%E6%B1%87%E8%A1%A8%E2%80%9D%E5%85%83%E7%B4%A0.png)
我成功生成了一个词汇表,但不知何故,我在第一个词汇表条目之前,但在词汇表标题之后,得到了一个不正常的“词汇表”元素。以下是相关的示例代码:
\documentclass[10pt,ebook,oneside,openright]{memoir}
\usepackage{graphicx}
\usepackage[scaled]{berasans}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage[toc,nonumberlist]{glossaries}
\chapterstyle{madsen}
\pagestyle{ruled}
\setsecnumdepth{subsection}
\renewcommand*\familydefault{\sfdefault}
\makeglossaries
\newglossaryentry{ge1}
{
name={Entry 1},
description={My first glossary entry.}
}
\begin{document}
\title{My Fancy Title}
\author{John Smith}
\date{March 2013}
\maketitle
\linespread{1.2}
\frontmatter
\tableofcontents
\mainmatter
\chapter{The House}
It was a dark and stormy night...
\backmatter
\glsaddall
\printglossaries
\end{document}
答案1
问题源于memoir
和之间的不兼容。最简单的解决方法是在加载之前glossaries
移动。\pagestyle{ruled}
glossaries
\documentclass[10pt,ebook,oneside,openright]{memoir}
\pagestyle{ruled}% must be before glossaries is loaded
\usepackage{graphicx}
\usepackage[scaled]{berasans}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage[toc,nonumberlist]{glossaries}
\chapterstyle{madsen}
\setsecnumdepth{subsection}
\renewcommand*\familydefault{\sfdefault}
\makeglossaries
\newglossaryentry{ge1}
{
name={Entry 1},
description={My first glossary entry.}
}
\begin{document}
\title{My Fancy Title}
\author{John Smith}
\date{March 2013}
\maketitle
\linespread{1.2}
\frontmatter
\tableofcontents
\mainmatter
\chapter{The House}
It was a dark and stormy night...
\backmatter
\glsaddall
\printglossaries
\end{document}