| 1 |
% \subsubsection{Foldable} |
| 2 |
% The package \verb|mdframed| is used to make pretty foldable, but the |
| 3 |
% amsthm/mdframed conflict also messes up the .jax file so we don't |
| 4 |
% load mdframed when performing the xake step. But even the below |
| 5 |
% isn't enough to fix this. |
| 6 |
% \begin{macrocode} |
| 7 |
%\iftikzexport\else\RequirePackage[framemethod=TikZ]{mdframed}\fi |
| 8 |
% \end{macrocode} |
| 9 |
% \DescribeEnv{foldable}{Does it fold?} |
| 10 |
% \begin{macrocode} |
| 11 |
%<*classXimera> |
| 12 |
|
| 13 |
\colorlet{textColor}{black} % since textColor is referenced below |
| 14 |
\colorlet{background}{white} % since background is referenced below |
| 15 |
|
| 16 |
% The core environments. Find results in 4ht file. |
| 17 |
%% pretty-foldable |
| 18 |
%\iftikzexport |
| 19 |
\newenvironment{foldable}{% |
| 20 |
}{% |
| 21 |
} |
| 22 |
%\else |
| 23 |
%\renewmdenv[ |
| 24 |
% font=\upshape, |
| 25 |
% outerlinewidth=3, |
| 26 |
% topline=false, |
| 27 |
% bottomline=false, |
| 28 |
% leftline=true, |
| 29 |
% rightline=false, |
| 30 |
% leftmargin=0, |
| 31 |
% innertopmargin=0pt, |
| 32 |
% innerbottommargin=0pt, |
| 33 |
% skipbelow=\baselineskip, |
| 34 |
% linecolor=textColor!20!white, |
| 35 |
% fontcolor=textColor, |
| 36 |
% backgroundcolor=background |
| 37 |
%]{foldable}% |
| 38 |
%\fi |
| 39 |
|
| 40 |
%% pretty-expandable |
| 41 |
%\iftikzexport |
| 42 |
\newenvironment{expandable}{% |
| 43 |
}{% |
| 44 |
} |
| 45 |
%\else |
| 46 |
%\newmdenv[ |
| 47 |
% font=\upshape, |
| 48 |
% outerlinewidth=3, |
| 49 |
% topline=false, |
| 50 |
% bottomline=false, |
| 51 |
% leftline=true, |
| 52 |
% rightline=false, |
| 53 |
% leftmargin=0, |
| 54 |
% innertopmargin=0pt, |
| 55 |
% innerbottommargin=0pt, |
| 56 |
% skipbelow=\baselineskip, |
| 57 |
% linecolor=black, |
| 58 |
%]{expandable}% |
| 59 |
%\fi |
| 60 |
|
| 61 |
\newcommand{\unfoldable}[1]{#1} |
| 62 |
|
| 63 |
%</classXimera> |
| 64 |
% \end{macrocode} |
| 65 |
% On the web, these foldable elements could be HTML5 details and summary. |
| 66 |
% \begin{macrocode} |
| 67 |
%<*htXimera> |
| 68 |
\renewenvironment{foldable}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div id="foldable\arabic{identification}" class="foldable">}}{\HCode{</div>}\IgnoreIndent} |
| 69 |
|
| 70 |
\renewenvironment{expandable}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div data-original="expandable" id="foldable\arabic{identification}" class="foldable">} |
| 71 |
|
| 72 |
}{\HCode{</div>}\IgnoreIndent} |
| 73 |
|
| 74 |
\renewcommand{\unfoldable}[1]{\HCode{<span class="unfoldable">}#1\HCode{</span>}} |
| 75 |
%</htXimera> |
| 76 |
% \end{macrocode} |