# -*- CPERL -*- package LaTeXML::Package::Pool; use strict; use LaTeXML::Package; RequirePackage('problem'); RegisterNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); DefEnvironment('{assignment} OptionalKeyVals:assig', "" . "" . "" . "Assignment ?&KeyVal(#1,'num')(&KeyVal(#1,'num').)()" . "?&KeyVal(#1,'title')((&KeyVal(#1,'title')))" . "" . "?&KeyVal(#1,'given')(&KeyVal(#1,'given'))()" . "?&KeyVal(#1,'due')(&KeyVal(#1,'due'))()" . "?&KeyVal(#1,'pts')(&KeyVal(#1,'pts'))()" . "" . "#body" ."\n", afterDigest=> sub { my ($stomach, $kv) = @_; my $kvi = LookupValue('inclassig'); my @keys = qw(id num title pts given due); my @vals = $kvi && map($kvi->getValue($_), @keys); foreach my $i(0..$#vals) { $kv->setValue($keys[$i],$vals[$i]) if $vals[$i]; }});#$ DefMacro('\includeassignment [] {}', sub { my ($stomach, $arg1, $arg2) = @_; AssignValue('inclassig',$arg1) if $arg1; (Invocation(T_CS('\input'),$arg2)->unlist); }); DefMacro('\inputassignment [] {}','\input{#2}'); DefEnvironment('{testheading}OptionalKeyVals:omdoc',''); DefConstructor('\testspace{}',''); DefConstructor('\testnewpage',''); DefConstructor('\testemptypage',''); 1;