% \subsection{How to handle footnotes in this setting.}
% \DescribeMacro{\footnote}{% Written by Jason Nowell Standard Footnotes in pdf, but expandable parenthetical online. Supports different coloring by using |\colorlet{fncolor}{COLOR}| and setting COLOR to whatever color you want (Default is blue).}%
%
% \begin{macrocode}
%<*htXimera>
\newcounter{footnoteNum}% This will track footnote numbering for the superscript and for the ID.
\colorlet{fncolor}{red!30!blue}% This is the footnote text coloring. This will allow users to renew this coloring to their own preference if they want to. The default here is a blue coloring. NOTE: Currently; trying to use `footnotecolor' (as a more descriptive color name) breaks everything on my system pretty spectacularly for some reason. This may be just mine or a clash somewhere in the ximera package, so for now I'm leaving it as `fncolor'.
\renewcommand{\footnote}[1]{\ifvmode\ShowPar\fi
\stepcounter{footnoteNum}% Step the counter to make a new footnote
%% The following HCode should setup the javascript function that shows or hides the footnote. If you want to change the footnote location, you may want to change the 'inline' part of x.style.display = 'inline'; to another CSS display type, like 'block' or 'inherit'. Current the `x.display.color' seems to not be working.
\HCode{
}
%% The next command needs \expandafter in order to expand the counter footnoteNum into a roman character for the footnote ID. These seem to work better than arabic numerals in some cases, although why is not clear.
%% The next HCode controls the formatting for the actual footnote reference number (ie the superscript), but not the footnote itself.
\expandafter\HCode{
}
%% The next command needs \expandafter in order to expand the counter footnoteNum into a roman character for the footnote ID. These seem to work better than arabic numerals in some cases, although why is not clear. Note that the ID counter style choice (roman vs arabic etc) needs to match the previous HCode choice.
%% Currently most of the formatting doesn't seem to work as intended, so that still needs to be figured out and fixed. Ideally we would have the footnote appear as a bubble above the footnote superscript when the footnote superscript is clicked.
\expandafter\HCode{
}
\textcolor{fncolor}{(#1)}% Display the actual footnote here with color `fncolor' and within ()'s.
\HCode{}
}% End of footnote definition.
%
% \end{macrocode}