Debian Codegraph @

texmf-dist/doc/latex/ximera/src/interactives/sagemath.dtx

raw
1 % \subsection{SageMath support}
2 % Load Sage\TeX\ if it exists.
3 % \begin{macrocode}
4 %<*classXimera>
5 \IfFileExists{sagetex.sty}{\RequirePackage{sagetex}}{}
6 %</classXimera>
7 % \end{macrocode}
8
9 % \DescribeEnv{sageCell}{Create an interactive SageMath widget.}
10 % \begin{macrocode}
11 %<*classXimera>
12 \DefineVerbatimEnvironment{sageCell}{Verbatim}{numbers=left,frame=lines,label=SAGE,labelposition=topline}
13 %</classXimera>
14 % \end{macrocode}
15 % \begin{macrocode}
16 %<*htXimera>
17 \renewenvironment{sageCell}{\NoFonts}{\EndNoFonts}
18 \ScriptEnv{sageCell}{\ifvmode \IgnorePar\fi \EndP\HCode{<div class="sage"><script type="text/x-sage">}\HtmlParOff}{\HtmlParOn\HCode{\Hnewline</script></div>}}
19 %</htXimera>
20 % \end{macrocode}
21
22 % \DescribeEnv{sageOutput}{Execute SageMath code and output the result.}
23 % \begin{macrocode}
24 %<*classXimera>
25 \DefineVerbatimEnvironment{sageOutput}{Verbatim}{numbers=left,frame=lines,label=SAGE-Output,labelposition=topline}
26 %</classXimera>
27 % \end{macrocode}
28
29 % \begin{macrocode}
30 %<*htXimera>
31 \renewenvironment{sageOutput}{\NoFonts}{\EndNoFonts}
32 \ScriptEnv{sageOutput}{\ifvmode \IgnorePar\fi \EndP\HCode{<div class="sageOutput"><script type="text/x-sage">}}{\HCode{\Hnewline</script></div>}}
33 %</htXimera>
34 % \end{macrocode}
35
36 % \DescribeEnv{sageSilent}{Execute SageMath code without outputing the result.}
37 % \begin{macrocode}
38 %<*htXimera>
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40 \renewenvironment{sagesilent}{\NoFonts}{\EndNoFonts}
41 \ScriptEnv{sagesilent}{\ifvmode \IgnorePar\fi \EndP\HCode{<script type="text/sagemath">}\HtmlParOff}{\HtmlParOn\HCode{</script></div>}}
42 %</htXimera>
43 % \end{macrocode}