I see that on some pages other than Overleaf that use LaTeX for math code (such as Wikipedia as in this picture) has its letters look bolder than those of Overleaf. How can I set mathversion to look like this, I tried \mathversion{bold} but it's too bad.
-
7wikipedia is not using latex it is using (depending on settings) mathjax or native mathml rendering. you can use the browser "inspect" menu to check which fonts it is using– David CarlisleCommented Jul 1 at 10:05
-
Looks like the text font is Roboto and the math font is MathJax TeX font (with MathJax rendering engine).– Apoorv PotnisCommented Jul 2 at 7:32
-
Note that the text font used on Wikipedia would generally differ on different devices, and your custom settings, if you have set them.– Apoorv PotnisCommented Jul 2 at 7:53
2 Answers
The text font is Arial (see also using word editor) and the math font is Computern Modern. Compiling with XeLaTeX
engine you will have:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{parskip}
\usepackage{fontspec}
\setmainfont{Arial}
\begin{document}
\textbf{Proof.} Recall the standard integral (case of the Gamma function)
\[\int_0^\infty t^je^{-t}dt=j!\]
valid for any natural number $j$. More generally, if $g(t)=\sum_{j=0}^mb_jt^j$ then
\[\int_0^\infty g(t)e^{-t}dt=\sum_{j=0}^mb_jj!.\]
\end{document}
The text font used looks like Roboto, while the math font is the default MathJax TeX math font. I don't think the MathJax TeX .otf
fonts can be used in LaTeX as they lack an OpenType Math table. But you can use MLModern fonts, which are similar in look.
% Compile with pdflatex
\documentclass[a4paper,12pt]{article}
\usepackage[sfdefault]{roboto}
\usepackage{mlmodern}
\begin{document}
\textbf{Proof.} Recall the standard integral (case of the Gamma function)
\[\int_0^\infty t^je^{-t}dt=j!\]
valid for any natural number $j$. More generally, if $g(t)=\sum_{j=0}^mb_jt^j$ then
\[\int_0^\infty g(t)e^{-t}dt=\sum_{j=0}^mb_jj!.\]
\end{document}
A modern alternative are the NewCM fonts, which have a MATH table.
% Compile with LuaLaTeX or XeLaTeX
\documentclass[a4paper, 12pt]{article}
\usepackage{microtype}
\usepackage[newcmbb]{fontsetup}
\setmainfont{Roboto}
\begin{document}
\textbf{Proof.} Recall the standard integral (case of the Gamma function)
\[\int_0^\infty t^je^{-t}dt=j!\]
valid for any natural number $j$. More generally, if $g(t)=\sum_{j=0}^mb_jt^j$ then
\[\int_0^\infty g(t)e^{-t}dt=\sum_{j=0}^mb_jj!.\]
\end{document}
In case you want a true sans serif font for math, you can try the newly released Noto Sans Math.
\documentclass[a4paper, 12pt]{article}
\usepackage{microtype}
\usepackage{unicode-math}
\setmainfont{Noto Sans}
\setmathfont{NotoSansMath-Regular.otf}
\setmonofont{Noto Sans Mono}
\begin{document}
\textbf{Proof.} Recall the standard integral (case of the Gamma function)
\[\int_0^\infty t^je^{-t}dt=j!\]
valid for any natural number $j$. More generally, if $g(t)=\sum_{j=0}^mb_jt^j$ then
\[\int_0^\infty g(t)e^{-t}dt=\sum_{j=0}^mb_jj!.\]
\end{document}