Name
cx:mathml-to-svg — Convert MathML to SVG.
Synopsis
<p:declare-step
type
="
cx:mathml-to-svg
"
xmlns:cx
="
http://xmlcalabash.com/ns/extensions
"
>
<p:input
port
="
source
"
sequence
="
false
"
/>
<p:input
port
="
parameters
"
kind
="
parameter
"
/>
<p:output
port
="
result
"
sequence
="
false
"
/>
</p:declare-step>
Introduced in
Description
This step is a wrapper for the JEuclid library. It converts MathML markup to SVG.
The following parameters are recognized:
antialias, antialias-minsize, debug, display, fonts-doublestruck, fonts-fraktur, fonts-monospaced, fonts-sansserif, fonts-script, fonts-serif, mathbackground, mathcolor, mathsize, mfrac-keep-scriptlevel, scriptlevel, scriptminsize, scriptsizemultiplie. They map to the underlying JEuclid parameters
in the obvious way. The string value specified for each parameter is
interpreted directly by JEuclid through the
fromString
method.
Here's an example:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<int/>
<bvar>
<ci>x</ci>
</bvar>
<interval>
<ci>a</ci>
<ci>b</ci>
</interval>
<apply><cos/>
<ci>x</ci>
</apply>
</apply>
</math>
Running this through cx:mathml-to-svg
with a
“mathsize” parameter of “25f” produces:
(Assuming your user agent can display SVG.)
The cx:mathml-to-svg
step is often used in
a p:viewport
, for example:
<p:viewport match="mml:*">
<cx:mathml-to-svg>
<p:input port="parameters">
<p:empty/>
</p:input>
<p:with-param name="mathsize" select="'25f'"/>
</cx:mathml-to-svg>
</p:viewport>
Implementation
This step is implemented by the xmlcalabash1-mathml-to-svg module. The jar file from that project must be in the class path in order to use this step.
Notices
This product includes software developed by JEulid (http://www.sourceforge.net/projects/jeuclid/).