I want to embed SVGs in docbook. These SVGs are generated by mathjax and
look like the following:

<svg xmlns:xlink="http://www.w3.org/1999/xlink"; width="8.976ex"
height="2.676ex" style="vertical-align: -0.338ex;" viewBox="0 -1006.6
3864.5 1152.1" role="img" focusable="false"
xmlns="http://www.w3.org/2000/svg"; aria-labelledby="MathJax-SVG-1-Title">
<title id="MathJax-SVG-1-Title">E = mc^2</title>
<defs aria-hidden="true">
<path stroke-width="1" ...

I use the 'passthrough' feature of asciidoctor like here:

++++
<mediaobject id="svg">
<imageobject>
<imagedata format="SVG" fileref="examples/svg/mathjax.svg"/>
</imageobject>
</mediaobject>
++++

The result is a docbook with the image(s) embedded. However, when I try
to transform that with the xslt20-stylesheets to xsl-fo, Apache FOP
throws an NullPointerException. I looked a the code and found out it is
because Apache FOP could not determine the font size in the current context.

Hence the problem could be avoided by changing the attributes 'width'
and 'height' of the SVG like this:

<svg xmlns:xlink="http://www.w3.org/1999/xlink"; width="89.76"
height="26.76" ...>...

I wonder if I could do better. In the xslt20-stylesheets, is there a way
to get the font size of the current context (for mediaobjects and/or
inlinemediaobjects)?

Kind regards,

aanno



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Reply via email to