## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

 Options: Use Forum View Use Monospaced Font Show Text Part by Default Show All Mail Headers Message: [<< First] [< Prev] [Next >] [Last >>] Topic: [<< First] [< Prev] [Next >] [Last >>] Author: [<< First] [< Prev] [Next >] [Last >>]

```Will> When I wrote my message I was unaware of the (seemingly otherwise
Will> invisible?) pmml2tex

lars> (Wow! Googling for pmml2tex finds that page *only*.)

it's not hidden (it's on a publically web accessible svn server)

http://svn.openmath.org/OpenMath3/xsl/pmml2tex.xsl

development and liable to random breaking changes and things become so
much more complicated if you have any users:-)

Will> Basically, count me in, but I can't guarantee buckets of time.

ah we all know about that feeling:-)

Lars> I'm a bit curious, though: The goals for pmml2tex is stated as
Lars> "rendering via conversion via OpenMath to Presentation mathml and
Lars> TeX".

Whoever wrote that wasn't telling the truth....

pmml2tex goes straight from pmml to (la)tex

in the same family of xslt stylesheets there is a conversion from
content mathml to presentation (which means you can also typeset Content
MathML to TeX by linking these together, or show content mathml in
firefox, by using firefox's presentation mathml engine)

Then there are xslt that go from Content Mathml to OpenMath and OpenMath
to (Strict) Content MathML. By chaining these togeher you can convert from
full, MathMl2-style Content MathML to the OpenMath-aligned strict subset
in MathML3. All the examples of such transformations in the MathML3 spec
were generated this way.

and xslt to go from OpenMath to presentation mathML.

Lars> So is PMML in your mind an optimal intermediate when going  OM->TeX,

Yes. If you mint a new OM Content Dictionary you usally want to give a
notational style for your defined functions. If you do this as
presentation mathml it is easy to chain that to existing transformations
to TeX, or ascii-art or braille or whatever. If on the other hand you
specify the notation with a direct transform to TeX it's easier to fine
tune the TeX typesetting, but you have to specify the notation all over
again when you decide you want mathml, or braille or something else as
translating the TeX to something else is not impossible but definitely
harder than translating MathML.

Lars> (I should perhaps add that I considered sensible formatting of the
Lars> generated LaTeX code to be important; since it's going into a document
Lars> that I'll do editing of, I don't want it to be a compact block of
Lars> commands without any hint of the logical structure of the
Lars> formula.)

Yes there's some tension there. For forward use as hand edited TeX you'd
probably sometimes want to drop some extra spacing that you'd need for
full mathml conformance. Currently pmml2tex is somewhere in between the
TeX that comes out isn't too unnatural but in some cases the layout is
just what TeX does, rather than forcing it to do exactly as specified in
tthe mathml, so if support for all the finer points of the mathml layout
rules were added, the TeX would (by default) become increasingly
unnatural for hand editing.

An alternative approach, which may be better would be to have a tex
syntax for mathml (or any xml) so that
<mi lspace="2em>x</mi><mo form="postfix">+</mo> ...

just comes out as

\mi[lspace=2em][x}\mo[form=postfix]{+}....

or some such syntax so the translation of any given instance to TeX is
trivial and you just put the actual work into the package defining the