Page 1 of 1
CSS with MathML not working?
Posted: Mon Nov 03, 2025 3:01 pm
by Vinny
Folks,
I've been trying to use CSS to alter the way portions of a MathML code look. For example, having the font after <msup> being smaller, with a code like this in my CSS file:
Code: Select all
@namespace m "http://www.w3.org/1998/Math/MathML";
...
m|msub > * + *, m|msup > * + * {
font-size: 20%;
}
However, nor this, nor any CSS code, seems to work with MathML (with or without namespace, btw). Is that expected, or am I missing something?
Thanks a lot,
Vincent
Re: CSS with MathML not working?
Posted: Mon Nov 03, 2025 3:53 pm
by Radu
Hi,
Can you give us more details? Is this question more about how the MathML equation looks like when editing the XML document in the Author visual editing mode or when it is published? If you mean the latter, do you publish to HTML or PDF? Are you using Oxygen's WebHelp and CSS-based PDF publishing formats?
Regards,
Radu
Re: CSS with MathML not working?
Posted: Mon Nov 03, 2025 4:10 pm
by Vinny
Hi Radu,
yes, excuse me. It’s when outputting to a PDF, using the Oxygen[colours] template.
But in Author mode, I had just a placeholder and no output, as you can see on the attached screenshot.
Screenshot 2025-11-03 at 14.08.58.png
Also, the equation is automatically generated by a parser from a LaTEX source.
Re: CSS with MathML not working?
Posted: Tue Nov 04, 2025 11:13 am
by julien_lacour
Hi Vinny,
Currently Oxygen PDF Chemistry only supports MathML CSS customization at global level (applied on the whole equation), however I added your vote to the improvement request to extend this support to inner elements so you will be able to change the font-size for msub/msup elements.
I will notify this thread again when the support will be available.
Regards,
Julien