The @
character is indeed reserved for MakeIndex processing; it is used for entries such as
\index{abc@\textit{abc}}
where the text to be indexed has formatting and we want to specify a key for sorting purposes.
You have two possibilities. The first is quoting the @
by typing
\index{"@variable}
(but this may fail if you load babel
and a language that makes "
into a shorthand prefix).
The second strategy is adding
\begin{filecontents*}{\jobname.mst}
actual '='
\end{filecontents*}
at the very beginning of your main TeX file (before \documentclass
is the best place).
This assumes =
is never used in your entries. The “sort key” entries like the example above can be input using =
instead of @
\index{abc=\textit{abc}}
and \index{@variable}
will now be sorted among the symbols.
The trick is that the filecontents*
environment will write a file named <jobname>.mst
(where <jobname>
is the main TeX file name) and MakeIndex looks for it when processing a file.
However, this will prevent loading an .ist
files, so beware. If you pass no option to MakeIndex, the method will work.
\index{"@variable}
. You should 'quote' in this way any of:@
,!
, and|
according to themakeindex
manual.