glossaries package and footnote in LaTeX
Asked Answered
H

3

5

I am currently stuck, having two separate glossaries: main & acronyms. Acronyms glossary prints footnotes on first use in the text, but main glossary does not. Is there any way to make any other glossary than acronyms to print footnote on first use of the term? I don't get how to do it.

Here is the code example compiled with TeXnic Center and 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}

I want sample and appdomain either contain a footnote with description or a footnote stating: please refer to Glossary

Many thanks,
Ovanes

Hanan answered 27/10, 2009 at 19:9 Comment(4)
can you post a snippet that will illustrate your problem?Desulphurize
Are you using the standard \glossary command or a package like tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=glossaries?Florilegium
I am using the \glossaries package, which is the further development of \glossary. I will try to make a snippet, but I am not sure if it is really required, since when importing the package as: \usepackage[toc,style=long3colheaderborder,footnote,acronym]{glossaries} declares the acronyms to be in a separate glossary. After acronym appears first time in the text I get a footnote, but if the normal glossary phrase appears I don't see it. Doc states that \acronym is smth. like a forward declaration to the \newglossaryentry. How can I make normal glossary entry appear first time with footnote?Hanan
You can find a whole community of TeX users at tex.stackexchange.comFulani
C
6

In short, with the glossaries package, you can't get footnotes on the first use for non-acronym glossaries.

However, you can redefine some commands in the preamble (after you \usepackage{glossaries}) to get what you want:

\makeatletter
\renewcommand{\gls@main@displayfirst}[4]{
  #1#4\protect\footnote{#2}
}
\makeatother

But that will be really fragile.

Catha answered 6/11, 2009 at 13:59 Comment(3)
Wow! That is exactly, what I was looking for. Why is it fragile?Hanan
Sorry, it's late and I did not get immediately. I now got it what means `fragile'. If I change glossary name or type, it will break. But anyway thanks!Hanan
Exactly! Perhaps this should be filed as a feature request with the maintainer of the package…Catha
M
2

I think there is an easier way of doing this. Maybe it's new, but

\defglsdisplayfirst[main]{#1#4\protect\footnote{#2}}

appears to achieve the exact same thing (correct me if I'm wrong). See the glossaries manual, version 2.03, subsection 2.4.1 changing the format of the text.

Unfortunately, it appears commands like \gls or \autoref does not work in those footnotes.

Mitchell answered 2/11, 2011 at 9:25 Comment(1)
This method is deprecated, says the documentation, page 112, in the footnotes.Unifilar
G
0

Following is a good technique, to put a footnote stating where the definitions are:

\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}.}}

I've found this from here.

Groundsheet answered 23/11, 2010 at 20:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.