[tex4ht] HTML5 output (Was: [bug #340] Math issues ...)

William F Hammond hammond at csc.albany.edu
Thu Nov 24 20:05:35 CET 2016

Michal --

You write in part:

> We still don't have HTML5 output unfortunately - basic
> structure shouldn't be that hard to support, but what
> about new semantic or accessibility
> attributes. ...

There's very little difference between tex4ht's xhtml output
and what is required for the text/html serialization of
html5.

In the summer of 2012 via this list you explained to me how
to get html5.  To the extent that I use tex4ht (for things
originating with others) that has been working for me (with
a few mods).

I'll append the driver script and the cfg (for use with
MathJax) that I've been using.

As for semantic improvement I think beginning with profiled
LaTeX will be essential.

For accessibility, I think that MathML is too close to
printer language.  As with math in general, it will be
better not to go too far from the mainstream.

As CSS gets better and better, the best bet for math
rendering in all browsers may be using the XML form of a
suitable LaTeX profile with CSS.  Chrome, Firefox, and Safari
are all good with this.  (See my talk at TUG 2014.)

Likewise I think the XML form of such a LaTeX profile will
be better for accessibility than HTML with MathML.

-- Bill

Driver:

------------------------------
#!/bin/sh
mk4ht xhmlatex \$1 "ht5mathjax"
------------------------------

ht5mathjax.cfg:

------------------------------
% WFH modification of code by Michal Hoftich, 02 Aug 2012
\Preamble{xhtml,mathml}
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
(http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
rel="stylesheet" type="text/css"
href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML"\Hnewline
></script>\Hnewline}}