带有词汇表的奇怪行为参见关键词

带有词汇表的奇怪行为参见关键词

see我一直很困惑,不知道这个包的密钥到底如何使用glossaries

该手册第 8 节写道:

请注意,在这种情况下,带有“see”键的条目将自动添加到词汇表中,但交叉引用的条目不会。

与手册所说的相反,指定一个see键不会像我的 MWE 所示那样自动将条目添加到词汇表中。我通过在键\glssee内使用让其中一个条目显示出来description,但无法生成文本see also。我可以在键内手动写入交叉引用description,但我很好奇为什么键see似乎没有按照手册所说的那样做。怎么回事?

\usepackage[notree,shortcuts]{glossaries}

\newglossaryentry{Blackbox}
{
  name=Blackbox models,
  sort=blackbox,
  description={--- In system identification, the term \emph{blackbox} modelling refers to the process of modelling a system through non-parametric techniques, without knowledge of physical inner workings of the system, resulting in an \emph{empirical} model}
}
\newglossaryentry{Whitebox}
{
  name=Whitebox models,
  sort=whitebox,
  description={--- In system identification, the term \emph{whitebox} modelling refers to the process of modelling a system through first principles, laws of physics and explicit assumed relationships between the input and output through prior knowledge of the system, resulting in a \emph{mechanistic} model}
}
\newglossaryentry{Mechanistic}
{
  name=Mechanistic models,
  sort=mechanistic,
  description={},
  see=[see also]{Whitebox},
  nonumberlist
}
\newglossaryentry{Empirical}
{
  name=Empirical models,
  sort=empirical,
  description={\glssee[see also]{Empirical}{Blackbox}},
  see=[see also]{Blackbox},
  nonumberlist
}
\makeglossaries

\begin{document}
Something about \gls{Blackbox} and \gls{Whitebox}
\newpage
\printglossary[title={Glossaries}]
\end{document}

在此处输入图片描述

答案1

  1. 为了使交叉引用项即使不引用也出现,它需要有机会被写入词汇表,因此请将其放在\makeglossaries条目定义之前。

  2. \glssee在实际定义之外使用。以下工作:

    \documentclass{article}
    
    \usepackage[notree,shortcuts]{glossaries}
    \makeglossaries         %% Put that here, so entries can be written to the glossary
    
    \newglossaryentry{Blackbox}
    {
      name=Blackbox models,
      sort=blackbox,
      description={--- In system identification, the term \emph{blackbox} modelling refers to the process of modelling a system through non-parametric techniques, without knowledge of physical inner workings of the system, resulting in an \emph{empirical} model}
    }
    \newglossaryentry{Empirical}
    {
      name=Empirical models,
      sort=empirical,
      description={Empirical descr},
      see=[see also]{Blackbox},
      nonumberlist
    }
    
    %\glssee[see also]{Empirical}{Blackbox} %% We need that to include Empirical when just citing Blackbox; or use the 'see' key in Empirical; put it after \makeglossaries and the entry definitions
    
    \begin{document}
    
    Something about \gls{Blackbox}
    
    
    \newpage
    \printglossary[title={Glossaries}]
    \end{document}
    

    在这种情况下,Empirical 和 Blackbox 都会出现。或者,使用\glssee而不是seeEmpirical 中的 键。

相关内容