Hi all,
For one of my documents, whenever I use a 'special term' I have to index it and footnote it... every time. Easy enough with a macro. However, a special term may appear several times on one page. It doesn't look very nice to have footnotes on a single page that all refer to the same section.
Is there a way to suppress footnotes so only the unique ones are shown? So the first special term on a page would be footnote 1, and every other use of it would be footnote 1, the second special term on that page would be footnote 2, etc.
Thanks in advance
James
General ⇒ Footnote question
NEW: TikZ book now 40% off at Amazon.com for a short time.
Footnote question
Here is an example that you might find useful:
Code: Select all
\documentclass{article}
\usepackage{makeidx}
\usepackage{etoolbox}
\newrobustcmd*\newterm[3][]{%
\edef\x{\ifstrempty{#1}{#2}{#1}}%
\protected\csedef{term.\x.name}{#2}%
\protected\csedef{term.\x.desc}{#3}%
}
\newrobustcmd*\term[1]{%
\ifcsdef{term.#1.name}{%
\letcs\x{term.#1.name}%
\x\expandafter\index\expandafter{\x}%
\ifcsdef{term.#1.note}{%
\footnotemark[\csuse{term.#1.note}]%
}{%
\footnotemark\footnotetext{\csuse{term.#1.desc}}%
\csedef{term.#1.note}{\thefootnote}%
}%
}{%
\PackageWarning{xyz}{Term `#1' not defined}%
#1%
}%
}
\makeindex
\begin{document}
\newterm{A}{Description of A}
\newterm{B}{Description of B}
\term{A} \term{A} \term{B} \term{A} \term{B}
\printindex
\end{document}