jgm/pandoc — Issue #358: enh: "best practice" Unicode/SVG+PNG math for optimal HTML/Epub output
Author: rwst
Created: 2011-12-08 11:23:14+00:00
State: open

When using SVG for any rendering of text the decision must be made between
A) using a font character, giving the character in SVG, and including the font in the document; and
B) rendering the character as node path, giving the node paths in the SVG

Some devices cannot display A correctly, esp. all code using librsvg has this
open-for-years bug (Firefox, Mediawiki). But B loses all font information, most
notably the baseline shift which is needed to place the SVG correctly between
the text.

Thus, we propose as "best practice" to restrict inline math to that math which
can be displayed using Unicode characters, and moving anything else in its own
display line.

In the EPUB, displayed math should be rendered using the following XHTML construct:

...

(stolen from http://www.dessci.com/en/reference/ebooks/EPUBMath_spec.htm )
As the only EPUB reader capable of displaying SVG (Adobe Dig. Ed.) also understands
OPS 2.0 this can actually be tested. See also http://idpf.org/epub/20/spec/OPS_2.0.1_draft.htm

Since SVG is well supported (modulo the font bug) on all browsers, HTML output should
use SVG only for displayed math.

To come near to providing these formats via pandoc, a filter resembling the former math2svg
that works with the JSON presentation might be sufficient.