diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml b/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml index 709150f1b9d..cd1a45ef945 100644 --- a/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml +++ b/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml @@ -15,17 +15,31 @@ sub makeNCName { $ncname; } sub simple_wrapper { - my @input = @_; + #Deref if array reference + my @input; + foreach (@_) { + if (ref $_ && $_ =~ /ARRAY/ && $_ !~ /LaTeXML/) { + @input=(@input,@$_); + } else + { push (@input,$_); } + } return '' if (!@input); - @input = map(split(/\s*,\s*/,$_->toString),@input); + @input = map(split(/\s*,\s*/,ToString($_)),@input); my $output=join(" ",@input); $output=~s/(^ )|[{}]//g; #remove leading space and list separator brackets $output||''; } sub hash_wrapper{ - my @input = @_; + #Deref if array reference + my @input; + foreach (@_) { + if (ref $_ && $_ =~ /ARRAY/ && $_ !~ /LaTeXML/) { + @input=(@input,@$_); + } else + { push (@input,$_); } + } return '' if (!@input); - @input = map(split(/\s*,\s*/,$_->toString),@input); + @input = map(split(/\s*,\s*/,ToString($_)),@input); my $output=join(".sym #",@input); $output=~s/(^\.sym )|[{}]//g; #remove leading space and list separator brackets "#$output"||''; @@ -42,6 +56,7 @@ DefCMPEnvironment('{example} OptionalKeyVals:omtext', "<omdoc:example " . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " . "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" . "<omdoc:CMP><omdoc:p>#body" . "</omdoc:example>\n"); DefCMPEnvironment('{axiom} OptionalKeyVals:omtext', @@ -106,7 +121,7 @@ DefCMPEnvironment('{definition} OptionalKeyVals:omtext', sub{definitionBody(@_)} DefCMPEnvironment('{notation} OptionalKeyVals:omtext', "<omdoc:definition " . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id').not')()" - . "?&KeyVal(#1,'for')(for='&simple_wrapper(&KeyVal(#1,'for'))')()>" + . "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()>" . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" . "<omdoc:CMP><omdoc:p>#body" . "</omdoc:definition>\n"); @@ -241,6 +256,8 @@ DefConstructor('\atwindefalt[]{}{}{}{}', $whatsit->setProperty(theory=>LookupValue('current_module')); return; }, alias=>'\atwindef'); +DefConstructor('\inlineex OptionalKeyVals:omtext {}', + "<omdoc:phrase type='example'>#2</omdoc:phrase>"); DefConstructor('\inlinedef OptionalKeyVals:omtext {}', sub { my ($document, $keyvals, $body, %props) = @_; my $for = $keyvals->getValue('for') if $keyvals; |