Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % special thanks to Nicola Talbot
- % http://tex.stackexchange.com/a/292136
- \documentclass{book}
- \usepackage{everypage}
- \usepackage{glossaries-extra}
- \AddEverypageHook{%
- \gdef\entrylabellist{}%
- }
- \GlsXtrEnableEntryUnitCounting{general}{0}{page}
- \newcommand*{\entrylabellist}{}
- \makeatletter
- \def\@glo@sortinghandler{\@glo@sorthandler@word}%
- \newcommand*{\sortpageentries}{%
- \forglsentries{\thisentry}{%
- \ifnum\glsentryprevcount{\thisentry}>0\relax
- \expandafter\@glo@sortedinsert\expandafter\entrylabellist\expandafter
- {\thisentry}%
- \fi
- }%
- }
- \newcommand*{\glsxtrpostlinkgeneral}{%
- \ifnum\glsentrycurrcount{\glslabel}=1\relax
- \footnotemark[1]%
- \ifdefempty\entrylabellist
- {%
- \sortpageentries
- \footnotetext[1]{\@for\thisentry:=\entrylabellist\do{%
- \glsentryname{\thisentry} \glsentrydesc{\thisentry}. }}%
- }%
- {}%
- \fi
- }
- \makeatother
- \newglossaryentry{uno}{name=uno,description=one}
- \newglossaryentry{dos}{name=dos,description=two}
- \newglossaryentry{tres}{name=tres,description=three}
- \newglossaryentry{quatro}{name=quatro,description=four}
- \newglossaryentry{cinco}{name=cinco,description=five}
- \begin{document}
- Counting to three in Spanish, \gls{uno}, \gls{dos},
- \gls{tres}. Counting to five in Spanish, \gls{uno},
- \gls{dos}, \gls{tres}, \gls{quatro}, \gls{cinco}.
- Notice how \gls{uno}, \gls{dos}, and \gls{tres} only appear once in
- the footnotes despite being glossed three times.
- \newpage
- Test next page.
- \gls{tres}, \gls{quatro} and \gls{cinco}.
- And again:
- \gls{tres}, \gls{quatro} and \gls{cinco}.
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement