<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \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}
%&lt;*htXimera&gt;
\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{
    &lt;script type="text/javascript"&gt;
            function footnotefunction(ID) {
              var x = document.getElementById(ID);
              if (x.style.display === "none") {
                x.style.color = "blue";
                x.style.display = "inline";
              } else {
                x.style.display = "none";
              }
            }
    &lt;/script&gt;
    }
    %% 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{
    &lt;span style=
            "position=relative;
            vertical-align=baseline;"
            &gt;
            &lt;button onclick="footnotefunction('footnote\roman{footnoteNum}')"
                style=
                "background:none!important;
                 color:inherit;
                 border:none; 
                 padding:0!important;
                 font: inherit;
                 cursor: pointer;"
                &gt;
            	&lt;sup&gt;}[\arabic{footnoteNum}]\HCode{&lt;/sup&gt;&lt;/button&gt;
        }
    %% 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{
            &lt;span id="footnote\roman{footnoteNum}"
                style=
                "display:none;
                min-width:20em;
                position:relative;
                left:2px;
                padding:5px;
                color:blue;
                word-wrap:break-word;
                z-index=9999;
                overflow=auto;"
                &gt;
            }
            \textcolor{fncolor}{(#1)}% Display the actual footnote here with color `fncolor' and within ()'s.
        \HCode{&lt;/span&gt;&lt;/span&gt;}
    }% End of footnote definition.
%&lt;/htXimera&gt;
%    \end{macrocode}

</pre></body></html>