summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ximera/src
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/ximera/src')
-rw-r--r--macros/latex/contrib/ximera/src/abstract.dtx14
-rw-r--r--macros/latex/contrib/ximera/src/activity.dtx158
-rw-r--r--macros/latex/contrib/ximera/src/answer.dtx111
-rw-r--r--macros/latex/contrib/ximera/src/banner.dtx21
-rw-r--r--macros/latex/contrib/ximera/src/choice.dtx226
-rw-r--r--macros/latex/contrib/ximera/src/clearEnv.dtx18
-rw-r--r--macros/latex/contrib/ximera/src/dialogue.dtx28
-rw-r--r--macros/latex/contrib/ximera/src/ending.dtx20
-rw-r--r--macros/latex/contrib/ximera/src/enumerate.dtx10
-rw-r--r--macros/latex/contrib/ximera/src/feedback.dtx72
-rw-r--r--macros/latex/contrib/ximera/src/foldable.dtx76
-rw-r--r--macros/latex/contrib/ximera/src/footnotes.dtx63
-rw-r--r--macros/latex/contrib/ximera/src/freeresponse.dtx60
-rw-r--r--macros/latex/contrib/ximera/src/graded.dtx20
-rw-r--r--macros/latex/contrib/ximera/src/hideEnv.dtx36
-rw-r--r--macros/latex/contrib/ximera/src/hints.dtx53
-rw-r--r--macros/latex/contrib/ximera/src/html.dtx20
-rw-r--r--macros/latex/contrib/ximera/src/hyperref.dtx12
-rw-r--r--macros/latex/contrib/ximera/src/image.dtx60
-rw-r--r--macros/latex/contrib/ximera/src/instructornotes.dtx101
-rw-r--r--macros/latex/contrib/ximera/src/interactives/desmos.dtx14
-rw-r--r--macros/latex/contrib/ximera/src/interactives/geogebra.dtx27
-rw-r--r--macros/latex/contrib/ximera/src/interactives/google.dtx26
-rw-r--r--macros/latex/contrib/ximera/src/interactives/graph.dtx14
-rw-r--r--macros/latex/contrib/ximera/src/interactives/include.dtx22
-rw-r--r--macros/latex/contrib/ximera/src/interactives/javascript.dtx31
-rw-r--r--macros/latex/contrib/ximera/src/interactives/sagemath.dtx43
-rw-r--r--macros/latex/contrib/ximera/src/interactives/video.dtx21
-rw-r--r--macros/latex/contrib/ximera/src/jax.dtx115
-rw-r--r--macros/latex/contrib/ximera/src/labels.dtx15
-rw-r--r--macros/latex/contrib/ximera/src/leash.dtx18
-rw-r--r--macros/latex/contrib/ximera/src/link.dtx31
-rw-r--r--macros/latex/contrib/ximera/src/logo.dtx30
-rw-r--r--macros/latex/contrib/ximera/src/macros.dtx14
-rw-r--r--macros/latex/contrib/ximera/src/makeCounter.dtx37
-rw-r--r--macros/latex/contrib/ximera/src/metadata.dtx32
-rw-r--r--macros/latex/contrib/ximera/src/only.dtx38
-rw-r--r--macros/latex/contrib/ximera/src/options.dtx123
-rw-r--r--macros/latex/contrib/ximera/src/optionsxourse.dtx27
-rw-r--r--macros/latex/contrib/ximera/src/outcomes.dtx34
-rw-r--r--macros/latex/contrib/ximera/src/packages.dtx54
-rw-r--r--macros/latex/contrib/ximera/src/pagesetup.dtx55
-rw-r--r--macros/latex/contrib/ximera/src/problem.dtx197
-rw-r--r--macros/latex/contrib/ximera/src/proof.dtx10
-rw-r--r--macros/latex/contrib/ximera/src/sectioning.dtx49
-rw-r--r--macros/latex/contrib/ximera/src/solution.dtx30
-rw-r--r--macros/latex/contrib/ximera/src/suppress.dtx33
-rw-r--r--macros/latex/contrib/ximera/src/textcolor.dtx20
-rw-r--r--macros/latex/contrib/ximera/src/theorems.dtx174
-rw-r--r--macros/latex/contrib/ximera/src/tikzexport.dtx42
-rw-r--r--macros/latex/contrib/ximera/src/title.dtx122
-rw-r--r--macros/latex/contrib/ximera/src/ungraded.dtx22
-rw-r--r--macros/latex/contrib/ximera/src/utilitymacros.dtx45
-rw-r--r--macros/latex/contrib/ximera/src/verbatim.dtx36
-rw-r--r--macros/latex/contrib/ximera/src/xkcd.dtx13
55 files changed, 2793 insertions, 0 deletions
diff --git a/macros/latex/contrib/ximera/src/abstract.dtx b/macros/latex/contrib/ximera/src/abstract.dtx
new file mode 100644
index 0000000000..2a895568d3
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/abstract.dtx
@@ -0,0 +1,14 @@
+% \subsubsection{Abstract}
+% \DescribeEnv{abstract}{Every activity should include a short abstract.}
+% \begin{macrocode}
+%<*classXimera>
+\let\abstract\relax
+\let\endabstract\relax
+% Use of environ package, may want to find a better way.
+\NewEnviron{abstract}{\protected@xdef\theabstract{\BODY}}
+%</classXimera>
+% \end{macrocode}
+% The abstract has been stored in |\theabstract| and should be emitted
+% as a div, but confusingly I guess |<div class="abstract">| is
+% defined somewhere deeper inside tex4ht, so the code below is
+% probably unnecessary. \ No newline at end of file
diff --git a/macros/latex/contrib/ximera/src/activity.dtx b/macros/latex/contrib/ximera/src/activity.dtx
new file mode 100644
index 0000000000..647be0565d
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/activity.dtx
@@ -0,0 +1,158 @@
+% \subsection{Activities}
+% The core of the |xourse| system. It works by redefining the
+% |document| environment, thus making the |\begin| and
+% |\end{document}| of the subfile `transparent' to the
+% inclusion. The redefinition of |\documentclass| is analogous, just
+% having a required and an optional arguments which mean nothing to
+% |\subfile|.
+% \begin{macrocode}
+%<*classXourse>
+\newcommand{\skip@preamble}{%
+ \let\document\relax\let\enddocument\relax%
+ \newenvironment{document}{\let\input\otherinput}{}%
+ \renewcommand{\documentclass}[2][subfiles]{}}
+% \end{macrocode}
+% Note that the new command |\subfile| calls for |\skip@preamble| \emph{within a group}. The changes to |document| and |\documentclass| are undone after the inclusion of the subfile.
+%
+% Numbering starts a page too soon without this:
+% \begin{macrocode}
+\let\otherinput\input
+% \end{macrocode}
+% Store usual |\maketitle| as |\othermaketitle|
+% \begin{macrocode}
+\let\othermaketitle\maketitle
+% \end{macrocode}
+% \DescribeMacro{\maketitle}{In a \textsf{xourse} file, |\maketitle| is redefined to give course packet title page and toc.}
+% \begin{macrocode}
+\renewcommand{\maketitle}{ %
+\pagestyle{empty}
+\begin{center}
+~\\ %puts space at top of page to move title down.
+\vskip .25\textheight
+\hrulefill\\
+\vskip 1em
+\bfseries{\Huge \@title} \\
+\hrulefill\\
+\vskip 3em
+{\Large \@author}
+\vskip 2em
+{\large \@date}
+\end{center}
+\clearpage
+% \end{macrocode}
+% When |notoc| option is used, we do not include a table of contents.
+% Otherwise we include a table of contents in every course packet.
+% \begin{macrocode}
+\ifnotoc
+\else
+ \tableofcontents\clearpage
+ \clearpage
+\fi
+% \end{macrocode}
+% Switch to main pagestyle, just like a document with documentclass \textsf{ximera}.
+% \begin{macrocode}
+\pagestyle{main}
+% \end{macrocode}
+% Renew maketitle to usual definition.
+% \begin{macrocode}
+\let\maketitle\othermaketitle
+% \end{macrocode}
+% And we finish with our redefinition of |\maketitle|.
+% \begin{macrocode}
+}
+\relax
+%</classXourse>
+% \end{macrocode}
+
+% \subsubsection{Regular activities}
+% \DescribeMacro{\activity}{Documents included with |\activity| will
+% be included in the body of the xourse document. Any |\input|
+% commands within included \textsf{ximera} documents will be ignored.
+% Any |\usepackage| commands within included ximera documents will
+% cause an error. Overlapping |\newcommand| definitions within
+% multiple ximera documents included simultaneously will cause an
+% error.} The |\activity| command inputs the file name provided
+% without |\documentclass|, without
+% |\begin{document}|/|\end{document}| and without any inputs in the
+% preamble of the included file.
+% \begin{macrocode}
+%<*classXourse>
+\ifnonewpage
+\newcommand{\activity}[2][]{%
+ \setkeys{activity}{#1}
+ \renewcommand{\input}[1]{}
+ \begingroup\skip@preamble\otherinput{#2}\endgroup\par\vspace{\topsep}
+ \let\input\otherinput}
+\else
+\newcommand{\activity}[2][]{%
+ \setkeys{activity}{#1}
+ \renewcommand{\input}[1]{}
+ \begingroup\skip@preamble\otherinput{#2}\endgroup\clearpage
+ \let\input\otherinput}
+\fi
+\relax
+%</classXourse>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXourse>
+\renewcommand\activity[2][]{%
+\ifvmode \IgnorePar\fi \EndP\HCode{<a class="activity card \activitystyle" href="#2" data-options="#1">#2</a>}\IgnoreIndent%
+}
+%</htXourse>
+% \end{macrocode}
+
+% When running xake, we can just ignore activities
+% \begin{macrocode}
+%<*classXourse>
+\ifxake
+\renewcommand\activity[2][]{}
+\fi
+%</classXourse>
+% \end{macrocode}
+
+
+% \subsubsection{Practice activities}
+% \DescribeMacro{\practice}{Like |\activity| but not expecting a title.}
+% \begin{macrocode}
+%<*classXourse>
+\ifhandout
+\newcommand{\practice}[2][]{
+ \setkeys{practice}{#1}%!!!!!
+ \renewcommand{\input}[1]{}
+ \begingroup\skip@preamble\otherinput{#2}\endgroup
+ \let\input\otherinput}
+\else
+\newcommand{\practice}[2][]{\texttt{\detokenize{#2}}%% gives file name for practice
+ \setkeys{practice}{#1}%!!!!!
+ \renewcommand{\input}[1]{}
+ \begingroup\skip@preamble\otherinput{#2}\endgroup
+ \let\input\otherinput}
+\fi
+\relax
+%</classXourse>
+% \end{macrocode}
+
+% The practice environment does nothing, but will eventually produce
+% exercises at the end of an activity
+% \begin{macrocode}
+%<*classXourse>
+\ifxake
+\renewcommand\practice[2][]{}
+\fi
+%</classXourse>
+% \end{macrocode}
+
+% I suppose it is reasonable for practice cards to NOT have an activitystyle, since the activitystyle is basically PRACTICE.
+% \begin{macrocode}
+%<*htXourse>
+\renewcommand\practice[2][]{%
+ \ifvmode\IgnorePar\fi\EndP%
+ \HCode{<a class="activity card practice" href="#2" data-options="#1">#2</a>}%
+ \IgnoreIndent%
+}
+%</htXourse>
+% \end{macrocode}
+
+
+
diff --git a/macros/latex/contrib/ximera/src/answer.dtx b/macros/latex/contrib/ximera/src/answer.dtx
new file mode 100644
index 0000000000..c6f5460d05
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/answer.dtx
@@ -0,0 +1,111 @@
+% \subsubsection{Answers}
+% \DescribeMacro{\answer}{A math answer}
+% \begin{macrocode}
+%<*classXimera>
+
+\ifdefined\HCode
+\newcommand{\recordvariable}[1]{}
+\else
+\newwrite\idfile
+\immediate\openout\idfile=\jobname.ids
+\newcommand{\recordvariable}[1]{\ifthenelse{\equal{#1}{}}{}{\immediate\write\idfile{var #1;}}}
+\fi
+% \end{macrocode}
+% Determines if answer is shown in handout mode. when |given=true|,
+% show answer in handout mode, show answer in ``given box'' outside
+% handout mode. When |given=false|, do not show answer in handout
+% mode, show answer outside handout mode
+% \begin{macrocode}
+\define@key{answer}{given}[true]{\def\ans@given{#1}}
+% \end{macrocode}
+% Used for setting numeric answer tolerance for online student input.
+% \begin{macrocode}
+\define@key{answer}{tolerance}{\def\ans@tol{#1}}
+% \end{macrocode}
+% Used to run dynamic js code on student provided answers. Note:
+% currently pdf outputs the validator code itself.
+% \begin{macrocode}
+\define@key{answer}{validator}{}
+% \end{macrocode}
+% Used for assigning a js ID to answer for dynamic code (eg validators).
+% \begin{macrocode}
+\define@key{answer}{id}{\def\ans@id{#1}}
+% \end{macrocode}
+% Used to set anticipated input format; eg "string".
+% \begin{macrocode}
+\define@key{answer}{format}{}
+% \end{macrocode}
+% Used to hide the answer input box on the web.
+% \begin{macrocode}
+\define@key{answer}{onlinenoinput}[false]{}
+% \end{macrocode}
+% Used to add a `show answer' button to the answer blank.
+% \begin{macrocode}
+\define@key{answer}{onlineshowanswerbutton}[false]{}
+% \end{macrocode}
+% Set default values for |\answer| command |key=value| pairs.
+% Default values are |given = false|.
+% \begin{macrocode}
+\setkeys{answer}{id=,given=false,onlinenoinput=false,onlineshowanswerbutton=false}
+% \end{macrocode}
+% Basic code for |\answer|.
+% \begin{macrocode}
+
+% Options for handout
+\newcommand{\answerFormatLength}{2cm}
+
+\newcommand{\answerFormatDots}[1]{\ldots\ldots}
+\newcommand{\answerFormatLine}[1]{\protect\rule{\answerFormatLength}{0.4pt}}
+\newcommand{\answerFormatFlexibleLine}[1]{\protect\rule{\widthof{$#1$}*2}{0.4pt}}
+\newcommand{\answerFormatFlexibleBox}[1]{\fbox{\scalebox{2}{\phantom{$#1$}}}}
+
+% options for default (i.e with answers filled in)
+\newcommand{\answerFormatPlain}[1]{\ensuremath{#1}}
+\newcommand{\answerFormatBlue}[1]{\color{blue}\ensuremath{#1}}
+\newcommand{\answerFormatBoxed}[1]{\fbox{\ensuremath{#1}}}
+\newcommand{\answerFormatBoxedGiven}[1]{\underset{\scriptstyle\mathrm{given}}{\fbox{\ensuremath{#1}}}}
+
+% defaults for handout and default mode, and for \answer[given]
+\let\handoutAnswerFormat\answerFormatDots
+\let\defaultAnswerFormat\answerFormatBlue
+\let\givenAnswerFormat\answerFormatBoxedGiven
+
+\newcommand{\answer}[2][]{%
+ \ifmmode%
+ \setkeys{answer}{#1}%
+ \recordvariable{\ans@id}
+ \ifthenelse{\boolean{\ans@given}}
+ {% Start then statement
+ \ifhandout
+ #2
+ \else
+ \givenAnswerFormat{#2} %% in case the argument helps formatting
+ \fi
+ }% End then statement
+ {% Start else statement
+ \ifhandout
+ \handoutAnswerFormat{#2} %% in case the argument helps formatting
+ \else% show answer in box outside handout mode
+ \defaultAnswerFormat{#2} %% in case the argument helps formatting
+ \fi
+ }% End else statement
+ \else%
+ \GenericError{\space\space\space\space}% Throw an error based on... something? -- Jason
+ {Attempt to use \@backslashchar answer outside of math mode}
+ {See https://github.com/ximeraProject/ximeraLatex for explanation.}
+ {Need to use either inline or display math.}%
+ \fi
+}
+%</classXimera>
+% \end{macrocode}
+% On the HTML side, |\answer| emits spans---but it is usually just
+% handled directly by MathJax.
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\answer}[2][false]{\HCode{<span class="answer respondable">}#2\HCode{</span>}}
+
+\def\validator[#1]{\stepcounter{identification}\HCode{<div class="validator" id="validator\arabic{identification}"><script type="text/javascript">function validator\arabic{identification}() }\{\HCode{ return \detokenize{#1}; }\}\HCode{</script>}}
+\def\endvalidator{\HCode{</div>}}
+
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/banner.dtx b/macros/latex/contrib/ximera/src/banner.dtx
new file mode 100644
index 0000000000..ec5d62b283
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/banner.dtx
@@ -0,0 +1,21 @@
+% \begin{macrocode}
+%<*classXimera>
+\let\m\message
+\def\w{\m{::}}\def\t{\m{:::}}\def\s{\m{ }}\def\n{\m{^^J}}\def\u{::'}\def\d{'::}\def\v{:::::}
+\n
+\m{\d.}\s\m{.\u}\w\m{}\m{\v}\s\s\m{\v}\m{}\m{.\v\v\v::::.}\s\m{}\t\n
+\s\m{\d.\u}\s\w\t\t\s\t\t\w\m{}\s\s\s\s\s\s\s\t\s\m{\u::}\n
+\s\s\t\s\s\w\t\m{}\t\t\m{}\t\m{ ::::\v}\m{.\v:\u}\m{}\m{\u}\m{\d}\n
+\s\m{.\u::.}\s\w\t\m{}\t\t\m{}\t\w\s\s\s\s\w\m{}\m{\d.}\s\m{\u}\s\m{\d}\n
+\m{.\u}\s\m{\d.}\w\t\s\m{':\u}\s\t\m{\d\v::}\w\s\m{}\m{\d.\u}\s\s\m{\d}\n
+\n
+\let\w\undefined
+\let\t\undefined
+\let\s\undefined
+\let\n\undefined
+\let\u\undefined
+\let\d\undefined
+\let\v\undefined
+\let\m\undefined
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/choice.dtx b/macros/latex/contrib/ximera/src/choice.dtx
new file mode 100644
index 0000000000..70770cd24e
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/choice.dtx
@@ -0,0 +1,226 @@
+% \subsubsection{Multiple choice and the like}
+% \DescribeEnv{multipleChoice}{Multiple choice}
+% \begin{macrocode}
+%<*classXimera>
+% Jim: Originally this was \renewcommand{\theenumi}{$(\mathrm{\alph{enumi}})$}
+% but that breaks tex4ht because mathmode can only be processed by mathjax.
+% so now I made this just italicized.
+% \end{macrocode}
+% \subsubsection{Options}
+% \begin{macrocode}
+\define@key{choice}{value}[]{\def\choice@value{#1}}
+% \end{macrocode}
+% This flags the answer as the correct answer
+% \begin{macrocode}
+\define@boolkey{choice}{correct}[true]{\def\choice@correct{#1}}
+% \end{macrocode}
+% Use an ID to refer to the choice.
+% \begin{macrocode}
+\define@key{multipleChoice}{id}{\def\mc@id{#1}}
+% \end{macrocode}
+% |\otherchoice| outputs the item if correct and nothing if incorrect.
+% \begin{macrocode}
+\define@key{otherchoice}{value}[]{\def\otherchoice@value{#1}}
+\define@boolkey{otherchoice}{correct}[true]{\def\otherchoice@correct{#1}}
+% \end{macrocode}
+% Default key choices for multiple choice options.
+% Default for choice pairs.
+% Default: answers without the option "correct=true" is "incorrect".
+% \begin{macrocode}
+\setkeys{choice}{correct=false,value=}
+% \end{macrocode}
+% Defaults for multipleChoice pairs.
+% Default to no id? -- Jason
+% \begin{macrocode}
+\setkeys{multipleChoice}{id=}
+% \end{macrocode}
+% Defaults for otherchoice pairs.
+% Default "otherchoice" to behave like "choice" for error checking.
+% \begin{macrocode}
+\setkeys{otherchoice}{correct=false,value=}
+%</classXimera>
+% \end{macrocode}
+%
+% \subsubsection{Choices}
+% \DescribeMacro{\choice}{Like |\item| but for choice environments.}
+% choice command denotes a possible answer choice for the multiple choice question.
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\choice}[2][]{%
+\setkeys{choice}{#1}%
+\item{#2}
+\ifthenelse{\boolean{\choice@correct}}
+ {% Begin then result
+ \ifhandout% if it's a handout do nothing.
+ \else% otherwise place a checkmark when you select the "correct choice"... maybe? -- Jason
+ \,\checkmark\,\setkeys{choice}{correct=false}
+ \fi
+ }% End then result
+ {}% Begin/End else result.
+}
+
+%Define an expandable version of choice Not really meant to be used outside this package (used in wordChoice)
+% Is there a reason we can't just always use this as default? -- Jason
+\newcommand{\choiceEXP}[2][]{%
+ \expandafter\setkeys\expandafter{choice}{#1}%
+ \item{#2}
+ \ifthenelse{\boolean{\choice@correct}}
+ {% Begin then result
+ \ifhandout
+ \else
+ \,\checkmark\,\setkeys{choice}{correct=false}
+ \fi
+ }% End then result
+ {}% Begin/End else result.
+ } %% note all the {} are needed in case the choice has [] in it.
+
+% \otherchoice is the \choice used in wordChoice command.
+\newcommand{\otherchoice}[2][]{%
+\ignorespaces%
+\setkeys{otherchoice}{#1}%
+\ifthenelse{\boolean{\otherchoice@correct}}%
+{% Start then result
+#2\ignorespaces\setkeys{otherchoice}{correct=false}\ignorespaces%
+}% End then result
+{}% Start/End else result
+\ignorespaces%
+}%
+\newcommand{\inlinechoice}[2][]{%
+\setkeys{choice}{#1}%
+\iffirstinlinechoice
+(\hspace{-.25em}
+\firstinlinechoicefalse
+\else
+/
+\fi
+#2
+\ifthenelse{\boolean{\choice@correct}}%
+{% Start then result
+\ifhandout\else\checkmark\ignorespaces\setkeys{choice}{correct=false}\ignorespaces\fi%
+}% End then result
+{}% Start/End else result
+\hspace{-.25em}\ignorespaces%
+}
+
+%</classXimera>
+% \end{macrocode}
+% On the HTML side, |\choice| emits |<span>|s.
+% \begin{macrocode}
+%<*htXimera>
+\newcounter{choiceId}
+\renewcommand{\choice}[2][]{%
+\setkeys{choice}{correct=false}%
+\setkeys{choice}{#1}%
+\stepcounter{choiceId}\IgnorePar%
+\HCode{<span class="choice }%
+\ifthenelse{\boolean{\choice@correct}}{\HCode{correct}}{}
+\HCode{" }
+\ifthenelse{\equal{\choice@value}{}}{}{\HCode{data-value="\choice@value" }}
+\HCode{id="choice\arabic{choiceId}">}%
+#2\HCode{</span>}}
+\let\inlinechoice\choice
+%</htXimera>
+% \end{macrocode}
+
+% \subsubsection{Environment(s)}
+% The environment |multipleChoice@| is for internal use only.
+% \DescribeEnv{multipleChoice}{Wrap |\choice|s in a |multipleChoice| environment to make a multiple choice question.}
+% \begin{macrocode}
+%<*classXimera>
+\newenvironment{multipleChoice}[1][]
+ {% Environment Start Code
+ \setkeys{multipleChoice}{#1}%
+ \recordvariable{\mc@id}%
+ \begin{trivlist}
+ \item[\hskip \labelsep\small\bfseries Multiple Choice:]\hfil
+ \begin{enumerate}
+ }% Note this means that \item has to be the first line after \begin{multipleChoice}.
+ {% Environment End Code
+ \end{enumerate}
+ \end{trivlist}
+ }
+
+%multipleChoice@ is for internal use only! (used in wordChoice)
+%this is simply a wrapper for the sole showing (other)choice.
+\newenvironment{multipleChoice@}[1][]{}{)}
+%</classXimera>
+% \end{macrocode}
+
+
+
+% On the web, you might also expect these to be "problem environments"
+% but they aren't -- they're respondables. You might expect a
+% |\setcounter{choiceId}{0}| here --- that would be wrong, because then
+% the generated IDs would no longer be unique.
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{multipleChoice}[1][]
+{\setkeys{multipleChoice}{#1}%
+\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="multiple-choice" }%
+\ifthenelse{\equal{\mc@id}{}}{}{\HCode{data-id="\mc@id" }}%
+\HCode{id="problem\arabic{identification}">}%
+}{\HCode{</div>}\IgnoreIndent}
+\ConfigureEnv{multipleChoice}{}{}{}{}
+%</htXimera>
+% \end{macrocode}
+
+% \subsection{Word choice}
+% \DescribeMacro{\wordChoice}{An in-line version of multipleChoice:
+% uses enumitem package note, it is coded as a single line to avoid
+% unwanted spaces in ``given'' mode.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\wordChoice}[1]{%
+\let\choicetemp\choice% Assign a "choicetemp" command to duplicate choice.
+\ifwordchoicegiven% If wordchoice option is on, we need to juggle around some definitions.
+\let\choice\otherchoice%
+%\begin{multipleChoice@}% -unnecessary (REMOVE THIS LINE IF THE YEAR IS 2019 or Beyond)
+#1
+%\end{multipleChoice@}% -unnecessary (REMOVE THIS LINE IF THE YEAR IS 2019 or Beyond)
+\else% If it isn't the regular "choice" command should work.
+\let\choice\inlinechoice%
+\begin{multipleChoice@}%
+#1%
+\end{multipleChoice@}%
+\fi%
+\let\choice\choicetemp% Now that choicetmp has been manipulated to what we want, replace choice with it.
+}%
+
+
+%</classXimera>
+% \end{macrocode}
+% This is actually just word choice
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{multipleChoice@}{\refstepcounter{problem}}{}%
+\ConfigureEnv{multipleChoice@}{\stepcounter{identification}\IgnorePar\HCode{<span class="word-choice" id="word-choice\arabic{identification}">}}{\HCode{</span>}\IgnoreIndent}{}{}
+%</htXimera>
+% \end{macrocode}
+
+% \subsection{Select all}
+% \DescribeEnv{selectAll}{A multiple-multiple choice question}
+% \begin{macrocode}
+%<*classXimera>
+\newenvironment{selectAll}[1][]
+{\begin{trivlist}\item[\hskip \labelsep\small\bfseries Select All Correct Answers:]\hfil\begin{enumerate}}
+ {\end{enumerate}\end{trivlist}}
+%</classXimera>
+% \end{macrocode}
+
+% In the future we need this to (optionally) be displayed in the
+% problem, while the actual code lives in the solution. Here is how
+% this could be implemented: Like the title/maketitle commands, the
+% multiple-choice could be stored in |\themultiplechoice|, flip a
+% boolean, and execute |\makemultiplechoice| at the |\end| of the
+% problem. We should also make a command called |\showchoices| that
+% will show choices in the handout.
+
+% On the web, |selectAll| is handled just like |multipleChoice|.
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{selectAll}{\refstepcounter{problem}}{}%
+\ConfigureEnv{selectAll}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="select-all" id="problem\arabic{identification}">}}{\HCode{</div>}\IgnoreIndent}{}{}
+%</htXimera>
+% \end{macrocode}
+
+
diff --git a/macros/latex/contrib/ximera/src/clearEnv.dtx b/macros/latex/contrib/ximera/src/clearEnv.dtx
new file mode 100644
index 0000000000..af906995d9
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/clearEnv.dtx
@@ -0,0 +1,18 @@
+% \subsubsection{clearEnv}
+% \DescribeMacro{clearEnv}{envName}
+% This macro allows you to delete an environment by redefining it as null. This also deletes any corresponding internal counter - such as those generated by "\newtheorem" command.
+% #1 is envName is the name of the environment you want to clear. This will (re)define the
+% begin and end environments, as well as the internal counter from \newtheoremenv to \relax.
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\clearEnv}[1]{
+ %% Syntax: \clearEnv{envName}
+ % #1 is envName is the name of the environment you want to clear. This will (re)define the
+ % begin and end environments, as well as the internal counter from \newtheoremenv to \relax.
+ \expandafter\let\csname #1\endcsname\relax
+ \expandafter\let\csname end#1\endcsname\relax
+ \expandafter\let\csname c@#1\endcsname\relax
+ }
+%</classXimera>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/dialogue.dtx b/macros/latex/contrib/ximera/src/dialogue.dtx
new file mode 100644
index 0000000000..b4b31580df
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/dialogue.dtx
@@ -0,0 +1,28 @@
+% \subsubsection{Dialogues}
+% \DescribeEnv{dialogue}{A dialogue between people.}
+% \begin{macrocode}
+%<*classXimera>
+\newenvironment{dialogue}{%
+ \renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textbf{##1:}}
+ \begin{description}%
+}{%
+ \end{description}%
+}
+%</classXimera>
+% \end{macrocode}
+% On the web, the resulting |<dl>| should have an appropriate |class| set.
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{dialogue}{\begin{description}}{\end{description}}
+
+\ConfigureList{dialogue}%
+ {\EndP\HCode{<dl \a:LRdir class="dialogue">}%
+ \PushMacro\end:itm
+\global\let\end:itm=\empty}
+ {\PopMacro\end:itm \global\let\end:itm \end:itm
+\EndP\HCode{</dd></dl>}\ShowPar}
+ {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
+ class="actor">}\bgroup \bf}
+ {\egroup\EndP\HCode{</dt><dd\Hnewline class="speech">}}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/ending.dtx b/macros/latex/contrib/ximera/src/ending.dtx
new file mode 100644
index 0000000000..8f53a0fd27
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/ending.dtx
@@ -0,0 +1,20 @@
+% \subsubsection{The End}
+% It seems that some of the files need to conclude with something or another.
+% \begin{macrocode}
+%<*htXimera>
+\Hinput{ximera}
+%</htXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXourse>
+\Hinput{xourse}
+%</htXourse>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*cfgXimera>
+\begin{document}
+\EndPreamble
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/enumerate.dtx b/macros/latex/contrib/ximera/src/enumerate.dtx
new file mode 100644
index 0000000000..7c37e9743e
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/enumerate.dtx
@@ -0,0 +1,10 @@
+% \subsubsection{Enumerate fixes}
+% Make enumerate use a letter
+% \begin{macrocode}
+%<*classXimera>
+\renewcommand{\theenumi}{\textup{(\alph{enumi})}}
+\renewcommand{\labelenumi}{\theenumi}
+\renewcommand{\theenumii}{\textup{(\roman{enumii})}}
+\renewcommand{\labelenumii}{\theenumii}
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/feedback.dtx b/macros/latex/contrib/ximera/src/feedback.dtx
new file mode 100644
index 0000000000..03d09770b8
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/feedback.dtx
@@ -0,0 +1,72 @@
+% \subsubsection{Feedback}
+% \DescribeEnv{feedback}{An initially hidden environment that uncovers itself at an appropriate time.}
+% New Validator rewrite code added by Jason Nowell. Original code
+% orovided by Jim Fowler Validator is an environment designed to run a
+% custom check on answers (usually) using javascript code.
+%
+% Define a placeholder command for validator and feedback.
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\PH@Command}{}
+% \end{macrocode}
+% Validator should take an argument and detokenize it and display it
+% at the start of the environment. The original Validator environment
+% had everything framed in an mbox; presumably to make the text look
+% a bit nicer, although this seems redundant with |texttt|. It
+% shouldn't cause any harm so I have left it in for now.
+% \begin{macrocode}
+\newenvironment{validator}[1][]{
+ \def\PH@Command{#1}% Use PH@Command to hold the content and be a target for "\expandafter" to expand once.
+ \mbox{\texttt{\detokenize\expandafter{\PH@Command}}}% Now expand PH@Command once and then detokenize.
+ }{}
+% \end{macrocode}
+% First, if it's a handout, we want feedback to eat everything and
+% then disappear entirely. So we do this:
+% \begin{macrocode}
+\ifhandout%
+\newenvironment{feedback}
+ {%
+ \setbox0\vbox\bgroup
+ }
+ {%
+ \egroup
+ }
+% \end{macrocode}
+% If this isn't a handout, then we want to display the Feedback by
+% using a label, positioned and formated as a |\item| in a
+% trivlist. It is important that we also detokenize the content of
+% the optional argument, as it is likely to contain javascript or
+% other code that latex won't be able to make sense of.
+% \begin{macrocode}
+\else
+% \end{macrocode}
+% \begin{macrocode}
+\newenvironment{feedback}[1][attempt]{
+
+ \def\PH@Command{#1}% Use PH@Command to hold the content and be a target for "\expandafter" to expand once.
+
+ \begin{trivlist}% Begin the trivlist to use formating of the "Feedback" label.
+ \item[\hskip \labelsep\small\slshape\bfseries Feedback% Format the "Feedback" label. Don't forget the space.
+ (\texttt{\detokenize\expandafter{\PH@Command}}):% Format (and detokenize) the condition for feedback to trigger
+ \hspace{2ex}]\small\slshape% Insert some space before the actual feedback given.
+ }{
+ \end{trivlist}
+ }
+
+\fi
+%</classXimera>
+% \end{macrocode}
+% Feedback environments take an optional parameter (which describes
+% when the feedback is to be provided)
+% \begin{macrocode}
+%<*htXimera>
+\def\feedback{\@ifnextchar[{\@feedbackcode}{\@feedbackattempt}}
+\def\@feedbackattempt{\@feedbackcode[attempt]}
+\def\@feedbackcode[#1]{\stepcounter{identification}%
+\ifvmode \IgnorePar\fi \EndP%
+\ifthenelse{\equal{#1}{attempt}}{\HCode{<div class="feedback" data-feedback="attempt" id="feedback\arabic{identification}">}}%
+{\ifthenelse{\equal{#1}{correct}}{\HCode{<div class="feedback" data-feedback="correct" id="feedback\arabic{identification}">}}%
+{\HCode{<div class="feedback" data-feedback="script" id="feedback\arabic{identification}"><script type="text/javascript">function feedback\arabic{identification}() }\{\HCode{ return \detokenize{#1}; }\}\HCode{</script>}}}}
+\def\endfeedback{\HCode{</div>}\IgnoreIndent}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/foldable.dtx b/macros/latex/contrib/ximera/src/foldable.dtx
new file mode 100644
index 0000000000..94c5eb36cb
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/foldable.dtx
@@ -0,0 +1,76 @@
+% \subsubsection{Foldable}
+% The package \verb|mdframed| is used to make pretty foldable, but the
+% amsthm/mdframed conflict also messes up the .jax file so we don't
+% load mdframed when performing the xake step. But even the below
+% isn't enough to fix this.
+% \begin{macrocode}
+%\iftikzexport\else\RequirePackage[framemethod=TikZ]{mdframed}\fi
+% \end{macrocode}
+% \DescribeEnv{foldable}{Does it fold?}
+% \begin{macrocode}
+%<*classXimera>
+
+\colorlet{textColor}{black} % since textColor is referenced below
+\colorlet{background}{white} % since background is referenced below
+
+% The core environments. Find results in 4ht file.
+%% pretty-foldable
+%\iftikzexport
+\newenvironment{foldable}{%
+}{%
+}
+%\else
+%\renewmdenv[
+% font=\upshape,
+% outerlinewidth=3,
+% topline=false,
+% bottomline=false,
+% leftline=true,
+% rightline=false,
+% leftmargin=0,
+% innertopmargin=0pt,
+% innerbottommargin=0pt,
+% skipbelow=\baselineskip,
+% linecolor=textColor!20!white,
+% fontcolor=textColor,
+% backgroundcolor=background
+%]{foldable}%
+%\fi
+
+%% pretty-expandable
+%\iftikzexport
+\newenvironment{expandable}{%
+}{%
+}
+%\else
+%\newmdenv[
+% font=\upshape,
+% outerlinewidth=3,
+% topline=false,
+% bottomline=false,
+% leftline=true,
+% rightline=false,
+% leftmargin=0,
+% innertopmargin=0pt,
+% innerbottommargin=0pt,
+% skipbelow=\baselineskip,
+% linecolor=black,
+%]{expandable}%
+%\fi
+
+\newcommand{\unfoldable}[1]{#1}
+
+%</classXimera>
+% \end{macrocode}
+% On the web, these foldable elements could be HTML5 details and summary.
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{foldable}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div id="foldable\arabic{identification}" class="foldable">}}{\HCode{</div>}\IgnoreIndent}
+
+\renewenvironment{expandable}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div data-original="expandable" id="foldable\arabic{identification}" class="foldable">}
+
+}{\HCode{</div>}\IgnoreIndent}
+
+\renewcommand{\unfoldable}[1]{\HCode{<span class="unfoldable">}#1\HCode{</span>}}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/footnotes.dtx b/macros/latex/contrib/ximera/src/footnotes.dtx
new file mode 100644
index 0000000000..cd37a086e4
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/footnotes.dtx
@@ -0,0 +1,63 @@
+% \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{
+ <script type="text/javascript">
+ 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";
+ }
+ }
+ </script>
+ }
+ %% 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{
+ <span style=
+ "position=relative;
+ vertical-align=baseline;"
+ >
+ <button onclick="footnotefunction('footnote\roman{footnoteNum}')"
+ style=
+ "background:none!important;
+ color:inherit;
+ border:none;
+ padding:0!important;
+ font: inherit;
+ cursor: pointer;"
+ >
+ <sup>}[\arabic{footnoteNum}]\HCode{</sup></button>
+ }
+ %% 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{
+ <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;"
+ >
+ }
+ \textcolor{fncolor}{(#1)}% Display the actual footnote here with color `fncolor' and within ()'s.
+ \HCode{</span></span>}
+ }% End of footnote definition.
+%</htXimera>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/freeresponse.dtx b/macros/latex/contrib/ximera/src/freeresponse.dtx
new file mode 100644
index 0000000000..2fe03c5287
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/freeresponse.dtx
@@ -0,0 +1,60 @@
+% \subsubsection{Free response}
+% \DescribeEnv{freeResponse}{A freeform input box.}
+% \begin{macrocode}
+%<*classXimera>
+\newboolean{given} %% required for freeResponse
+\setboolean{given}{true} %% could be replaced by a key=value pair later if needed
+
+\ifhandout
+ \newenvironment{freeResponse}[1][false]%
+ {%
+ \def\givenatend{\boolean{#1}}
+ \ifthenelse{\boolean{#1}}
+ {% Begin then result
+ \begin{trivlist}
+ \item
+ }% End then result
+ {% Begin else result
+ \setbox0\vbox\bgroup
+ }% End else result
+% {}% Don't think this is doing anything? -- Jason
+ }
+ {%
+ \ifthenelse{\givenatend}
+ {% Begin then result
+ \end{trivlist}
+ }% End then result
+ {% Begin else result
+ \egroup
+ }% End else result
+% {}% Don't think this is doing anything? -- Jason
+ }
+\else
+ \newenvironment{freeResponse}[1][false]%
+ {% Environment Beginning Code
+ \ifthenelse{\boolean{#1}}%% Could probably change this with just putting the (given) in the boolean?-- Jason
+ {% Begin then result
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Free Response (Given):\hspace{2ex}]
+ }% End then result
+ {% Begin else result
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Free Response:\hspace{2ex}]
+ }% End else result
+ }
+ {% Environment Ending Code
+ \end{trivlist}
+ }
+\fi
+
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+
+\renewenvironment{freeResponse}{\refstepcounter{problem}}{}%
+\ConfigureEnv{freeResponse}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="free-response" id="problem\arabic{identification}">}}{\HCode{</div>}\IgnoreIndent}{}{}%
+
+%</htXimera>
+% \end{macrocode} \ No newline at end of file
diff --git a/macros/latex/contrib/ximera/src/graded.dtx b/macros/latex/contrib/ximera/src/graded.dtx
new file mode 100644
index 0000000000..24ec67052d
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/graded.dtx
@@ -0,0 +1,20 @@
+% \subsection{Grading by points}
+% \DescribeEnv{graded}{The |graded| environment does nothing in latex,
+% but in html, it wraps the activities in a div in order to assign
+% some weight to them for grading.}
+% \begin{macrocode}
+%<*classXourse>
+\newenvironment{graded}[1]{}{}
+%</classXourse>
+% \end{macrocode}
+% So indeed this environment in html wraps the activities in a div in
+% order to assign some number of points to them.
+% \begin{macrocode}
+%<*htXourse>
+\renewenvironment{graded}[1]{%
+\ifvmode \IgnorePar\fi \EndP\HCode{<div class="graded" data-weight="#1">}\IgnoreIndent%
+}{
+\ifvmode \IgnorePar\fi \EndP\HCode{</div>}\IgnoreIndent%
+}
+%</htXourse>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/hideEnv.dtx b/macros/latex/contrib/ximera/src/hideEnv.dtx
new file mode 100644
index 0000000000..5abcdfb0c0
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/hideEnv.dtx
@@ -0,0 +1,36 @@
+% \subsubsection{hideEnv}
+% \DescribeMacro{hideEnv}[replacementCode]{environmentName}
+% This macro allows you to hide an environment by name, ensuring it - and all its contents - are no longer visible on the pdf output. It also allows you an optional input to replace the block of content with new (uniform) content if desired.
+% #1 is replacementCode and is optional. This will be code that is executed when the env is executed,
+% even though the content of the environment is hidden.
+% #2 is the name of the environment which gets hidden.
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\hideEnv}[2][]{
+ %% Syntax: \hideEnv[NewCode]{environmentName}
+
+ \expandafter\def\csname temp@#2\endcsname\csname #2\endcsname
+ \expandafter\def\csname temp@end#2\endcsname\csname end#2\endcsname
+ \expandafter\def\csname#2\endcsname{
+ \ifnum\value{depth@Check}<1
+ Suppress Should start here.
+ \suppress
+ \fi
+ \stepcounter{depth@Check}
+
+% Current Depth reported as: \arabic{depth@Check}
+ }
+ \expandafter\def\csname end#2\endcsname{
+ \addtocounter{depth@Check}{-1}
+ \ifnum\value{depth@Check}<1
+ Suppress Should End Here.
+ \endsuppress
+ \fi
+
+% Current Depth reported as: \arabic{depth@Check}
+ \noexpand{#1}
+ }
+ }
+%</classXimera>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/hints.dtx b/macros/latex/contrib/ximera/src/hints.dtx
new file mode 100644
index 0000000000..b777bd8235
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/hints.dtx
@@ -0,0 +1,53 @@
+% \subsubsection{Hints}
+% \DescribeEnv{hint}{Hint environments can be embedded inside problems.}
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+% Create a counter that will track how deeply nested the current hint is
+% \begin{macrocode}
+\newcounter{hintLevel}
+\setcounter{hintLevel}{0}
+% \end{macrocode}
+% Create an empty shell to renew
+% \begin{macrocode}
+\newenvironment{hint}{}{}
+% \end{macrocode}
+% Now we renew the environment as needed, this should allow support
+% for any transition code that treats some parts as a "handout" and
+% some parts as non-handout. renewing the environment on the fly is a
+% bit hacky.
+% \begin{macrocode}
+\renewenvironment{hint}
+ {
+ \ifhandout
+ \setbox0\vbox\bgroup
+ \else
+ \begin{trivlist}\item[\hskip \labelsep\small\slshape\bfseries Hint:\hspace{2ex}]
+ \small\slshape
+ \fi
+% \end{macrocode}
+% Step up hint level to track the nested level of the hint. This will be used for problem numbering.
+% \begin{macrocode}
+ \stepcounter{hintLevel}
+ }
+ {
+ \ifhandout
+ \egroup\ignorespacesafterend
+ \else
+ \end{trivlist}
+ \fi
+% \end{macrocode}
+% Detract from hint level counter to track hint nested level
+% \begin{macrocode}
+ \addtocounter{hintLevel}{-1}
+ }
+
+\ifhints
+ \renewenvironment{hint}{
+ \begin{trivlist}\item[\hskip \labelsep\small\slshape\bfseries Hint:\hspace{2ex}]
+ \small\slshape}
+ {\end{trivlist}}
+\fi
+
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/html.dtx b/macros/latex/contrib/ximera/src/html.dtx
new file mode 100644
index 0000000000..8c0b458bf1
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/html.dtx
@@ -0,0 +1,20 @@
+% \subsubsection{Semantic HTML}
+% \DescribeMacro{\textbf}{Using \verb|\textbf| emits a \verb|<strong>| tag.}
+% \begin{macrocode}
+%<*cfgXimera>
+\Configure{textbf}{\ifvmode\ShowPar\fi\HCode{<strong>}}{\HCode{</strong>}}
+%</cfgXimera>
+% \end{macrocode}
+% \DescribeMacro{\textit}{Using \verb|\textit| or similar emits an \verb|<em>| tag.}
+% \begin{macrocode}
+%<*cfgXimera>
+\Configure{textit}{\ifvmode\ShowPar\fi\HCode{<em>}}{\HCode{</em>}}
+\Configure{emph}{\ifvmode\ShowPar\fi\HCode{<em>}}{\HCode{</em>}}
+%</cfgXimera>
+% \end{macrocode}
+% \DescribeMacro{\texttt}{Using \verb|\texttt| emits a \verb|<code>| tag.}
+% \begin{macrocode}
+%<*cfgXimera>
+\Configure{texttt}{\ifvmode\ShowPar\fi\HCode{<code>}}{\HCode{</code>}}
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/hyperref.dtx b/macros/latex/contrib/ximera/src/hyperref.dtx
new file mode 100644
index 0000000000..d035b4d976
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/hyperref.dtx
@@ -0,0 +1,12 @@
+% We put hyperref after all other packages becuase that is better.
+% \begin{macrocode}
+%<*classXimera>
+% Don't use hyperref when using Tex4ht
+\ifdefined\HCode
+\RequirePackage{hyperref}
+\else
+\RequirePackage[pdfpagelabels,colorlinks=true,allcolors=blue!30!black]{hyperref}
+\pdfstringdefDisableCommands{\def\hskip{}}%% quiets warning
+\fi
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/image.dtx b/macros/latex/contrib/ximera/src/image.dtx
new file mode 100644
index 0000000000..e8e0a96e5a
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/image.dtx
@@ -0,0 +1,60 @@
+% \subsubsection{Images}
+% \DescribeEnv{image}{Place images inside an |image| environment. On paper, this centers the image. On the web, this provides additional benefits.}
+% \begin{macrocode}
+%<*classXimera>
+%\newenvironment{image}[1][]{\begin{center}}{\end{center}}
+\NewEnviron{image}[1][3in]{%
+ \begin{center}\resizebox{#1}{!}{\BODY}\end{center}% resize and center
+}
+%</classXimera>
+% \end{macrocode}
+% \DescribeMacro{\alt}{Inside an |image| environment, |\alt| provides alt-text for assistive technology like screenreaders.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\alt}[1]{}
+%</classXimera>
+% \end{macrocode}
+% The |image| environment doesn't actually work in tex4ht as defined
+% with NewEnviron; so this renewenvironment is needed.
+% image-environment also gets formatted in a well, and when the user
+% clicks on the image, it zooms in.
+% \begin{macrocode}
+%<*htXimera>
+\newcounter{imagealt}
+\setcounter{imagealt}{0}
+\renewenvironment{image}[1][]{\stepcounter{imagealt}%
+ \ifvmode \IgnorePar\fi \EndP%
+ \HCode{<div class="image-environment" role="img" aria-labelledby="image-alt-\arabic{imagealt}">}%
+}{\HCode{</div>}}
+\renewcommand{\alt}[1]{\HCode{<div style="display: none;" id="image-alt-\arabic{imagealt}">}#1\HCode{</div>}}
+%</htXimera>
+% \end{macrocode}
+% Although we accept many formats, SVG is preferred on the web.
+% Since we have a different mechanism for producing |alt| text, we
+% want to ignore tex4ht's own method fo producing alt text.
+% \begin{macrocode}
+%<*cfgXimera>
+\DeclareGraphicsExtensions{.jpg,.png,.gif,.svg}
+\Configure{graphics*}
+{svg}{
+ {\Configure{Needs}{File: \Gin@base.svg}\Needs{}}
+ \Picture[]{\csname Gin@base\endcsname.svg \csname a:Gin-dim\endcsname}%
+}
+%</cfgXimera>
+% \end{macrocode}
+% This is a hack to kill |includegraphics| commands in
+% |\documentclass{standalone}| files
+% \begin{macrocode}
+%<*cfgXimera>
+\ifcsname ifstandalone\endcsname
+ \ifstandalone
+ \renewcommand\includegraphics[2][]{}
+ \fi
+%</cfgXimera>
+% \end{macrocode}
+% PGF sometimes causes trouble, but we simply don't care in tex4ht mode.
+% \begin{macrocode}
+%<*htXimera>
+\newcommand{\pgfsyspdfmark}[3]{}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/instructornotes.dtx b/macros/latex/contrib/ximera/src/instructornotes.dtx
new file mode 100644
index 0000000000..c175319f69
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/instructornotes.dtx
@@ -0,0 +1,101 @@
+% \subsubsection{Instructor notes}
+% \begin{macrocode}
+%<*classXimera>
+
+%% instructor intro/instructor notes
+%%
+\ifhandout % what follows is handout behavior
+ \ifinstructornotes
+ \newenvironment{instructorIntro}%
+ {%
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Instructor Introduction:\hspace{2ex}]
+ }
+ % %% line at the bottom}
+ {
+ \end{trivlist}
+ \par\addvspace{.5ex}\nobreak\noindent\hung
+ }
+ \else
+ \newenvironment{instructorIntro}%
+ {%
+ \setbox0\vbox\bgroup
+ }
+ {%If this mysteriously starts breaking
+ % remove \ignorespacesafterend
+ \egroup\ignorespacesafterend
+ }
+ \fi
+\else% for handout, so what follows is default
+\ifinstructornotes
+ \newenvironment{instructorIntro}%
+ {%
+ \setbox0\vbox\bgroup
+ }
+ {%
+ \egroup
+ }
+ \else
+ \newenvironment{instructorIntro}%
+ {%
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Instructor Introduction:\hspace{2ex}]
+ }
+ % %% line at the bottom}
+ {
+ \end{trivlist}
+ \par\addvspace{.5ex}\nobreak\noindent\hung
+ }
+ \fi
+\fi
+
+
+
+
+%% instructorNotes environment
+\ifhandout % what follows is handout behavior
+\ifinstructornotes
+\newenvironment{instructorNotes}%
+ {%
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Instructor Notes:\hspace{2ex}]
+ }
+ % %% line at the bottom}
+ {
+ \end{trivlist}
+ \par\addvspace{.5ex}\nobreak\noindent\hung
+ }
+ \else
+ \newenvironment{instructorNotes}%
+ {%
+ \setbox0\vbox\bgroup
+ }
+ {%
+ \egroup
+ }
+ \fi
+\else% for handout, so what follows is default
+\ifinstructornotes
+\newenvironment{instructorNotes}%
+ {%
+ \setbox0\vbox\bgroup
+ }
+ {%
+ \egroup
+ }
+ \else
+ \newenvironment{instructorNotes}%
+ {%
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Instructor Notes:\hspace{2ex}]
+ }
+ % %% line at the bottom}
+ {
+ \end{trivlist}
+ \par\addvspace{.5ex}\nobreak\noindent\hung
+ }
+ \fi
+ \fi
+
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/interactives/desmos.dtx b/macros/latex/contrib/ximera/src/interactives/desmos.dtx
new file mode 100644
index 0000000000..9a55db8f43
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/desmos.dtx
@@ -0,0 +1,14 @@
+% \subsubsection{Desmos}
+% \DescribeMacro{\desmos}{Desmos command. Requires id, width, and height as arguments.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\desmos}[3]{Desmos link: \url{https://www.desmos.com/calculator/#1}}
+\newcommand{\desmosThreeD}[3]{Desmos3D link: \url{https://www.desmos.com/3d/#1}}
+%</classXimera>
+% \end{macrocode}
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\desmos}[3]{\HCode{<iframe src="https://www.desmos.com/calculator/#1" width="100\%" height="#3px" style="border: 1px solid \#ccc" frameborder=0>This browser does not support embedded elements.</iframe>}}
+\renewcommand{\desmosThreeD}[3]{\HCode{<iframe src="https://www.desmos.com/3d/#1" width="#2px" height="#3px" style="border: 1px solid \#ccc" frameborder=0>This browser does not support embedded elements.</iframe>}}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/interactives/geogebra.dtx b/macros/latex/contrib/ximera/src/interactives/geogebra.dtx
new file mode 100644
index 0000000000..696ac32236
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/geogebra.dtx
@@ -0,0 +1,27 @@
+% \subsubsection{Geogebra}
+% \DescribeMacro{\geogebra}{Geogebra command. Requires id, width, and
+% height as arguments.}
+% \begin{macrocode}
+%<*classXimera>
+%Geogebra link
+\newcommand{\geogebra}[3]{Geogebra link: \url{https://www.geogebra.org/m/#1}}
+%</classXimera>
+% \end{macrocode}
+% Define keys for answer geogebra key=value pairs.
+% \begin{macrocode}
+%<*htXimera>
+\define@key{geogebra}{rc}[true]{\def\geo@rc{#1}}
+\define@key{geogebra}{sdz}[true]{\def\geo@sdz{#1}}
+\define@key{geogebra}{smb}[true]{\def\geo@smb{#1}}
+\define@key{geogebra}{stb}[true]{\def\geo@stb{#1}}
+\define@key{geogebra}{stbh}[true]{\def\geo@stbh{#1}}
+\define@key{geogebra}{ld}[true]{\def\geo@ld{#1}}
+\define@key{geogebra}{sri}[true]{\def\geo@sri{#1}}
+%set default key values
+\setkeys{geogebra}{rc=false,sdz=false,smb=false,stb=false,stbh=false,ld=false,sri=false}
+%command definition
+\renewcommand{\geogebra}[4][]{%
+ \setkeys{geogebra}{#1}% Set new keys
+ \HCode{<iframe scrolling="no" src="https://www.geogebra.org/material/iframe/id/#2/width/#3/height/#4/border/888888/rc/\geo@rc/ai/false/sdz/\geo@sdz/smb/\geo@smb/stb/\geo@stb/stbh/\geo@stbh/ld/\geo@ld/sri/\geo@sri/at/auto" width="#3px" height="#4px" style="border:0px; max-width: fit-content"> </iframe>}}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/interactives/google.dtx b/macros/latex/contrib/ximera/src/interactives/google.dtx
new file mode 100644
index 0000000000..cbe75498f1
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/google.dtx
@@ -0,0 +1,26 @@
+% \subsubsection{Google Sheet}
+% \DescribeMacro{\googleSheet}{googleSheet command. Requires id,
+% width, and height as arguments. optional arguments are gid for
+% sheet ID and range for cell range. command definition}
+% \begin{macrocode}
+%<*classXimera>
+% Google Spreadsheet link (read only)
+\newcommand{\googleSheet}[5]{%
+ Google Spreadsheet link: \url{https://docs.google.com/spreadsheets/d/#1}%
+}
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\googleSheet}[5]{%
+ \ifthenelse{\equal{#4}{}}%
+ {\HCode{<iframe width="#2px" height="#3px" src="https://docs.google.com/spreadsheets/d/#1/htmlembed?widget=true">This browser does not support embedded elements.</iframe>}}%
+ {\ifthenelse{\equal{#5}{}}%
+ {\HCode{<iframe width="#2px" height="#3px" src="https://docs.google.com/spreadsheets/d/#1/htmlembed?single=true&amp;gid=#4&amp;widget=false">This browser does not support embedded elements.</iframe>}}%
+ {\HCode{<iframe width="#2px" height="#3px" src="https://docs.google.com/spreadsheets/d/#1/htmlembed?single=true&amp;gid=#4&amp;range=#5&amp;widget=false">This browser does not support embedded elements.</iframe>}}%
+ }%
+ }%
+%</htXimera>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/interactives/graph.dtx b/macros/latex/contrib/ximera/src/interactives/graph.dtx
new file mode 100644
index 0000000000..154c2803af
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/graph.dtx
@@ -0,0 +1,14 @@
+% \subsubsection{Graphs}
+% \DescribeMacro{\graph}{An embedded graph (in math mode).}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\graph}[2][]{\text{Graph of $#2$}}
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\graph}[2][]{\HCode{<div class="graph" data-options="#1">}#2\HCode{</div>}}
+%</htXimera>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/interactives/include.dtx b/macros/latex/contrib/ximera/src/interactives/include.dtx
new file mode 100644
index 0000000000..76eaa0dd6f
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/include.dtx
@@ -0,0 +1,22 @@
+% \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}
+%<*classXimera>
+\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
+}
+%</classXimera>
+% \end{macrocode}
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\includeinteractive}[2][]{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div id="interactive\arabic{identification}" class="interactive"> </div>}\HCode{<script src="#2" data-argument="#1" data-target="interactive\arabic{identification}"> </script>}\IgnoreIndent}
+%</htXimera>
+% \end{macrocode}
+
+
diff --git a/macros/latex/contrib/ximera/src/interactives/javascript.dtx b/macros/latex/contrib/ximera/src/interactives/javascript.dtx
new file mode 100644
index 0000000000..c67a7e5235
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/javascript.dtx
@@ -0,0 +1,31 @@
+% \subsubsection{JavaScript}
+
+% \DescribeEnv{javascript}{Code inside a javascript environment is printed on paper, but executed on the web.}
+
+% \begin{macrocode}
+%<*classXimera>
+\DefineVerbatimEnvironment{javascript}{Verbatim}{numbers=left,frame=lines,label=JavaScript,labelposition=topline}
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+% for programming javascript
+\renewenvironment{javascript}{\NoFonts}{\EndNoFonts}
+\ScriptEnv{javascript}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="javascript" id="javascript\arabic{identification}"><script type="text/javascript">}\HtmlParOff}{\HtmlParOn\HCode{</script></div>}}
+%</htXimera>
+% \end{macrocode}
+
+% \DescribeMacro{\js}{Code inside a |\js| macro is evaluated and replaced with its value.}
+% \begin{macrocode}
+%<*classXimera>
+\def\js#1{\mbox{\texttt{\detokenize{#1}}}}
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+\def\js#1{\stepcounter{identification}\HCode{<span class="inline-javascript" id="javascript\arabic{identification}"><script type="text/javascript"> function javascript\arabic{identification}() }\{\HCode{ return \detokenize{#1}; }\}\HCode{</script></span>}}
+%</htXimera>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/interactives/sagemath.dtx b/macros/latex/contrib/ximera/src/interactives/sagemath.dtx
new file mode 100644
index 0000000000..95d378afde
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/sagemath.dtx
@@ -0,0 +1,43 @@
+% \subsection{SageMath support}
+% Load Sage\TeX\ if it exists.
+% \begin{macrocode}
+%<*classXimera>
+\IfFileExists{sagetex.sty}{\RequirePackage{sagetex}}{}
+%</classXimera>
+% \end{macrocode}
+
+% \DescribeEnv{sageCell}{Create an interactive SageMath widget.}
+% \begin{macrocode}
+%<*classXimera>
+\DefineVerbatimEnvironment{sageCell}{Verbatim}{numbers=left,frame=lines,label=SAGE,labelposition=topline}
+%</classXimera>
+% \end{macrocode}
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{sageCell}{\NoFonts}{\EndNoFonts}
+\ScriptEnv{sageCell}{\ifvmode \IgnorePar\fi \EndP\HCode{<div class="sage"><script type="text/x-sage">}\HtmlParOff}{\HtmlParOn\HCode{\Hnewline</script></div>}}
+%</htXimera>
+% \end{macrocode}
+
+% \DescribeEnv{sageOutput}{Execute SageMath code and output the result.}
+% \begin{macrocode}
+%<*classXimera>
+\DefineVerbatimEnvironment{sageOutput}{Verbatim}{numbers=left,frame=lines,label=SAGE-Output,labelposition=topline}
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{sageOutput}{\NoFonts}{\EndNoFonts}
+\ScriptEnv{sageOutput}{\ifvmode \IgnorePar\fi \EndP\HCode{<div class="sageOutput"><script type="text/x-sage">}}{\HCode{\Hnewline</script></div>}}
+%</htXimera>
+% \end{macrocode}
+
+% \DescribeEnv{sageSilent}{Execute SageMath code without outputing the result.}
+% \begin{macrocode}
+%<*htXimera>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\renewenvironment{sagesilent}{\NoFonts}{\EndNoFonts}
+\ScriptEnv{sagesilent}{\ifvmode \IgnorePar\fi \EndP\HCode{<script type="text/sagemath">}\HtmlParOff}{\HtmlParOn\HCode{</script></div>}}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/interactives/video.dtx b/macros/latex/contrib/ximera/src/interactives/video.dtx
new file mode 100644
index 0000000000..7f7979db3f
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/interactives/video.dtx
@@ -0,0 +1,21 @@
+% \subsubsection{Video}
+% \DescribeMacro{\youtube}{Youtube command. Requires id.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\youtube}[1]{YouTube link: \url{https://www.youtube.com/watch?v=#1}}
+%</classXimera>
+% \end{macrocode}
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\youtube}[1]{\ifvmode \IgnorePar\fi \EndP\HCode{<div class="video youtube-player" data-youtube="#1">_</div>}}
+%</htXimera>
+% \end{macrocode}
+% Video commands are also emitted, slightly differently, when placed
+% at top-level in a xourse file.
+% \begin{macrocode}
+%<*htXourse>
+\renewcommand\youtube[1]{%
+\ifvmode \IgnorePar\fi \EndP\HCode{<a class="youtube" href="https://www.youtube.com/watch?v=#1">#1</a>}\IgnoreIndent%
+}
+%</htXourse>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/jax.dtx b/macros/latex/contrib/ximera/src/jax.dtx
new file mode 100644
index 0000000000..5441a139e1
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/jax.dtx
@@ -0,0 +1,115 @@
+% \subsubsection{MathJax support}
+% When using mathjax, dump all the |\newcommand|s to a |.jax| file.
+%
+% First, create the |.jax| file.
+% \begin{macrocode}
+%<*classXimera>
+\ifdefined\HCode
+ \else
+ \newwrite\myfile
+ \immediate\openout\myfile=\jobname.jax
+\fi
+%</classXimera>
+% \end{macrocode}
+% From |only.dtx| we must also create |prompt| on the MathJax side.
+% \begin{macrocode}
+%<*classXimera>
+\ifdefined\HCode
+ \else
+ \immediate\write\myfile{\unexpanded{\newenvironment}{prompt}{}{}}
+\fi
+%</classXimera>
+% \end{macrocode}
+% Redefine newcommand appropriately.
+% \begin{macrocode}
+%<*classXimera>
+\ifdefined\HCode
+ \else
+\let\@oldargdef\@argdef
+\long\def\@argdef#1[#2]#3{%
+\immediate\write\myfile{\unexpanded{\newcommand}{\unexpanded{#1}}[\unexpanded{#2}]{\unexpanded{#3}}}%
+\@oldargdef#1[#2]{#3}%
+}
+
+\let\@OldDeclareMathOperator\DeclareMathOperator
+\renewcommand{\DeclareMathOperator}[2]{\@OldDeclareMathOperator{#1}{#2}\immediate\write\myfile{\unexpanded{\DeclareMathOperator}{\unexpanded{#1}}{\unexpanded{#2}}}}
+
+\fi
+%</classXimera>
+% \end{macrocode}
+% Include the jax'ed newcommands
+% \begin{macrocode}
+%<*cfgXimera>
+% Remove commands that use @
+\immediate\write18{sed -i "/@/d" \jobname.jax}
+% Replace ##1 with #1 and so forth
+\immediate\write18{sed -i "s/\string#\string#\string\\([0-9]\string\\)/\string#\string\\1/g" \jobname.jax}
+
+\Configure{BVerbatimInput}{}{}{}{}
+
+\Configure{verbatiminput}{}{}{}{}
+
+% Instead of a nonbreaking space, use a standard space
+\makeatletter
+\def\FV@Space{\space}
+\makeatother
+
+% Include the mathjax newcommands in a math/tex script right at the beginning of the body
+\Configure{BODY}{%
+\HCode{<body>\Hnewline}%
+\Tg<div class="preamble">%
+\Tg<script type="math/tex">%
+\BVerbatimInput{\jobname.jax}%
+\Tg</script>%
+\IfFileExists{\jobname.ids}{\HCode{<script type="text/javascript">\Hnewline}%
+\BVerbatimInput{\jobname.ids}%
+\HCode{</script>\Hnewline}%
+\Tg</div>%
+}{}
+}{%
+\HCode{</body>\Hnewline}%
+}
+% \end{macrocode}
+% Now I just need to add a newcommand command which outputs the
+% appropriate newcommands to MathJax; then this should be "good
+% enough" for our purposes.
+% \begin{macrocode}
+\newtoks\eqtoks
+\def\AltMath#1${\eqtoks{#1}%
+ \HCode{<script type="math/tex">\the\eqtoks</script>}$}
+\Configure{$}{}{}{\expandafter\AltMath}
+
+\def\AltlMathI#1\){\eqtoks{#1}%
+ \HCode{<script type="math/tex">\the\eqtoks</script>}\)}
+\Configure{()}{\AltlMathI}{}
+
+\def\AltlDisplay#1\]{\eqtoks{#1}%
+ \HCode{<script type="math/tex; mode=display">\the\eqtoks</script>}\]}
+\Configure{[]}{\AltlDisplay}{}
+
+\def\AltlDisplayI#1$${\eqtoks{#1}%
+ \HCode{<script type="math/tex; mode=display">\the\eqtoks</script>}$$}
+\Configure{$$}{}{}{\expandafter\AltlDisplayI}
+% \end{macrocode}
+% Need to turn off htmlpar too, as expained in http://tex.stackexchange.com/questions/204930/vertical-spaces-in-htlatex-scriptenv
+% \begin{macrocode}
+\newcommand\VerbMath[1]{%
+\renewenvironment{#1}{\NoFonts}{\EndNoFonts}
+\ScriptEnv{#1}{\ifvmode \IgnorePar\fi \EndP\HCode{<script type="math/tex; mode=display"> \string\begin{#1}\Hnewline}\HtmlParOff}{\HtmlParOn\HCode{\string\end{#1}</script>}}
+}
+% \end{macrocode}
+% This is a fix for the LAODE book, which uses matlabEquation as if it were an equation
+% \begin{macrocode}
+\ScriptEnv{matlabEquation}{\ifvmode \IgnorePar\fi \EndP\HCode{<script type="math/tex; mode=display"> \string\begin{equation}\Hnewline}\HtmlParOff}{\HtmlParOn\HCode{\string\end{equation}</script>}}
+
+\VerbMath{equation}
+\VerbMath{equation*}
+\VerbMath{align}
+\VerbMath{align*}
+\VerbMath{alignat}
+\VerbMath{alignat*}
+\VerbMath{eqnarray}
+\VerbMath{eqnarray*}
+
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/labels.dtx b/macros/latex/contrib/ximera/src/labels.dtx
new file mode 100644
index 0000000000..05ecf31fc9
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/labels.dtx
@@ -0,0 +1,15 @@
+% \subsubsection{Labels and references}
+% Labels and refs both generate anchors.
+% \DescribeMacro{\label}{A |\label| can be referenced from any file in the xourse.}
+% \begin{macrocode}
+%<*htXimera>
+\let\oldlabel\label
+\renewcommand{\label}[1]{\oldlabel{#1}\HCode{<a class="ximera-label" id="#1"></a>}}
+%</htXimera>
+% \end{macrocode}
+% \DescribeMacro{\ref}{A |\ref| can connect one \TeX\ file to another if they are in the same xourse.}
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\ref}[1]{\HCode{<a class="reference" href="\##1">#1</a>}}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/leash.dtx b/macros/latex/contrib/ximera/src/leash.dtx
new file mode 100644
index 0000000000..b52b5e2bf0
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/leash.dtx
@@ -0,0 +1,18 @@
+% \subsubsection{Leashes}
+% \DescribeEnv{leash}{Put content inside a scrollable box.}
+% \begin{macrocode}
+%<*classXimera>
+
+\newenvironment{leash}[1]{%
+}{%
+}
+
+
+%</classXimera>
+% \end{macrocode}
+
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{leash}[1]{\ifvmode \IgnorePar\fi \EndP\HCode{<div style="overflow: auto; height: #1px">}}{\HCode{</div>}\IgnoreIndent}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/link.dtx b/macros/latex/contrib/ximera/src/link.dtx
new file mode 100644
index 0000000000..9e76659e83
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/link.dtx
@@ -0,0 +1,31 @@
+% Hyperlinks to outside documents
+% \begin{macrocode}
+%<*classXimera>
+\newcommand*{\link}[2][]{#1%
+ \ifthenelse{\equal{#1}{}}%
+ {\footnote{Link: \url{#2}}}%
+ {\footnote{See #1 at \url{#2}}}
+ }
+%</classXimera>
+% \end{macrocode}
+
+
+% \begin{macrocode}
+%<*htXimera>
+% This is a command used in versions of documents created with
+% these classes; in Jim's opinion it should be deprecated for |\href|
+% Bart on the other hand likes |\link|
+\renewcommand*{\link}[2][]{%
+\ifthenelse{\equal{#1}{}}%
+{\url{#2}}
+{\href{#2}{#1}}}
+%\renewcommand*{\link}[2][]{%
+%\ifthenelse{\equal{#1}{}}%
+%{\url{#2}}
+%{\href{#2}{#1}}}
+
+% because hyperref redefines stuff atbegindocument, we do too.
+\AtBeginDocument{\renewcommand{\ref}[1]{\HCode{<a class="reference" href="\##1">#1</a>}}}
+
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/logo.dtx b/macros/latex/contrib/ximera/src/logo.dtx
new file mode 100644
index 0000000000..cbe808502a
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/logo.dtx
@@ -0,0 +1,30 @@
+% \subsection{Logos}
+% \DescribeMacro{\logo}{A logo for the xourse.}
+% \begin{macrocode}
+%<*classXourse>
+\newcommand*{\logo}[1]{%
+ \ifx\@onlypreamble\@notprerr
+ \ClassError{xourse}{logo can only be used in the preamble}
+ {Move your logo command to the preamble}
+ \else %
+ \IfFileExists{#1}%
+ {\gdef\xourse@logo{#1}}%
+ {\ClassError{xourse}{logo file does not exist}
+ {To use logo, make sure that the referenced image file exists}}%
+ \fi%
+}
+
+%</classXourse>
+% \end{macrocode}
+
+% The xourse logo is an |og:image| in the opengraph taxonomy.
+% \begin{macrocode}
+%<*htXourse>
+\Configure{@HEAD}{%
+ \HCode{<meta name="og:image" content="}%
+\ifdefined\xourse@logo%
+ \xourse@logo%
+\fi%
+\HCode{" />\Hnewline}}%
+%</htXourse>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/macros.dtx b/macros/latex/contrib/ximera/src/macros.dtx
new file mode 100644
index 0000000000..0968942be5
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/macros.dtx
@@ -0,0 +1,14 @@
+% \subsubsection{Macros}
+% Makes everymath display style even when inline, could be optional.
+% \begin{macrocode}
+%<*classXimera>
+\everymath{\displaystyle}
+%</classXimera>
+% \end{macrocode}
+% Ok not everything, we also need to configure ``display style'' limits.
+% \begin{macrocode}
+%<*classXimera>
+\let\prelim\lim
+\renewcommand{\lim}{\displaystyle\prelim}
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/makeCounter.dtx b/macros/latex/contrib/ximera/src/makeCounter.dtx
new file mode 100644
index 0000000000..2e898255e7
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/makeCounter.dtx
@@ -0,0 +1,37 @@
+% \subsubsection{Utility macros}
+% These are a list of new utility macros that are generally useful and are loaded after packages and the Tikz Fix.
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+% \begin{macro}{NewCounter}
+% Improved version of |\newcounter| to check for existance before creating a counter to minimize conflicts with packages. Added by Jason Nowell
+% \begin{macrocode}
+\newcommand{\Make@Counter}[1]{% This is an internal macro that should probably be depreciated for the below universal macro.
+% Code located in "Utilitymacros.dtx"
+ \@ifundefined{c@#1}% Check to see if counter exists
+ { % If not, create it and set it to 0.
+ \newcounter{#1}
+ \setcounter{#1}{0}
+ }
+ {%If so, reset to 0.
+ \setcounter{#1}{0}
+ }
+}
+
+\newcommand{\MakeCounter}[1]{%% Code located in "Utilitymacros.dtx"
+% Code located in "Utilitymacros.dtx"
+ \@ifundefined{c@#1}% Check to see if counter exists
+ { % If not, create it and set it to 0.
+ \newcounter{#1}
+ \setcounter{#1}{0}
+ }
+ {%If so, reset to 0.
+ \setcounter{#1}{0}
+ }
+}
+% \end{macrocode}
+%</classXimera>
+% \end{macro}
+
+
+
diff --git a/macros/latex/contrib/ximera/src/metadata.dtx b/macros/latex/contrib/ximera/src/metadata.dtx
new file mode 100644
index 0000000000..5f33cde072
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/metadata.dtx
@@ -0,0 +1,32 @@
+% \subsubsection{Metadata}
+% To encourage authors to include relevant parseable metadata in the
+% preamble, we define some currently ignored commands.
+
+% \DescribeMacro{\license}{In the preamble, use |\license| with an SPDX license expression.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\license}{\excludecomment}
+%</classXimera>
+% \end{macrocode}
+
+% \DescribeMacro{\acknowledgement}{In the preamble, use |\acknowledgement| to credit others who contributed to the intellectual content beside the author.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\acknowledgement}{\excludecomment}
+%</classXimera>
+% \end{macrocode}
+
+% \DescribeMacro{\tag}{In the preamble, a |\tag| provides a free-form taxonomy.}
+% \begin{macrocode}
+%<*classXimera>
+\renewcommand{\tag}{\excludecomment}
+%</classXimera>
+% \end{macrocode}
+% On the HTML side, we mark the file as the appropriate kind of
+% object---either activity or xourse.
+% \begin{macrocode}
+%<*htXourse>
+% Mark this as a xourse file
+\Configure{@HEAD}{\HCode{<meta name="description" content="xourse" />\Hnewline}}
+%</htXourse>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/only.dtx b/macros/latex/contrib/ximera/src/only.dtx
new file mode 100644
index 0000000000..cdb676c90e
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/only.dtx
@@ -0,0 +1,38 @@
+% \subsubsection{Only}
+
+% \DescribeEnv{prompt}{The prompt part for mathmode}
+% \begin{macrocode}
+%<*classXimera>
+\ifxake
+ \newenvironment{prompt}{}{}
+\else
+\ifhandout
+ \NewEnviron{prompt}{}
+% Currently breaks when put in mathmode!
+% \newenvironment{prompt}{\suppress}{\endsuppress}
+\else
+ \newenvironment{prompt}
+ {\bgroup\color{gray!50!black}}
+ {\egroup}
+\fi
+\fi
+% \end{macrocode}
+
+% \DescribeEnv{onlineOnly}{Only display it online}
+% \begin{macrocode}
+\ifhandout
+ \NewEnviron{onlineOnly}{
+ \iftikzexport
+ \BODY
+ \else
+ \fi
+ }
+\else
+ \newenvironment{onlineOnly}
+ {\bgroup\color{red!50!black}}
+ {\egroup}
+\fi
+
+\newcommand{\pdfOnly}[1]{\iftikzexport\else #1\fi}
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/options.dtx b/macros/latex/contrib/ximera/src/options.dtx
new file mode 100644
index 0000000000..7e131bb0ba
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/options.dtx
@@ -0,0 +1,123 @@
+% \subsection{Options for the class}
+% We start by listing the options for the \textsf{ximera} document class. Note, since the \textsf{xourse} class is based on the \textsf{ximera} class, all listed options are available there too.
+%
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+% \begin{macro}{handout}
+% The default behavior of the class is to display \textbf{all} content. This means that if any questions are asked, all answers are shown. Moreover, some content will only have a meaningful presentation when displayed online. When compiled without any options, this content will be shown too. This option will supress such content and generate a reasonable printiable ``handout.''
+% \begin{macrocode}
+\newif\ifhandout
+\handoutfalse
+\DeclareOption{handout}{\handouttrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{noauthor}
+% By default, authors are listed at the bottom of the first page of a document. This option will supress the listing of the authors.
+% \begin{macrocode}
+\newif\ifnoauthor
+\noauthorfalse
+\DeclareOption{noauthor}{\noauthortrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{nooutcomes}
+% By default, learning outcomes are listed at the bottom of the first page of a document. This option will supress the listing of the learning outcomes.
+% \begin{macrocode}
+\newif\ifnooutcomes
+\nooutcomesfalse
+\DeclareOption{nooutcomes}{\nooutcomestrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{instructornotes}
+% This option will turn on (and off) notes written for the instructor.
+% \begin{macrocode}
+\newif\ifinstructornotes
+\instructornotesfalse
+\DeclareOption{instructornotes}{\instructornotestrue}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{noinstructornotes}
+% This option will turn off (and on) notes written for the instructor.
+% \begin{macrocode}
+\DeclareOption{noinstructornotes}{\instructornotestrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{hints}
+% When the \texttt{handout} options is used, hints are not shown. This option will make hints visible in handout mode.
+% \begin{macrocode}
+\newif\ifhints
+\hintsfalse
+\DeclareOption{hints}{\hintstrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{newpage}
+% This option will start each problem-like environment (\texttt{exercise}, \texttt{question}, \texttt{problem}, and \texttt{exploration}) start on a new page.
+% \begin{macrocode}
+\newif\ifnewpage
+\newpagefalse
+\DeclareOption{newpage}{\newpagetrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{numbers}
+% This option will number the titles of the activity. By default the activities are unnumbered.
+% \begin{macrocode}
+\newif\ifnumbers
+\numbersfalse
+\DeclareOption{numbers}{\numberstrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{wordchoicegiven}
+% This option will replace the choices shown by \texttt{wordChoice} with the correct choice. No indication of the \texttt{wordChoice} environment will be shown.
+% \begin{macrocode}
+\newif\ifwordchoicegiven
+\wordchoicegivenfalse
+\DeclareOption{wordchoicegiven}{\wordchoicegiventrue}
+\newif\iffirstinlinechoice% Support for other wordchoice command contents.
+\firstinlinechoicetrue
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+
+\newif\ifxake
+\xakefalse
+\DeclareOption{xake}{\xaketrue}
+
+\newif\iftikzexport
+\tikzexportfalse
+\DeclareOption{tikzexport}{%
+ \tikzexporttrue%
+ \handoutfalse%
+ \numbersfalse%
+ \newpagefalse%
+ \hintsfalse%
+ \nooutcomesfalse%
+}
+
+\DeclareOption*{%
+ \PassOptionsToClass{\CurrentOption}{article}%
+}
+\ProcessOptions\relax
+\LoadClass{article}
+
+\ifdefined\HCode
+ \xaketrue%
+ \tikzexporttrue%
+ \handoutfalse%
+ \numbersfalse%
+ \newpagefalse%
+ \hintsfalse%
+ \nooutcomesfalse%
+\fi
+
+%</classXimera>
+% \end{macrocode}
+
+
+
diff --git a/macros/latex/contrib/ximera/src/optionsxourse.dtx b/macros/latex/contrib/ximera/src/optionsxourse.dtx
new file mode 100644
index 0000000000..1217fce199
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/optionsxourse.dtx
@@ -0,0 +1,27 @@
+% \begin{macrocode}
+%<*classXourse>
+% \end{macrocode}
+% \begin{macro}{notoc}
+% The default behavior of the class is to provide a table of contents listing all activities in the course. This option will supress this table of contents.
+% \begin{macrocode}
+\newif\ifnotoc
+\notocfalse
+\DeclareOption{notoc}{\notoctrue}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{nonewpage}
+% The default behavior of the class is to start each activity on a new page. This option will start activities without making a new page.
+% \begin{macrocode}
+\newif\ifnonewpage
+\nonewpagefalse
+\DeclareOption{nonewpage}{\nonewpagetrue}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ximera}}
+\ProcessOptions\relax
+\LoadClass{ximera}
+% \begin{macrocode}
+%</classXourse>
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/outcomes.dtx b/macros/latex/contrib/ximera/src/outcomes.dtx
new file mode 100644
index 0000000000..1e174b7655
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/outcomes.dtx
@@ -0,0 +1,34 @@
+% \subsubsection{Learning Outcomes}
+% \DescribeMacro{\outcome}{Specify a learning outcome, either at the level of a |problem| or an entire document in the preamble.}
+% \begin{macrocode}
+%<*classXimera>
+\def\theoutcomes{}
+
+\ifdefined\HCode%
+ \newcommand{\outcome}[1]{}
+\else%
+ \newwrite\outcomefile
+ \immediate\openout\outcomefile=\jobname.oc
+
+ \newcommand{\outcome}[1]{\edef\theoutcomes{\theoutcomes #1~}%
+ \immediate\write\outcomefile{\unexpanded{\outcome}{#1}}}
+ \fi%
+%</classXimera>
+% \end{macrocode}
+% These can appear in either the preamble or in problem environments.
+% with pdflatex, we produce the .oc file which includes ALL the
+% outcomes; in the tex4ht world, we just produce spans for the
+% specific outcomes.
+% \begin{macrocode}
+%<*cfgXimera>
+\renewcommand{\outcome}[1]{
+ \Configure{@HEAD}{\HCode{<meta name="learning-outcome" content="#1"/>\Hnewline}}
+}
+% Sometimes there are no outcomes at all
+\IfFileExists{\jobname.oc}{\input{\jobname.oc}}{}
+
+\renewcommand{\outcome}[1]{%
+ \HCode{<span class="learning-outcome">#1</span>}
+}
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/packages.dtx b/macros/latex/contrib/ximera/src/packages.dtx
new file mode 100644
index 0000000000..72fb4c6e2a
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/packages.dtx
@@ -0,0 +1,54 @@
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+% \subsection{Loading packages}
+% Since we want |\cancel| to work, we load it here to avoid polluting the |.jax| output.
+% \begin{macrocode}
+\RequirePackage[makeroom]{cancel}
+% \end{macrocode}
+% Quite a few packages are required by the document class. This is a
+% list of required packages. As packages are added to this list, we
+% should include a comment as to where they are being utilized. This
+% will help keep this list from being redundant and/or outdated.
+% \begin{macrocode}
+\RequirePackage[inline]{enumitem}
+\RequirePackage[pagestyles]{titlesec}
+\RequirePackage{titletoc}
+\RequirePackage{titling}
+\RequirePackage{url}
+\RequirePackage[table]{xcolor}
+\RequirePackage{tikz}
+\RequirePackage{pgfplots}
+\usepgfplotslibrary{groupplots}
+\usetikzlibrary{calc}
+\RequirePackage{fancyvrb}
+% \end{macrocode}
+% Load |forloop| for the problem environment dynamic naming and
+% building.
+% \begin{macrocode}
+\RequirePackage{forloop}
+% \end{macrocode}
+% Now we load even more packages.
+% \begin{macrocode}
+\RequirePackage{environ}% Included to allow saving of environment contents. This does *not* play well with various verbatem environments however and would be great to find a way around utilizing this package. One option is the "Suppress" command included below.
+\RequirePackage{amssymb}% Included to have access to math typeset.
+\RequirePackage{amsmath}% Included to have access to math typeset.
+\RequirePackage{amsthm}% Included to have access to math typeset.
+\RequirePackage{xifthen}% http://ctan.org/pkg/xifthen
+\RequirePackage{multido}% http://ctan.org/pkg/multido
+\RequirePackage{listings} %% is this required???
+
+\RequirePackage{xkeyval}
+
+\RequirePackage{comment}
+%</classXimera>
+% \end{macrocode}
+% Various packages must be loaded early to avoid polluting the |.jax|
+% file.
+% \begin{macrocode}
+%<*classXimera>
+\RequirePackage{gettitlestring}
+\RequirePackage{nameref}
+\RequirePackage{epstopdf}
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/pagesetup.dtx b/macros/latex/contrib/ximera/src/pagesetup.dtx
new file mode 100644
index 0000000000..9bf13d3cd9
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/pagesetup.dtx
@@ -0,0 +1,55 @@
+% \subsection{Page setup}
+% We want non-indented spaced-out paragraphs.
+% \begin{macrocode}
+%<*classXimera>
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{5pt}
+%</classXimera>
+% \end{macrocode}
+% To avoid weird margins in 2-sided mode, change the margins.
+% \begin{macrocode}
+%<*classXimera>
+\oddsidemargin 62pt
+\evensidemargin 62pt
+\textwidth 345pt
+\headheight 14pt
+%</classXimera>
+% \end{macrocode}
+% On the HTML side, there is more complicated page setup to perform.
+% \begin{macrocode}
+%<*cfgXimera>
+\Preamble{xhtml}
+
+% We don't want to translate font suggestions with ugly wrappers like
+% <span class="cmti-10"> for italic text
+\NoFonts
+
+% Don't output xml version tag
+\Configure{VERSION}{}
+
+% Output HTML5 doctype instead of the default for HTML4
+\Configure{DOCTYPE}{\HCode{<!doctype html>\Hnewline}}
+
+% Custom page opening
+\Configure{HTML}{\HCode{<html lang="en">\Hnewline}}{\HCode{\Hnewline</html>}}
+
+% Reset <head>, aka delete all default boilerplate; alternatively set up new content
+\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
+\Configure{@HEAD}{\HCode{<meta name="ximera" content="version 0.0.1" />\Hnewline}}
+\Configure{@HEAD}{\HCode{<link href="https://ximera.osu.edu/public/stylesheets/standalone.css" rel="stylesheet" media="screen"/>\Hnewline}}
+\Configure{@HEAD}{\HCode{<script type="text/javascript" async src="https://ximera.osu.edu/public/javascripts/standalone.min.js"></script>\Hnewline}}
+%</cfgXimera>
+% \end{macrocode}
+% Disable certain ligatures in HTML.
+% \begin{macrocode}
+%<*htXimera>
+\usepackage{microtype}
+\DisableLigatures[f]{encoding=*}
+%</htXimera>
+% \end{macrocode}
+% I am not sure what this does.
+% \begin{macrocode}
+%<*htXimera>
+\NewEnviron{html}{\HCode{\BODY}}
+%</htXimera>
+% \end{macrocode} \ No newline at end of file
diff --git a/macros/latex/contrib/ximera/src/problem.dtx b/macros/latex/contrib/ximera/src/problem.dtx
new file mode 100644
index 0000000000..4a8cfaeddb
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/problem.dtx
@@ -0,0 +1,197 @@
+% \subsubsection{Problem environments}
+
+% These are problem environment decorations (these should be user invoked, not default).
+% The decoration for these environments were inspired by
+% \url{http://tex.stackexchange.com/questions/11098/nice-formatting-for-theorems}
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+
+% \begin{macro}{latexProblemContent}
+% Added for those that want to use UF problems without using the problem filter code. This command is renewed into something meaningful in the 'ProblemSelector.sty'.
+% \begin{macrocode}
+\providecommand{\latexProblemContent}[1]{#1}
+% Iterate count for problem counts.
+\Make@Counter{Iteration@probCnt}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newcommand{\hang}{% top theorem decoration
+ \begingroup%
+ \setlength{\unitlength}{.005\linewidth}% \linewidth/200
+ \begin{picture}(0,0)(1.5,0)%
+ \linethickness{1pt} \color{black!50}%
+ \put(-3,2){\line(1,0){206}}% Top line
+ \multido{\iA=2+-1,\iB=50+-10}{5}{% Top hangs
+ \color{black!\iB}%
+ \put(-3,\iA){\line(0,-1){1}}% Top left hang
+ %\put(203,\iA){\line(0,-1){1}}% Top right hang
+ }%
+ \end{picture}%
+ \endgroup%
+}%
+\newcommand{\hung}{% bottom theorem decoration
+ \nobreak
+ \begingroup%
+ \setlength{\unitlength}{.005\linewidth}% \linewidth/200
+ \begin{picture}(0,0)(1.5,0)%
+ \linethickness{1pt} \color{black!50}%
+ \put(60,0){\line(1,0){143}}% Bottom line
+ \multido{\iA=0+1,\iB=50+-10}{5}{% Bottom hangs
+ \color{black!\iB}%
+ %\put(-3,\iA){\line(0,1){1}}% Bottom left hang
+ \put(203,\iA){\line(0,1){1}}% Bottom right hang
+ \put(\iB,0){\line(60,0){10}}% Left fade out
+ }%
+ \end{picture}%
+ \endgroup%
+}%
+% \end{macrocode}
+%
+% Configure environment configuration commands
+%
+% The command |\problemNumber| contains all the format code to determine the number (and the format of the number) for any of the problem environments.
+%
+% \begin{macrocode}
+\MakeCounter{problem}
+\newcommand{\problemNumber}{
+% First we determine if we have a counter for this question depth level.
+\ifcsname c@depth\Roman{problem@Depth}Count\endcsname% Check to see if counter exists
+ %If so, do nothing.
+ \else
+ %If not, create it.
+ \expandafter\newcounter{depth\Roman{problem@Depth}Count}
+ \expandafter\setcounter{depth\Roman{problem@Depth}Count}{0}
+ \fi
+
+\expandafter\stepcounter{depth\Roman{problem@Depth}Count}
+\arabic{depthICount}% The first problem depth, what use to be |\theproblem|.
+
+\forloop{Iteration@probCnt}{2}{\arabic{Iteration@probCnt} < \numexpr \value{problem@Depth} + 1 \relax}{%
+ .\expandafter\arabic{depth\Roman{Iteration@probCnt}Count}% Get the problem number of the next depth level and append it with a ".".
+}
+%\@ifpackageloaded{shuffle}{<true>}{<false>}% Check if Shuffle has been added. If so, add special numbering to the shuffled "groups". Currently commented out while we decide what that should look like (compared to the normal nested problems).
+%\ifhandout % Currently handout mode doesn't allow hints. Putting this code in place in case that changes.
+% \theproblem
+%\else
+% \theproblem
+%\fi
+}
+
+
+%%%%%% Configure various problem environment commands
+\Make@Counter{problem@Depth}
+
+
+
+%%%% Configure environments start content
+
+\newcommand{\problemEnvironmentStart}[2]{%
+% This takes in 2 arguments.
+% The first is optional and is the old optional argument from existing environments.
+% This is passed down to the associated problem environment name in case you want a global value.
+% The second argument is mandatory and is the name of the 'problem' environment,
+% such as problem, question, exercise, etc.
+% It then configures everything needed at the start of that environment.
+
+\stepcounter{problem@Depth}% Started a problem, so we've sunk another problem layer.
+\def\spaceatend{#1}%
+\begin{trivlist}%
+\item%
+ [%
+ \hskip\labelsep\sffamily\bfseries
+ #2 \problemNumber% Determine the correct number of the problem, and the format of that number.
+ ]%
+\slshape
+}
+
+
+
+%%%%% Configure environments end content
+
+\newcommand{\problemEnvironmentEnd}{%This configures all the end content for a problem.
+%
+% First we need to see if we've dropped fully out of a depth level,
+% so we can reset that counter back to zero for the next time we enter that depth level.
+\stepcounter{problem@Depth}
+\ifcsname c@depth\Roman{problem@Depth}Count\endcsname
+ \expandafter\ifnum\expandafter\value{depth\Roman{problem@Depth}Count}>0
+ \expandafter\setcounter{depth\Roman{problem@Depth}Count}{0}
+ \fi
+\fi
+
+\addtocounter{problem@Depth}{-2}% Exited a problem so we've exited a problem layer. Need -2 because we steppped once at the start to check for needing a depth-level count reset.
+
+\par\addvspace{.5ex}\nobreak\noindent\hung %% line at the bottom
+
+\ifhandout
+ \ifnewpage
+ \newpage
+ \fi
+\fi
+\end{trivlist}
+}
+
+
+
+%%%% Now populate the old environment names
+%
+% Old environments were "problem", "exercise", "exploration", and "question".
+% Note that you can add content to the start/end code on top of these base code pieces if you want.
+
+
+\newenvironment{problem}[1][2in]%
+{%Env start code
+\problemEnvironmentStart{#1}{Problem}
+}
+{%Env end code
+\problemEnvironmentEnd
+}
+
+\newenvironment{exercise}[1][2in]%
+{%Env start code
+\problemEnvironmentStart{#1}{Exercise}
+}
+{%Env end code
+\problemEnvironmentEnd
+}
+
+\newenvironment{exploration}[1][2in]%
+{%Env start code
+\problemEnvironmentStart{#1}{Exploration}
+}
+{%Env end code
+\problemEnvironmentEnd
+}
+
+\newenvironment{question}[1][2in]%
+{%Env start code
+\problemEnvironmentStart{#1}{Question}
+}
+{%Env end code
+\problemEnvironmentEnd
+}
+%</classXimera>
+% \end{macrocode}
+
+
+% Use an ``identification'' counter to assign IDs to the various problem-related DOM elements
+% \begin{macrocode}
+%<*htXimera>
+\newcounter{identification}
+\setcounter{identification}{0}
+
+\newcommand{\ConfigureQuestionEnv}[2]{%
+% refstepcounter ensures that labels get updated within these environments
+\renewenvironment{#1}{\refstepcounter{problem}}{}%
+\ConfigureEnv{#1}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div role="article" class="problem-environment #2" id="problem\arabic{identification}">}}{\ifvmode \IgnorePar\fi \EndP\HCode{</div>}\IgnoreIndent}{}{}%
+}
+
+\ConfigureQuestionEnv{problem}{problem}
+\ConfigureQuestionEnv{exercise}{exercise}
+\ConfigureQuestionEnv{question}{question}
+\ConfigureQuestionEnv{exploration}{exploration}
+\ConfigureQuestionEnv{hint}{hint}
+%%%%\ConfigureQuestionEnv{shuffle}{shuffle}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/proof.dtx b/macros/latex/contrib/ximera/src/proof.dtx
new file mode 100644
index 0000000000..ab86e93f52
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/proof.dtx
@@ -0,0 +1,10 @@
+% \subsubsection{Proofs}
+% \DescribeEnv{proof}{A mathematical proof environment.}
+% \begin{macrocode}
+%<*classXimera>
+\renewcommand{\qedsymbol}{$\blacksquare$}
+\renewenvironment{proof}[1][\proofname]
+ {\begin{trivlist}\item[\hskip \labelsep \itshape \bfseries #1{}\hspace{2ex}]}
+{\qed\end{trivlist}}
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/sectioning.dtx b/macros/latex/contrib/ximera/src/sectioning.dtx
new file mode 100644
index 0000000000..3f9100294d
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/sectioning.dtx
@@ -0,0 +1,49 @@
+% \subsection{Sectioning}
+% Makes the table of contents look a bit better. This can be
+% redefined in the preamble if you do not like the appearance.
+% \DescribeMacro{\section}{The name of a section inside an activity.}
+% \begin{macrocode}
+%<*classXourse>
+\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{4.2em}}
+%</classXourse>
+% \end{macrocode}
+% \DescribeMacro{\subsection}{The name of a subsection inside an activity.}
+% \begin{macrocode}
+%<*classXourse>
+\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{4.2em}}
+%</classXourse>
+% \end{macrocode}
+% Xourse files can have parts.
+% \DescribeMacro{\part}{The name of a large part of a xourse.}
+% \begin{macrocode}
+%<*htXourse>
+\newcounter{ximera@part}
+\setcounter{ximera@part}{0}
+\renewcommand\part[1]{%
+\stepcounter{ximera@part}%
+\ifvmode \IgnorePar\fi \EndP%
+%\HCode{<h1 id="part\arabic{ximera@part}" class="card part">}#1\HCode{</h1>}% makes cards disappear?
+\HCode{<h1 id="part\arabic{ximera@part}" class="card part">#1</h1>}%
+\IgnoreIndent%
+}
+%</htXourse>
+% \end{macrocode}
+% Paragraph commands emit spans.
+% \DescribeMacro{\paragraph}{A small heading.}
+% \begin{macrocode}
+%<*cfgXimera>
+\renewcommand{\paragraph}[1]{%
+ \HCode{<span class="paragraphHead">}%
+ #1%
+ \HCode{</span>}\par\IgnorePar}
+%</cfgXimera>
+% \end{macrocode}
+% \DescribeMacro{\subparagraph}{An even smaller heading.}
+% \begin{macrocode}
+%<*cfgXimera>
+\renewcommand{\subparagraph}[1]{%
+ \HCode{<span class="subparagraphHead">}%
+ #1%
+ \HCode{</span>}\par\IgnorePar}
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/solution.dtx b/macros/latex/contrib/ximera/src/solution.dtx
new file mode 100644
index 0000000000..45f6301031
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/solution.dtx
@@ -0,0 +1,30 @@
+% \subsubsection{Solution}
+% \DescribeEnv{solution}{The solution to a problem.}
+% \begin{macrocode}
+%<*classXimera>
+%% solution environment
+\ifhandout % what follows is handout behavior
+\newenvironment{solution}%
+ {%
+ \setbox0\vbox\bgroup
+ }
+ {%
+ \egroup
+ }
+\else
+\newenvironment{solution}%
+ {%
+ \begin{trivlist}
+ \item[\hskip \labelsep\bfseries Solution:\hspace{2ex}]
+ }
+ % %% line at the bottom}
+ {
+ \end{trivlist}
+ \par\addvspace{.5ex}\nobreak\noindent\hung
+ }
+\fi
+
+
+
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/suppress.dtx b/macros/latex/contrib/ximera/src/suppress.dtx
new file mode 100644
index 0000000000..dcdcf924d1
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/suppress.dtx
@@ -0,0 +1,33 @@
+% \subsubsection{Suppress}
+% \DescribeEnv{suppress}{The suppress environment is a good way to suppress output without
+% commenting it. This way we can avoid many of the places we use
+% environ package and this should also avoid most of the verbatim
+% conflicts.}
+% This is code adapted from |syntonly.sty|.
+% \begin{macrocode}
+%<*classXimera>
+\font\dummyft@=dummy \relax
+\def\suppress{%
+ \begingroup\par
+ \parskip\z@
+ \offinterlineskip
+ \baselineskip=\z@skip
+ \lineskip=\z@skip
+ \lineskiplimit=\maxdimen
+ \dummyft@
+ \count@\sixt@@n
+ \loop\ifnum\count@ >\z@
+ \advance\count@\m@ne
+ \textfont\count@\dummyft@
+ \scriptfont\count@\dummyft@
+ \scriptscriptfont\count@\dummyft@
+ \repeat
+ \let\selectfont\relax
+ \let\mathversion\@gobble
+ \let\getanddefine@fonts\@gobbletwo
+ \tracinglostchars\z@
+ \frenchspacing
+ \hbadness\@M}
+\def\endsuppress{\par\endgroup}
+%</classXimera>
+% \end{macrocode} \ No newline at end of file
diff --git a/macros/latex/contrib/ximera/src/textcolor.dtx b/macros/latex/contrib/ximera/src/textcolor.dtx
new file mode 100644
index 0000000000..318d34365a
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/textcolor.dtx
@@ -0,0 +1,20 @@
+% Make \textcolor work using https://tex.stackexchange.com/questions/390127/textcolor-with-tex4ht
+% \begin{macrocode}
+%<*cfgXimera>
+\makeatletter
+\Configure{textcolor}{\HCode{<span style="color:\#\tsf@color;">}}{\HCode{</span>}}
+% redefine \textcolor command
+\let\oldtextcolor\textcolor
+
+\renewcommand\textcolor[2]{%
+ % we need to convert the current color to hexadecimal form usable in the style attribute
+ % the \tsf@color macro is used in the \Configure{textcolor} configuration to insert the
+ % CSS color
+ \extractcolorspec{#1}{\tsf@color}%
+ \expandafter\convertcolorspec\tsf@color{HTML}\tsf@color%
+ % call the original command
+ \oldtextcolor{#1}{#2}%
+}%
+\makeatother
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/theorems.dtx b/macros/latex/contrib/ximera/src/theorems.dtx
new file mode 100644
index 0000000000..292d7a89b2
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/theorems.dtx
@@ -0,0 +1,174 @@
+% \subsubsection{Theorem and theorem-like environments}
+% On the web, a theorem is emitted as a special |<div>|.
+% \begin{macrocode}
+%<*htXimera>
+\newcommand{\ConfigureTheoremEnv}[1]{%
+\renewenvironment{#1}[1][]{\refstepcounter{problem}%
+\ifthenelse{\equal{##1}{}}{}{%
+ \HCode{<span class="theorem-like-title">}##1\HCode{</span>}%
+}}{}
+\ConfigureEnv{#1}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="theorem-like problem-environment #1" id="problem\arabic{identification}">}}{\HCode{</div>}\IgnoreIndent}{}{}%
+}
+%</htXimera>
+%<classXimera>\theoremstyle{definition} % No italic (because this makes also text in TikZ italic !!!)
+% \end{macrocode}
+
+% The key is to make sure that the theorem environments are defined in
+% a corresponding fashion on the web and on paper.
+
+% \DescribeEnv{theorem}{Theorem}
+% \begin{macrocode}
+%<classXimera> \newtheorem{theorem}{Theorem}
+%<htXimera> \ConfigureTheoremEnv{theorem}
+% \end{macrocode}
+
+% \DescribeEnv{algorithm}{Algorithm}
+% \begin{macrocode}
+%<classXimera> \newtheorem{algorithm}{Algorithm}
+%<htXimera> \ConfigureTheoremEnv{algorithm}
+% \end{macrocode}
+
+% \DescribeEnv{axiom}{Axiom}
+% \begin{macrocode}
+%<classXimera> \newtheorem{axiom}{Axiom}
+%<htXimera> \ConfigureTheoremEnv{axiom}
+% \end{macrocode}
+
+% \DescribeEnv{claim}{Claim}
+% \begin{macrocode}
+%<classXimera> \newtheorem{claim}{Claim}
+%<htXimera> \ConfigureTheoremEnv{claim}
+% \end{macrocode}
+
+% \DescribeEnv{conclusion}{Conclusion}
+% \begin{macrocode}
+%<classXimera> \newtheorem{conclusion}{Conclusion}
+%<htXimera> \ConfigureTheoremEnv{conclusion}
+% \end{macrocode}
+
+% \DescribeEnv{condition}{Condition}
+% \begin{macrocode}
+%<classXimera> \newtheorem{condition}{Condition}
+%<htXimera> \ConfigureTheoremEnv{condition}
+% \end{macrocode}
+
+% \DescribeEnv{conjecture}{Conjecture}
+% \begin{macrocode}
+%<classXimera> \newtheorem{conjecture}{Conjecture}
+%<htXimera> \ConfigureTheoremEnv{conjecture}
+% \end{macrocode}
+
+% \DescribeEnv{corollary}{Corollary}
+% \begin{macrocode}
+%<classXimera> \newtheorem{corollary}{Corollary}
+%<htXimera> \ConfigureTheoremEnv{corollary}
+% \end{macrocode}
+
+% \DescribeEnv{criterion}{Criterion}
+% \begin{macrocode}
+%<classXimera> \newtheorem{criterion}{Criterion}
+%<htXimera> \ConfigureTheoremEnv{criterion}
+% \end{macrocode}
+
+% \DescribeEnv{definition}{Definition}
+% \begin{macrocode}
+%<classXimera> \newtheorem{definition}{Definition}
+%<htXimera> \ConfigureTheoremEnv{definition}
+% \end{macrocode}
+
+% \DescribeEnv{example}{Example}
+% \begin{macrocode}
+%<classXimera> \newtheorem{example}{Example}
+%<htXimera> \ConfigureTheoremEnv{example}
+% \end{macrocode}
+
+% \DescribeEnv{explanation}{Explanation}
+% \begin{macrocode}
+%<classXimera> \newtheorem*{explanation}{Explanation}
+%<htXimera> \ConfigureTheoremEnv{explanation}
+% \end{macrocode}
+
+% \DescribeEnv{fact}{Fact}
+% \begin{macrocode}
+%<classXimera> \newtheorem{fact}{Fact}
+%<htXimera> \ConfigureTheoremEnv{fact}
+% \end{macrocode}
+
+% \DescribeEnv{lemma}{Lemma}
+% \begin{macrocode}
+%<classXimera> \newtheorem{lemma}{Lemma}
+%<htXimera> \ConfigureTheoremEnv{lemma}
+% \end{macrocode}
+
+% \DescribeEnv{formula}{Formula}
+% \begin{macrocode}
+%<classXimera> \newtheorem{formula}{Formula}
+%<htXimera> \ConfigureTheoremEnv{formula}
+% \end{macrocode}
+
+% \DescribeEnv{idea}{Idea}
+% \begin{macrocode}
+%<classXimera> \newtheorem{idea}{Idea}
+%<htXimera> \ConfigureTheoremEnv{idea}
+% \end{macrocode}
+
+% \DescribeEnv{notation}{Notation}
+% \begin{macrocode}
+%<classXimera> \newtheorem{notation}{Notation}
+%<htXimera> \ConfigureTheoremEnv{notation}
+% \end{macrocode}
+
+% \DescribeEnv{model}{Model}
+% \begin{macrocode}
+%<classXimera> \newtheorem{model}{Model}
+%<htXimera> \ConfigureTheoremEnv{model}
+% \end{macrocode}
+
+% \DescribeEnv{observation}{Observation}
+% \begin{macrocode}
+%<classXimera> \newtheorem{observation}{Observation}
+%<htXimera> \ConfigureTheoremEnv{observation}
+% \end{macrocode}
+
+% \DescribeEnv{proposition}{Proposition}
+% \begin{macrocode}
+%<classXimera> \newtheorem{proposition}{Proposition}
+%<htXimera> \ConfigureTheoremEnv{proposition}
+% \end{macrocode}
+
+% \DescribeEnv{paradox}{Paradox}
+% \begin{macrocode}
+%<classXimera> \newtheorem{paradox}{Paradox}
+%<htXimera> \ConfigureTheoremEnv{paradox}
+% \end{macrocode}
+
+% \DescribeEnv{procedure}{Procedure}
+% \begin{macrocode}
+%<classXimera> \newtheorem{procedure}{Procedure}
+%<htXimera> \ConfigureTheoremEnv{procedure}
+% \end{macrocode}
+
+% \DescribeEnv{remark}{Remark}
+% \begin{macrocode}
+%<classXimera> \newtheorem{remark}{Remark}
+%<htXimera> \ConfigureTheoremEnv{remark}
+% \end{macrocode}
+
+% \DescribeEnv{summary}{Summary}
+% \begin{macrocode}
+%<classXimera> \newtheorem{summary}{Summary}
+%<htXimera> \ConfigureTheoremEnv{summary}
+% \end{macrocode}
+
+% \DescribeEnv{template}{Template}
+% \begin{macrocode}
+%<classXimera> \newtheorem{template}{Template}
+%<htXimera> \ConfigureTheoremEnv{template}
+% \end{macrocode}
+
+% \DescribeEnv{warning}{Warning}
+% \begin{macrocode}
+%<classXimera> \newtheorem{warning}{Warning}
+%<htXimera> \ConfigureTheoremEnv{warning}
+% \end{macrocode}
+
diff --git a/macros/latex/contrib/ximera/src/tikzexport.dtx b/macros/latex/contrib/ximera/src/tikzexport.dtx
new file mode 100644
index 0000000000..c89f26a49a
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/tikzexport.dtx
@@ -0,0 +1,42 @@
+% \subsubsection{TikZ export}
+% We generate SVGs and PNGs for any TikZ images, via the
+% ``externalize'' feature of TikZ.
+%
+% Currently TikZ doesn't compile natively into the website because of
+% how the xake bake compilation works. In order to make Tikz work,
+% you need to get the tool \verb|mutool| on the machine that is
+% performing \verb|xake bake|.
+% \begin{macrocode}
+%<*classXimera>
+\ifdefined\HCode
+ \tikzexporttrue
+\fi
+
+\iftikzexport
+ \usetikzlibrary{external}
+
+ \ifdefined\HCode
+ % in htlatex, just include the svg files
+ \def\pgfsys@imagesuffixlist{.svg}
+
+ \tikzexternalize[prefix=./,mode=graphics if exists]
+ \else
+ % in pdflatex, actually generate the svg files
+ \tikzset{
+ /tikz/external/system call={
+ pdflatex \tikzexternalcheckshellescape
+ -halt-on-error -interaction=batchmode
+ -jobname "\image" "\\PassOptionsToClass{tikzexport}{ximera}\texsource";
+ mutool draw -F svg \image.pdf > \image.svg ; % mutool adds "1" to filename ????
+ mutool draw -o \image.svg \image.pdf ;
+ mutool draw -r 150 -c rgbalpha -o \image.png \image.pdf ;
+ ebb -x \image.png
+ }
+ }
+ \tikzexternalize[optimize=false,prefix=./]
+ \fi
+
+ \fi
+
+%</classXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/title.dtx b/macros/latex/contrib/ximera/src/title.dtx
new file mode 100644
index 0000000000..56380af5d7
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/title.dtx
@@ -0,0 +1,122 @@
+% \subsubsection{Titles and authors}
+%
+% \subsubsection{Authors}
+% \DescribeMacro{\author}{Activities have authors. Warn the user if no author is provided.}
+% \begin{macrocode}
+%<*classXimera>
+\let\@emptyauthor\@author
+\def\author#1{\gdef\@author{#1}}
+\def\@author{\@latex@warning@no@line{No \noexpand\author given}}
+%</classXimera>
+% \end{macrocode}
+% Include author name in meta tags
+% \begin{macrocode}
+%<*htXimera>
+\Configure{@HEAD}{\HCode{<meta name="author" content="}\@author\HCode{" />\Hnewline}}
+%</htXimera>
+% \end{macrocode}
+% The |\and| command would emit tabular environments which really
+% should not appear in a meta tag.
+% \begin{macrocode}
+%<htXimera|classXimera>\def\and{and }
+% \end{macrocode}
+
+% \subsubsection{Title}
+% \DescribeMacro{\title}{Activities have titles.}
+% \begin{macrocode}
+%<*classXimera>
+\let\title\relax
+\newcommand{\title}[1][]{{\protected@xdef\@pretitle{#1}}\protected@xdef\@title}
+
+\title{}
+
+\newcounter{titlenumber}
+\renewcommand{\thetitlenumber}{\arabic{titlenumber}}
+%\renewcommand{\thesection}{\arabic{titlenumber}} %% Makes section numbers work
+\setcounter{titlenumber}{0}
+
+\newpagestyle{main}{
+\sethead[\textsl{\ifnumbers\thetitlenumber\hspace{1em}\fi\@title}][][] % even
+{}{}{\textsl{\ifnumbers\thetitlenumber\hspace{1em}\fi\@title}} % odd
+\setfoot[\thepage][][] % even
+{}{}{\thepage} % odd
+}
+\pagestyle{main}
+% \end{macrocode}
+% \DescribeMacro{\maketitle}{In a \textsf{ximera} document, redefine
+% |\maketitle| and put them in a table of contents. The
+% |\phantomsection| is to fix the hrefs.}
+% \begin{macrocode}
+\renewcommand\maketitle{%
+ \addtocounter{titlenumber}{1}%
+ {\flushleft\large\bfseries \@pretitle\par\vspace{-1em}}
+ {\flushleft\LARGE\bfseries {\ifnumbers\thetitlenumber\fi}{\ifnumbers\hspace{1em}\else\hspace{0em}\fi}\@title \par }
+ \phantomsection%
+ \ifnumbers\addcontentsline{toc}{section}{\thetitlenumber~\@title}\else\addcontentsline{toc}{section}{\@title}\fi
+ \vskip .6em\noindent\textit\theabstract\setcounter{problem}{0}\setcounter{section}{0}\setcounter{subsection}{0}\par\vspace{2em}
+ \ifnooutcomes\else\let\thefootnote\relax\footnote{Learning outcomes: \theoutcomes}\fi
+ \ifnoauthor\else\let\thefootnote\relax\footnote{Author(s):~\@author}\fi
+ \aftergroup\@afterindentfalse
+ \aftergroup\@afterheading}
+
+\ifnumbers
+\setcounter{secnumdepth}{2}
+\renewcommand{\thesection}{\arabic{titlenumber}.\arabic{section}}
+\renewcommand{\thesubsection}{\arabic{titlenumber}.\arabic{section}.\arabic{subsection}}
+\else
+\setcounter{secnumdepth}{-2}
+\fi
+
+\def\activitystyle{}
+\newcounter{sectiontitlenumber}
+\setcounter{secnumdepth}{2}
+\setcounter{tocdepth}{2}
+\newcommand\chapterstyle{%
+ \def\activitystyle{activity-chapter}
+ \def\maketitle{%
+ \addtocounter{titlenumber}{1}%
+ {\flushleft\small\sffamily\bfseries\@pretitle\par\vspace{-1.5em}}%
+ {\flushleft\LARGE\sffamily\bfseries\thetitlenumber\hspace{1em}\@title \par }%
+ {\vskip .6em\noindent\textit\theabstract\setcounter{problem}{0}\setcounter{section}{0}}%
+ \par\vspace{2em}
+ \phantomsection\addcontentsline{toc}{section}{\textbf{\thetitlenumber\hspace{1em}\@title}}%
+}}
+
+
+\newcommand\sectionstyle{%
+ \def\activitystyle{activity-section}
+ \def\maketitle{%
+ \addtocounter{section}{1}
+ \setcounter{sectiontitlenumber}{\value{section}}
+ {\flushleft\small\sffamily\bfseries\@pretitle\par\vspace{-1.5em}}%
+ {\flushleft\Large\sffamily\bfseries\thetitlenumber.\thesectiontitlenumber\hspace{1em}\@title \par}%
+ {\vskip .6em\noindent\textit\theabstract\setcounter{subsection}{0}}%
+ \par\vspace{2em}
+ \phantomsection\addcontentsline{toc}{section}{\thetitlenumber.\thesectiontitlenumber\hspace{1em}\@title}%
+ \renewcommand\section{\@startsection{subsection}{2}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\large\bfseries}}
+
+ \renewcommand\subsection{\@startsection{subsubsection}{3}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\normalsize\bfseries}}
+
+}}
+
+
+\iftikzexport%% allows xake to handle \chapterstyle and \sectionstye
+\renewcommand\chapterstyle{\def\activitystyle{chapter}}
+\renewcommand\sectionstyle{\def\activitystyle{section}}
+\else
+\fi
+
+%</classXimera>
+% \end{macrocode}
+% Eliminate some formatting that we'll handle later with CSS
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\maketitle}{}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/ungraded.dtx b/macros/latex/contrib/ximera/src/ungraded.dtx
new file mode 100644
index 0000000000..78b3e29738
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/ungraded.dtx
@@ -0,0 +1,22 @@
+% \subsubsection{Ungraded activities}
+% \DescribeEnv{ungraded}{The |ungraded| environment is used to record
+% that certain parts of activities should not be worth points. For
+% example, if you want to use a multipleChoice as a survey question,
+% you can place it inside an |ungraded| environment.}
+% On the \LaTeX\ side, the |ungraded| environment does nothing.
+% \begin{macrocode}
+%<*classXimera>
+\newenvironment{ungraded}{}{}
+%</classXimera>
+% \end{macrocode}
+% But on the html side, |ungraded| wraps the activities in a div in
+% order to assign some weight to them for grading.
+% \begin{macrocode}
+%<*htXimera>
+\renewenvironment{ungraded}{%
+\ifvmode \IgnorePar\fi \EndP\HCode{<div class="ungraded">}\IgnoreIndent%
+}{
+\ifvmode \IgnorePar\fi \EndP\HCode{</div>}\IgnoreIndent%
+}
+%</htXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/utilitymacros.dtx b/macros/latex/contrib/ximera/src/utilitymacros.dtx
new file mode 100644
index 0000000000..e44b490e06
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/utilitymacros.dtx
@@ -0,0 +1,45 @@
+% \subsubsection{Utility macros}
+% These are a list of new utility macros that are generally useful and are loaded after packages and the Tikz Fix.
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+% \begin{macro}{NewCounter}
+% Improved version of |\newcounter| to check for existance before creating a counter to minimize conflicts with packages. Added by Jason Nowell
+% \begin{macrocode}
+\newcommand{\Make@Counter}[1]{% This is an internal macro that should probably be depreciated for the below universal macro.
+% Code located in "Utilitymacros.dtx"
+ \@ifundefined{c@#1}% Check to see if counter exists
+ { % If not, create it and set it to 0.
+ \newcounter{#1}
+ \setcounter{#1}{0}
+ }
+ {%If so, reset to 0.
+ \setcounter{#1}{0}
+ }
+}
+
+\newcommand{\MakeCounter}[1]{%% Code located in "Utilitymacros.dtx"
+% Code located in "Utilitymacros.dtx"
+ \@ifundefined{c@#1}% Check to see if counter exists
+ { % If not, create it and set it to 0.
+ \newcounter{#1}
+ \setcounter{#1}{0}
+ }
+ {%If so, reset to 0.
+ \setcounter{#1}{0}
+ }
+}
+% \end{macrocode}
+%</classXimera>
+% \end{macro}
+
+% \begin{macro}{latexProblemContent}
+% Added for those that want to use UF problems without using the problem filter code. This command is renewed into something meaningful in the 'ProblemSelector.sty'.
+% \begin{macrocode}
+\providecommand{\latexProblemContent}[1]{#1}
+% Iterate count for problem counts.
+\Make@Counter{Iteration@probCnt}
+% \end{macrocode}
+% \end{macro}
+
+
diff --git a/macros/latex/contrib/ximera/src/verbatim.dtx b/macros/latex/contrib/ximera/src/verbatim.dtx
new file mode 100644
index 0000000000..88da69a318
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/verbatim.dtx
@@ -0,0 +1,36 @@
+% \subsubsection{Code listing environments}
+% \DescribeEnv{code}{A code answer environment} You cannot use Environ
+% with the fancyvrb/listings package if you want nested environments.
+%
+% \begin{macrocode}
+%<*classXimera>
+\DefineVerbatimEnvironment{code}{Verbatim}{numbers=left,frame=lines,label=Code,labelposition=topline}
+%</classXimera>
+% \end{macrocode}
+% \DescribeEnv{python}{A python answer environment} You cannot use
+% Environ with the fancyvrb/listings package if you want nested
+% environments
+% \begin{macrocode}
+%<*classXimera>
+\DefineVerbatimEnvironment{python}{Verbatim}{numbers=left,frame=lines,label=Python,labelposition=topline}
+%</classXimera>
+% \end{macrocode}
+% \DescribeEnv{javascriptCode}{A JavaScript answer environment} Unfortunately the name |javascript| is already used for the actual, executed (!) JavaScript interactive.
+% environments
+% \begin{macrocode}
+%<*classXimera>
+\DefineVerbatimEnvironment{javascriptCode}{Verbatim}{numbers=left,frame=lines,label=JavaScript,labelposition=topline}
+%</classXimera>
+%<*cfgXimera>
+\renewenvironment{javascriptCode}{\NoFonts}{\EndNoFonts}
+\ScriptEnv{javascriptCode}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="javascript-code" id="javascript\arabic{identification}"><script type="text/text">}\HtmlParOff}{\HtmlParOn\HCode{\Hnewline</script></div>}}
+%</cfgXimera>
+% \end{macrocode}
+% On the web, translate verbatim and lstlisting blocks into |<pre>|
+% elements.
+% \begin{macrocode}
+%<*cfgXimera>
+\ConfigureEnv{verbatim}{\HCode{<pre>}}{\HCode{</pre>}}{}{}
+\ConfigureEnv{lstlisting}{\HCode{<pre>}}{\HCode{</pre>}}{}{}
+%</cfgXimera>
+% \end{macrocode}
diff --git a/macros/latex/contrib/ximera/src/xkcd.dtx b/macros/latex/contrib/ximera/src/xkcd.dtx
new file mode 100644
index 0000000000..1d08288803
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/xkcd.dtx
@@ -0,0 +1,13 @@
+% \subsubsection{XKCD}
+% \DescribeMacro{\xkcd}{Reference an XKCD cartoon.}
+% \begin{macrocode}
+%<*classXimera>
+\newcommand{\xkcd}[1]{#1}
+%</classXimera>
+% \end{macrocode}
+% On the web, this should be an image linked to the actual XKCD website.
+% \begin{macrocode}
+%<*htXimera>
+\renewcommand{\xkcd}[1]{\ifvmode \IgnorePar\fi \EndP\HCode{<img src="https://imgs.xkcd.com/comics/#1.png">}}
+%</htXimera>
+% \end{macrocode}