Page 1 of 1

Mathml in CSS based PDF output

Posted: Tue Mar 26, 2019 11:16 pm
by MariPe
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

Re: Mathml in CSS based PDF output

Posted: Thu Mar 28, 2019 12:14 pm
by Costin
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

Re: Mathml in CSS based PDF output

Posted: Thu Mar 28, 2019 12:27 pm
by MariPe
Hi Costin,

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

Cheers!

Re: Mathml in CSS based PDF output

Posted: Thu Mar 28, 2019 12:47 pm
by Dan
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

Re: Mathml in CSS based PDF output

Posted: Thu Mar 28, 2019 1:45 pm
by Dan
Are the mathML equations inline or are stored as separate files?

Re: Mathml in CSS based PDF output

Posted: Thu Mar 28, 2019 6:05 pm
by Costin
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

Re: Mathml in CSS based PDF output

Posted: Fri Mar 29, 2019 11:22 am
by MariPe
Thanks a lot! That works for us :D
Cheers!

Re: Mathml in CSS based PDF output

Posted: Thu May 23, 2019 2:53 pm
by Radu
Hi,

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

Regards,
Radu