LaTeX中的glossaries包和脚注

5
我目前遇到了困难,有两个不同的词汇表:mainacronyms。在文本中,Acronyms 词汇表在第一次使用时会打印脚注,但是 main 词汇表不会。是否有办法使除了 acronyms 以外的任何其他词汇表在首次使用该术语时打印脚注?我不知道如何操作。

下面是使用 TeXnic Center 和 MiKTeX 2.7 编译的代码示例:

\documentclass{article}
\usepackage{index}
\usepackage[toc,style=long3colheaderborder,footnote,acronym]{glossaries} 

\makeindex 
\makeglossaries


\newglossaryentry{appdomain}{name={application domain}, description={app Domain Description...}}
\newglossaryentry{sample}{name={[has been inserted aaa]},description={testing testing 123}}

\newacronym{aca}{aca}{a contrived acronym}

\begin{document}
\section{this is a test section}
This is the test line... a \gls{sample} \gls{appdomain} 
\index{entry} and \gls{aca}
\thispagestyle{empty}\cleardoublepage

\printglossary[type=main,title={Glossary},toctitle={Glossary}]
\thispagestyle{empty}\cleardoublepage
\printglossary[type=\acronymtype,title={List of Abbreviations},toctitle={List of Abbreviations}]

\printindex
\thispagestyle{empty}\cleardoublepage
\end{document}

我希望示例和应用程序域都包含一个描述的脚注或一条脚注说明:请参阅词汇表。
非常感谢, Ovanes

你能否发布一小段代码来说明你的问题? - Mica
你是使用标准的\glossary命令还是像http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=glossaries这样的包? - D.Shawley
我正在使用\glossaries包,它是\glossary的进一步开发。我将尝试制作一个代码片段,但我不确定是否真的需要,因为当导入包时:\usepackage[toc,style=long3colheaderborder,footnote,acronym]{glossaries} 声明缩略语在单独的词汇表中。在文本中首次出现缩略语时,我会得到一个脚注,但如果正常的词汇表短语出现,我就看不到它了。文档说明\acronym类似于对\newglossaryentry的前向声明。如何使正常的词汇表条目第一次出现时带有脚注? - ovanes
1
您可以在 http://tex.stackexchange.com/ 找到一个完整的TeX用户社区。 - Matthew Leingang
3个回答

6
简而言之,使用包时,非首字母缩写词汇表无法在第一次使用时获得脚注。
但是,您可以在导言部分(在\usepackage{glossaries}之后)重新定义一些命令以获得所需的效果。
\makeatletter
\renewcommand{\gls@main@displayfirst}[4]{
  #1#4\protect\footnote{#2}
}
\makeatother

但这将非常脆弱。

哇!这正是我正在寻找的。为什么它很脆弱? - ovanes
抱歉,我回复晚了,没有立即理解。现在我明白了“fragile”的含义。如果我更改词汇表名称或类型,它将会出错。但无论如何,谢谢! - ovanes
没错!也许应该将此作为一个功能请求提交给该软件包的维护者... - Rupert Nash

2
我认为有一种更简单的方法可以做到这一点。也许这是新的,但是请注意:
\defglsdisplayfirst[main]{#1#4\protect\footnote{#2}}

看起来它似乎实现了相同的功能(如果我错了请纠正)。请参考《词汇表》手册,版本2.03,第2.4.1小节更改文本格式

不幸的是,在这些脚注中似乎无法使用\gls\autoref等命令。


1
这个方法已经被弃用了,文档第112页的脚注中提到。 - Soana

0
以下是一种好的技巧,可以在脚注中指明定义的位置:
\label{nom} %put this on the page your term appears, so that it can collect page number

\newcommand{\g}{\footnote{For all abbreviations see the glossary on page \pageref{nom}.}}

我从这里找到了这个。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接