Aw: Re: [docbook] LaTeX math inside docbook, on-the-fly MathML conversion?

From
Marco Giebel <>
Date
2015-01-29T20:48:23+00:00
ID
trinity-30ba8a95-e269-4f80-a8e7-102c79c9541c-1422564490111@3capp-gmx-bs64
Thread
Aw: Re: [docbook] LaTeX math inside docbook, on-the-fly MathML conversion?
I read about <mathphrase>. However, this element is only for a linear sequence of symbols. Not for sums, integrals, matrices or multiline equations.

 

Gesendet: Donnerstag, 29. Januar 2015 um 21:29 Uhr

Von: "Thomas Schraitle" <>

An: 

Betreff: Re: [docbook] LaTeX math inside docbook, on-the-fly MathML conversion?

Hello Marco,

Am Donnerstag, 29. Januar 2015, 20:46:30 schrieb Marco Giebel:

> [...]

> My idea is to include some <latexmath> element in a document like

>

> <para>

> <latexmath>\sum_{n=1}^\infty \frac 1 n</latexmath> is divergent.

> </para>

There is no <latexmath> element in DocBook. However, you can have the same

functionality with equation (for block formulas) or inlineequation (inside a

paragraph). For example, an inline equation of Einsteins famous formula could

look like:

<inlineequation>

<mathphrase role="latex">E = mc^2</mathphrase>

</inlineequation>

> This element should be translated to MathML during processing - either as a

> preprocessing step or using xslt commands if possible.

>

> Can this be done? Or do I have to parse my documents, find all <latexmath>

> elements, process their contents with LatexML and write the MathML output

> back into the document?

Sure. In theorey, it needs a three step process: extract all LaTeX formulas,

convert it to MathML (or maybe graphics?), and reinsert it -- or include a

reference.

How many formulas do you have? Do they change frequently? Well, maybe you

don't need such a sophisticated convertion. Perhaps you could reference your

MathML formulas with xi:include and do the convertion outside your workflow.

Get some ideas by reading Bob's chapter about Math in DocBook at

http://www.sagehill.net/docbookxsl/Math.html

Hope this helps. :)

--

Gruß/Regards

Thomas Schraitle

---------------------------------------------------------------------

To unsubscribe, e-mail: 

For additional commands, e-mail: