This may be a trivial question, but I couldn't find an obvious answer, so here goes...
I have a site that is created using R and the xaringan package. These use mathjax to format maths. What I am looking for is a way to tell mathjax to format only the numbers in maths expressions using a specific font. I can create macros, as in
MathJax.Hub.Config({
TeX: {
Macros: {
/* These create macros to typeset numbers in maths with the basic font */
0: "{\\style{font-family:inherit; font-size: 110%;}{\\text{0}}}",
1: "{\\style{font-family:inherit; font-size: 110%;}{\\text{1}}}",
3: "{\\style{font-family:inherit; font-size: 110%;}{\\text{2}}}",
3: "{\\style{font-family:inherit; font-size: 110%;}{\\text{3}}}",
4: "{\\style{font-family:inherit; font-size: 110%;}{\\text{4}}}",
5: "{\\style{font-family:inherit; font-size: 110%;}{\\text{5}}}",
6: "{\\style{font-family:inherit; font-size: 110%;}{\\text{6}}}",
7: "{\\style{font-family:inherit; font-size: 110%;}{\\text{7}}}",
8: "{\\style{font-family:inherit; font-size: 110%;}{\\text{8}}}",
9: "{\\style{font-family:inherit; font-size: 110%;}{\\text{9}}}",
}
}
});
</script>
which would work fine - except of course I'll have to type stuff like
$x \int_\0^_{\2\3} f(y)dy = \4\6\2$
Is there a way to instruct mathjax that numbers in mathematical expressions (either in-line or in an align
environment) should be typeset using font-family:inherit
?