first time asking a question.
I'm implementing egregs answer from this question: Highlight First Occurrence of a Particular Word
%%% Code to set up special term treatment
\makeatletter
\newcommand{\specialterms}[1]{%
\@for\next:=#1\do
{\@namedef{specialterm@\detokenize\expandafter{\next}}{}}%
}
\newcommand\term[1]{%
\@ifundefined{specialterm@\detokenize{#1}}
{#1}{\emph{#1}\global\expandafter\let\csnamespecialterm@\detokenize{#1}\endcsna me\relax}%
}
\makeatother
%%% Here we define the special terms we want
\specialterms{foo,bar,baz}
This emphasises the first mention of the words in the \specialterms list. This is working fine at the moment. I want it to recognise capitalised versions of the words listed in \specialterms, so that it works better with the first word in a sentence. Using the example over, I want \term{Foo} to be emphasised without having to add Foo to the \specialterms list.
I tried the following:
\@ifundefined{specialterm@\MakeLowercase{\detokenize{#1}}}
This does not work however. I think I need to add some \csnames and \expandafter commands and what have you, but my understanding of what these commands actually do is very limited. Any suggestions would be most appreciated. I should maybe have posted this as a comment in the original thread, but as I just joined the site I don't have enough reputation to do this.

glossariespackage and it does support capitalisation of terms. – JP-Ellis Feb 13 '16 at 09:32