Mathml in CSS based PDF output

MariPe
Posts: 9
Joined: Wed Mar 06, 2019 4:35 pm

Mathml in CSS based PDF output

Post by MariPe » Tue Mar 26, 2019 11:16 pm

Hi there,

I want to style the MathML equations in my PDF output (css based, Oxygen 20.1). Am I right with the conclusion that any CSS styling applied to the <math>element is visible in HTML but not in PDF? The merged XML seems just to copy the whole math node without any styling.
I just want to change the font-family and margins but found no way to do so yet. I hope you have a hint for me!

Cheers
Maripe

Costin
Posts: 603
Joined: Mon Dec 05, 2011 6:04 pm

Re: Mathml in CSS based PDF output

Post by Costin » Thu Mar 28, 2019 12:14 pm

Hello,

Oxygen uses the JEuclid library to render MathML equations in the output and it seems JEuclid uses its own predefined fonts.
However, I logged this in our internal improvements tracking system so we will investigate this limitation and see if we could implement a solution to change the fonts.

We will let you know when/if we will find a way to do that.

However, as a workaround to change the margins, you could wrap the MathML equation (<m:math/> element in DITA) into a codeph or a paragraph and set a custom outputclass on it, so you could then match the outputclass in your customization CSS and apply the required margins or borders.
Unfortunately, this solution does not also work for changing the font-family.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

MariPe
Posts: 9
Joined: Wed Mar 06, 2019 4:35 pm

Re: Mathml in CSS based PDF output

Post by MariPe » Thu Mar 28, 2019 12:27 pm

Hi Costin,

thanks for the feedback. Unfortunately the font family is our more important requirement ;-)
But we will wait :)

Cheers!

Dan
Posts: 413
Joined: Mon Feb 03, 2003 10:56 am

Re: Mathml in CSS based PDF output

Post by Dan » Thu Mar 28, 2019 12:47 pm

We will try to find a fix. Can you let us know what font do you want to use for the equations?

Many regards,
Dan

Dan
Posts: 413
Joined: Mon Feb 03, 2003 10:56 am

Re: Mathml in CSS based PDF output

Post by Dan » Thu Mar 28, 2019 1:45 pm

Are the mathML equations inline or are stored as separate files?

Costin
Posts: 603
Joined: Mon Dec 05, 2011 6:04 pm

Re: Mathml in CSS based PDF output

Post by Costin » Thu Mar 28, 2019 6:05 pm

As a workaround, you could wrap your MathML equations in <equation-block/> or <equation-inline/> elements.
Then write a rule in your customization CSS that matches those equations and use the "Courier New" font, add padding, margins, borders or any other styling you want.

For example:

Code: Select all

*[class~="eqn-block"],
*[class~="eqn-inline"]{
font-family: 'Courier New';
padding: 1em;
margin-left: 2em;
border: solid red 1pt;
}
Costin
Costin Sandoi
oXygen XML Editor and Author Support

MariPe
Posts: 9
Joined: Wed Mar 06, 2019 4:35 pm

Re: Mathml in CSS based PDF output

Post by MariPe » Fri Mar 29, 2019 11:22 am

Thanks a lot! That works for us :D
Cheers!

Radu
Posts: 6498
Joined: Fri Jul 09, 2004 5:18 pm

Re: Mathml in CSS based PDF output

Post by Radu » Thu May 23, 2019 2:53 pm

Hi,

We released Oxygen 21.1 and it should have a fix for the original reported problem.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply