Debian Codegraph @

texmf-dist/doc/latex/ximera/src/outcomes.dtx

raw
1 % \subsubsection{Learning Outcomes}
2 % \DescribeMacro{\outcome}{Specify a learning outcome, either at the level of a |problem| or an entire document in the preamble.}
3 % \begin{macrocode}
4 %<*classXimera>
5 \def\theoutcomes{}
6
7 \ifdefined\HCode%
8 \newcommand{\outcome}[1]{}
9 \else%
10 \newwrite\outcomefile
11 \immediate\openout\outcomefile=\jobname.oc
12
13 \newcommand{\outcome}[1]{\edef\theoutcomes{\theoutcomes #1~}%
14 \immediate\write\outcomefile{\unexpanded{\outcome}{#1}}}
15 \fi%
16 %</classXimera>
17 % \end{macrocode}
18 % These can appear in either the preamble or in problem environments.
19 % with pdflatex, we produce the .oc file which includes ALL the
20 % outcomes; in the tex4ht world, we just produce spans for the
21 % specific outcomes.
22 % \begin{macrocode}
23 %<*cfgXimera>
24 \renewcommand{\outcome}[1]{
25 \Configure{@HEAD}{\HCode{<meta name="learning-outcome" content="#1"/>\Hnewline}}
26 }
27 % Sometimes there are no outcomes at all
28 \IfFileExists{\jobname.oc}{\input{\jobname.oc}}{}
29
30 \renewcommand{\outcome}[1]{%
31 \HCode{<span class="learning-outcome">#1</span>}
32 }
33 %</cfgXimera>
34 % \end{macrocode}