我如何才能使词汇表链接指向正确的页面?

我如何才能使词汇表链接指向正确的页面?

我正在使用这个包词汇表生成书中的首字母缩略词列表和符号列表。首字母缩略词和符号列表中的链接应该指向我的文档中的第 1 页,但实际上链接到的是标题页,而不是文档中的第 1 页。其他链接指向正确的页面。

有人能帮我弄清楚我做错了什么吗?提前感谢大家。

这是 MWE。(我希望它不是太大。)

\documentclass[oneside,english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\usepackage{color}
\usepackage{babel}
\usepackage{makeidx}
\makeindex
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=true]
 {hyperref}
\hypersetup{linkcolor=blue}

\usepackage{mathrsfs}
\usepackage[acronym,section=chapter,nogroupskip,nomain,savewrites,xindy] {glossaries}
\newcommand{\notation}{Notation}
\newglossary[nlg]{notation}{hoo}{ntn}{\notation}
\setglossarystyle{long3col}
\makeglossaries

\newacronym{isal}{ISAL}{Institute of Serengeti Animal Lovers}
\newacronym{iisal}{IISAL}{International Institute of Savannah Animal Lovers}

\newglossaryentry{hoo:animals}{%
    name=\ensuremath{\mathscr{A}},%
    description=The set of all animals in the Serengeti,%
    type=notation,%
    sort=A%
}

\newglossaryentry{hoo:lions}{%
    name=\ensuremath{\mathscr{L}},%
    description=The set  of all lions in the Serengeti,%
    type=notation,%
    sort=L%
}

\newglossaryentry{hoo:gnus}{%
    name=\ensuremath{\mathscr{G}},%
    description=The set of all gnus in the Serengeti,%
    type=notation,%
    sort=G%
}

\newglossaryentry{hoo:zebras}{%
    name=\ensuremath{\mathscr{Z}},%
    description=The set of all zebras in the Serengeti,%
    type=notation,%
    sort=Z%
}

\begin{document}

\title{My Book Title}

\author{My Name}

\maketitle


\frontmatter{}


\chapter*{Preface}

The preface to my book.

\tableofcontents{}

\cleardoublepage{}
\phantomsection
\addcontentsline{toc}{chapter}{\acronymname}

\printacronyms

\cleardoublepage{}
\phantomsection
\addcontentsline{toc}{chapter}{\notation}

\printglossary[style=long3col, type=notation,
title=\notation] 

\mainmatter{}

\chapter{Introduction}

The subject of this book is about a problem that was once posed by
the \gls{isal}. The \gls{isal} is an affiliate of the \gls{iisal}.

There is an ecosystem called the Serengeti which comprises the set
\gls{hoo:animals} of which \gls{hoo:gnus}, \gls{hoo:lions} and
\gls{hoo:zebras} are subsets. We are interested in how subsets of
the subsets of \gls{hoo:animals} maintain equilibrium in the ecosystem.

\chapter{Interactions in the Savannah}

Members of \gls{hoo:lions} devour members of \gls{hoo:gnus} and
\gls{hoo:zebras}. Members of \gls{hoo:gnus} and \gls{hoo:zebras}
compete for some types of food but bunch up together to increase their
security against predation by members of \gls{hoo:lions}.

\backmatter{}

\printindex{}
\end{document}

答案1

只需移动即可解决您的问题

\maketitle

\frontmatter

它所属的地方。

还要注意,像 这样的命令\frontmatter\tableofcontents带参数。

此外,

\cleardoublepage{}
\phantomsection
\addcontentsline{toc}{chapter}{\notation}

不需要。您只需toc在加载时添加选项即可glossaries

梅威瑟:

\documentclass[oneside,english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\usepackage{color}
\usepackage{babel}
\usepackage{makeidx}
\makeindex
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=true]
 {hyperref}
\hypersetup{linkcolor=blue}

\usepackage{mathrsfs}
\usepackage[acronym,section=chapter,nogroupskip,nomain,savewrites,toc,xindy] {glossaries}
\newcommand{\notation}{Notation}
\newglossary[nlg]{notation}{hoo}{ntn}{\notation}
\setglossarystyle{long3col}
\makeglossaries

\newacronym{isal}{ISAL}{Institute of Serengeti Animal Lovers}
\newacronym{iisal}{IISAL}{International Institute of Savannah Animal Lovers}

\newglossaryentry{hoo:animals}{%
    name=\ensuremath{\mathscr{A}},%
    description=The set of all animals in the Serengeti,%
    type=notation,%
    sort=A%
}

\newglossaryentry{hoo:lions}{%
    name=\ensuremath{\mathscr{L}},%
    description=The set  of all lions in the Serengeti,%
    type=notation,%
    sort=L%
}

\newglossaryentry{hoo:gnus}{%
    name=\ensuremath{\mathscr{G}},%
    description=The set of all gnus in the Serengeti,%
    type=notation,%
    sort=G%
}

\newglossaryentry{hoo:zebras}{%
    name=\ensuremath{\mathscr{Z}},%
    description=The set of all zebras in the Serengeti,%
    type=notation,%
    sort=Z%
}

\begin{document}

\title{My Book Title}

\author{My Name}

\frontmatter

\maketitle

\chapter*{Preface}

The preface to my book.

\tableofcontents

\printacronyms

\printglossary[style=long3col, type=notation,
title=\notation]

\mainmatter

\chapter{Introduction}

The subject of this book is about a problem that was once posed by
the \gls{isal}. The \gls{isal} is an affiliate of the \gls{iisal}.

There is an ecosystem called the Serengeti which comprises the set
\gls{hoo:animals} of which \gls{hoo:gnus}, \gls{hoo:lions} and
\gls{hoo:zebras} are subsets. We are interested in how subsets of
the subsets of \gls{hoo:animals} maintain equilibrium in the ecosystem.

\chapter{Interactions in the Savannah}

Members of \gls{hoo:lions} devour members of \gls{hoo:gnus} and
\gls{hoo:zebras}. Members of \gls{hoo:gnus} and \gls{hoo:zebras}
compete for some types of food but bunch up together to increase their
security against predation by members of \gls{hoo:lions}.

\backmatter

\printindex
\end{document}

输出:

在此处输入图片描述

相关内容