How to make the font of an HTML document consistent with the font used by MathJax to display math?

105 views
Skip to first unread message

Lone Learner

unread,
Mar 23, 2012, 7:14:15 AM3/23/12
to MathJax Users
I am using the following CSS to style my entire document.

body {
font-family: arial, sans-serif;
color: #111111;
}

But as you know MathJax displays math in a serif font. I want the non-
math text in my document to be consistent with the math displayed by
MathJax. I have two questions related to it.

1. What 'font-family' should I use in CSS so that it gives an output
that is reasonably consistent with the math displayed by MathJax in
all or most browsers?

2. How can I make MathJax use 'font-family: arial, sans-serif' as the
font to be used while displaying math?

Davide P. Cervone

unread,
Mar 23, 2012, 9:11:10 AM3/23/12
to mathja...@googlegroups.com
Please see the discussion at

https://groups.google.com/d/topic/mathjax-users/PjcC7lqbNGs/discussion

in particular my response at

https://groups.google.com/d/msg/mathjax-users/PjcC7lqbNGs/z-EafIHplpoJ

for several approaches to telling MathJax to use a sans-serif font for
typesetting the mathematics, and for why the answer to 2 is "you can't".

As for 1, I suppose you could set up CSS to use the MathJax web font
MathJax_Main as the main text font. But I'm not sure how effective it
would be.

Davide

Paul Topping

unread,
Mar 23, 2012, 1:08:33 PM3/23/12
to mathja...@googlegroups.com
It seems like a number of these requests are for a sans-serif style. We
should consider developing that as a choice. And perhaps defining a way
that others could create font sets that MathJax could use.

Paul

Thomas Leathrum

unread,
Mar 23, 2012, 3:03:17 PM3/23/12
to mathja...@googlegroups.com
Paul --

In the response to which Davide linked, he shows how to use the existing MathJax sans-serif fonts -- there already are sans-serif variants included in the web fonts.  Perhaps more to the point, we might want to set up a "standard" configuration file on the CDN which specifically tells MathJax to use the sans-serif web fonts in math expressions, essentially placing in one file all of the configuration that Davide wrote out in the linked response.  That would make the configuration for general use much shorter -- instead of having to include the full configuration for all of the output jax, you could just use a line to load the one configuration file.  It wouldn't be a long file, either.

Paul Topping

unread,
Mar 23, 2012, 3:48:23 PM3/23/12
to mathja...@googlegroups.com

Perhaps I misunderstood but I thought there were a bunch of caveats with Davide’s instructions. As you know, I am advocating a move away from a “you can make this work” level of support to more of a “we guarantee this to work” level. It is not that we can’t tolerate experimental use of MathJax but that we need to clearly delineate fully supported functionality from the rest for the benefit of those “customers” that need such guarantees. Davide does a good job of noting those things that are not 100% supported. I am merely pointing out things that sound to me to be worthy of raising to first class featurehood, if I may coin a term.

 

Paul

 

From: mathja...@googlegroups.com [mailto:mathja...@googlegroups.com] On Behalf Of Thomas Leathrum
Sent: Friday, March 23, 2012 12:03 PM
To: mathja...@googlegroups.com
Subject: Re: [mathjax-users] How to make the font of an HTML document consistent with the font used by MathJax to display math?

 

Paul --

Reply all
Reply to author
Forward
0 new messages