如何参考词汇表的第一页?

如何参考词汇表的第一页?

这个问题是关于对词汇表进行编号,并通过该编号来引用它。

我问的是参考页面未编号词汇表开始。由于我使用\printglossaries它来打印,因此在命令中没有可以引用的标签\pageref

我认为该解决方案应该适用于这样一个简单的示例文档

答案1

hyperref使用's尝试此代码\autopageref

A

\documentclass[12pt]{article}

\usepackage[
toc,
section,
numberedsection = autolabel,
automake,
]{glossaries}
\glstoctrue

\makeglossaries %makeglossaries %

\newacronym{vae}{VAE}{variational auto-encoder}
\makeglossaries
    
\usepackage[hidelinks]{hyperref}% added <<<<<<<<<<<<
\begin{document}
    
    \tableofcontents
    
    \section{Abstract}
    \acrshort{vae}. 
    
    Please, refer to section \ref{main}.
    
    Please, refer to \autopageref{main}. 
    
    \newpage \setcounter{page}{5}
    
    \printglossary[type=main]
    
\end{document}

对于未编号的词汇表

b

\documentclass[12pt]{article}

\usepackage[
toc,
section,
]{glossaries}
\glstoctrue
    
\renewcommand*{\glossarypreamble}{%https://tex.stackexchange.com/a/49780/161015
    \label{\currentglossary}%
}

\newacronym{vae}{VAE}{variational auto-encoder}
\makeglossaries

\begin{document}
    
    \tableofcontents
    
    \section{Abstract}
    \acrshort{vae}. 
        
    The glossary starts on page~\pageref{main}.
    
    \newpage \setcounter{page}{5}
    
    \printglossary
\end{document}

或者

\documentclass[12pt]{article}

\usepackage[
toc,
section,
]{glossaries}
\glstoctrue

\newacronym{vae}{VAE}{variational auto-encoder}
\makeglossaries

\begin{document}
    
    \tableofcontents
    
    \section{Abstract}
    \acrshort{vae}. 
        
    The glossary starts on page~\pageref{main}.
    
    \newpage \setcounter{page}{5}
    
    \printglossary[title={List of Acronyms\label{main}}]
\end{document}

相关内容