![词汇表中的交叉引用条目](https://linux22.com/image/317472/%E8%AF%8D%E6%B1%87%E8%A1%A8%E4%B8%AD%E7%9A%84%E4%BA%A4%E5%8F%89%E5%BC%95%E7%94%A8%E6%9D%A1%E7%9B%AE%20.png)
我使用 \gls{} 命令在词汇表中进行交叉引用,该词汇表跨越多页。但是,打印的不是引用条目的页面的页码,而是目录的第一页。我认为这可能与页码从罗马字母更改为阿拉伯字母有关。
有没有办法解决?
梅威瑟:
\documentclass [a4paper, 12pt] {report}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[backref=page, hyperfootnotes=false, hidelinks, colorlinks, citecolor=OliveGreen, linkcolor=Blue, linktocpage, bookmarks=true]{hyperref}
\usepackage[toc, nopostdot, nogroupskip]{glossaries}
\newglossarystyle{mylong}{
\setglossarystyle{long}
\renewenvironment{theglossary}
{\begin{longtable}[l]{@{}p{\dimexpr 8cm-\tabcolsep}p{0.5\hsize}}}
{\end{longtable}}
}
\makeglossaries
\newglossaryentry{q}{name=q,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{w}{name=w,description=blahblahblahblahblahblahblahblahblahblahblah. Cross-reference \gls{z}}
\newglossaryentry{e}{name=e,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{r}{name=r,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{t}{name=t,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{y}{name=y,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{u}{name=u,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{i}{name=i,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{o}{name=o,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{p}{name=p,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{l}{name=l,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{k}{name=k,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{j}{name=j,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{h}{name=h,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{g}{name=g,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{f}{name=f,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{d}{name=d,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{s}{name=s,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{a}{name=a,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{z}{name=z,description=blahblahblahblahblahblahblahblahblahblahblah. Cross-reference \gls{a}}
\newglossaryentry{x}{name=x,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{c}{name=c,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{v}{name=v,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{b}{name=b,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{n}{name=n,description=blahblahblahblahblahblahblahblahblahblahblah}
\newglossaryentry{m} {name=m,description=blahblahblahblahblahblahblahblahblahblahblah}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\phantomsection
\printglossary[style=mylong]
\label{glossary}
\chapter{Introduction}
\pagenumbering{arabic}
\gls{q}
\gls{w}
\gls{e}
\gls{r}
\gls{t}
\gls{y}
\gls{u}
\gls{i}
\gls{o}
\gls{p}
\gls{l}
\gls{k}
\gls{j}
\gls{h}
\gls{g}
\gls{f}
\gls{d}
\gls{s}
\gls{a}
\gls{z}
\gls{x}
\gls{c}
\gls{v}
\gls{b}
\gls{n}
\gls{m}
\end{document}