[XeTeX] XeTeX maintenance

Simon Cozens simon at simon-cozens.org
Mon Apr 27 14:40:56 CEST 2015


On 27/04/2015 19:39, Philip Taylor wrote:
> As to whether "XML is a particularly good format not only here or for
> anything", all I can say is that in my experience we (humanity, that is)
> have not yet come up with anything better; LaTeX 2e, by explicitly
> permitting the conflation of form and content, fails abysmally in this
> respect (IMHO, of course).

For what it's worth, SILE's approach to this is to have pluggable input
parsers, shipping with an XML and a "TeX-like" parser by default.

People who use software tools to author their documents, or convert them
in from other sources, can use the XML syntax; people authoring by hand
can use the TeX-like syntax. The two syntaces are isomorphic:

 <foo thing="wibble">bar</foo>
is equivalent to
 \foo[thing=wibble]{bar}
and is also equivalent to
 \begin[thing=wibble]{foo}bar\end{foo}

This means that if you have an XML document you want to typeset, you can
define processing expectations for its tags in an auxiliary class:

 SILE.registerCommand("foo", function(options,content)
    SILE.process(content)
    if options.thing == "wibble" then
        SILE.typeset(" (wobble)")
    end
 end)

 % Or even \define[command=foo]{\dowhatever{\process}}

and then load in the class on the command line; the upshot being you can
then feed the XML file directly to SILE without having to mess about
with XSLT or whatever.

I haven't tried creating tagged PDFs with SILE yet - there isn't support
for this in the libtexpdf library so it would mean messing about with
raw PDF specials (essentially what luatex was doing). I don't need the
functionality myself right now, so it's not a priority.

But if this is going to be a big deal, and it sounds like it might be,
then it could be worth adding specials for PDF tagging into libtexpdf
and dvipdfmx.

S


More information about the XeTeX mailing list