To Change fonts of MathJax

What I’m trying to do

I am not ok with the Way my Math Formulas look now. I would like to change it to one of my favorite fonts “Arial Narrow”. But unfortunately I was not able to figure out a way to achieve this.

Things I have tried

  • I did not find an option to change the font of MathJax from Appearance.
  • I tried using the following css but it changed only the part of \text{Text}.
MJX-TEX {
    font-family: "Arial Narrow" !important;
}
  • I want the change to be applied to my entire formula.
  • It would be a great help if this is achieved.

The above CSS is missing something: MJX-TEX is a class name, so you have to prefix it with a dot, like this:

.MJX-TEX {
    font-family: "Arial Narrow";
}

I don’t think the !important part is actually important in this case, though…

Without !important it did not work. Anyway it is not working fully.

$Hi = \text{Hi}$

image|

I want all the text to look like the second Hi in MathJax using “Arial Narrow” as the font.

Then here’s a last resort quick & dirty solution:

.MJX-TEX,
.MJX-TEX * {
    font-family: "Arial Narrow" !important;
}
.mjx-i {
	font-style: italic !important;
}

Thank You So Much It worked with a small change.

.MJX-TEX,
.MJX-TEX * {
    font-family: "Arial Narrow" !important;
}
.mjx-i {
        font-family: "Arial Narrow" !important;
}

image

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.