<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \subsubsection{Including widgets}
% \DescribeMacro{\includeinteractive}{Cognate to |includegraphics| but
% instead of a graphics file, accepts a |.js| file which will be
% loaded as an interactive widget.}
%    \begin{macrocode}
%&lt;*classXimera&gt;
\define@key{interactive}{id}{\def\interactive@id{#1}}
\setkeys{interactive}{id=}
\newcommand{\includeinteractive}[2][]{
\setkeys*{interactive}{#1}%
\ifthenelse{\equal{\interactive@id}{}}{}{\recordvariable{\interactive@id}}
Interactive
}
%&lt;/classXimera&gt;
%    \end{macrocode}
%    \begin{macrocode}
%&lt;*htXimera&gt;
\renewcommand{\includeinteractive}[2][]{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{&lt;div id="interactive\arabic{identification}" class="interactive"&gt; &lt;/div&gt;}\HCode{&lt;script src="#2" data-argument="#1" data-target="interactive\arabic{identification}"&gt; &lt;/script&gt;}\IgnoreIndent}
%&lt;/htXimera&gt;
%    \end{macrocode}


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