4

I'm working on submitting a manuscript-style scholarship essay, and the formatting must be 12pt Arial. Which I was able to get working using LuaLaTeX. However, once I got that working, I quickly realized the math font looked awkward with the bolder style of Arial.

Can the math font be changed to Arial inside the document? I have always been confused about changing math fonts within LaTeX documents.

How do I change the math font to match something closer to Arials style?

Thanks!

\documentclass[12pt, letterpaper]{article}
\usepackage[margin=1in
%,showframe
]{geometry}
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{fancyhdr}
\usepackage{physics}
\fancyhf{}
\pagestyle{fancy}
\lhead{Undergrad Student} % your name here
\rhead{The University}
\usepackage[style=numeric,sorting=none]{biblatex}
\addbibresource{references.bib}
\setlength{\headheight}{12.5pt}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{*.5}{*.5}
\titleformat*{\section}{\normalsize\bfseries}
\usepackage{lipsum}

\begin{document}
\begin{center}
{\underline{Math in Arial}}
\end{center}
\section{Introduction}
I think the default math font looks odd when paired with Arial. Here is an example: $n = 4$. The math just looks a lot weaker than the text. $\int_0^{\frac{\pi}{2}} \int_0^1 x \sin{(x^2-y)}\dd{y}\dd{x}$\\\\
Is there a way to use Arial font for the math symbols? $(n-1) + (2^n + 1) = 2^n + n$\\

\noindent \lipsum[1]


\end{document} 

enter image description here

5
  • 2
    There aren't many sans math fonts available. See Which OpenType Math fonts are available? for some options. Fira or GFS Neohellenic are probably the only options if you need a full math font.
    – Alan Munn
    Commented Dec 18, 2022 at 15:23
  • But when I try to incorporate them into my document it doesn't work. Adding \usepackage{unicode-math} and \setmathfont{XITS Math} results in a compilation error that font "XITS Math" cannot be found. I tried this with some of the other ones also, same error. My preamble already utilizes \usepackage{fontspec}. Would these clash?
    – Ziggy
    Commented Dec 18, 2022 at 15:28
  • 1
    With lualatex it's usually easier to use the actual filename when loading the font. Try e.g. \setmathfont[Scale=MatchUppercase]{FiraMath-Regular.otf}. But be careful, as it seems to be missing some characters.
    – Alan Munn
    Commented Dec 18, 2022 at 16:03
  • @AlanMunn I'm considering fira for a project. Care to elaborate on missing some characters?
    – daleif
    Commented Dec 18, 2022 at 18:41
  • 1
    @daleif Responded in chat.
    – Alan Munn
    Commented Dec 18, 2022 at 20:19

1 Answer 1

6

The proper way would be to use unicode-math with a sans-serif math font.

However there aren't a lot of sans-serif math fonts available. If you need a specific font family which does not have a math font, you could give the mathastext package a try. This will substitute math characters with the letters and numbers from the normal text. The result isn't perfect, but worth trying...

% !TeX TS-program = lualatex
\documentclass[12pt, letterpaper]{article}
\usepackage[margin=1in
%,showframe
]{geometry}
\usepackage[no-math]{fontspec}
\setmainfont{Arial}
\usepackage{mathastext}
\usepackage{fancyhdr}
\usepackage{physics}
\fancyhf{}
\pagestyle{fancy}
\lhead{Undergrad Student} % your name here
\rhead{The University}
\usepackage[style=numeric,sorting=none]{biblatex}
\addbibresource{references.bib}
\setlength{\headheight}{12.5pt}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{*.5}{*.5}
\titleformat*{\section}{\normalsize\bfseries}

\usepackage{lipsum}



\begin{document}

\begin{center}
{\underline{Math in Arial}}
\end{center}
\section{Introduction}
I think the default math font looks odd when paired with Arial. Here is an example: $n = 4$. The math just looks a lot weaker than the text. $\int_0^{\frac{\pi}{2}} \int_0^1 x \sin{(x^2-y)}\dd{y}\dd{x}$\\\\
Is there a way to use Arial font for the math symbols? $(n-1) + (2^n + 1) = 2^n + n$\\

\noindent \lipsum[1]


\end{document} 

enter image description here


If you are only worried that Arial looks bolder than your math font, you could try a bolder serif math font. There you'll have a much bigger selection of full-fledged math fonts, e.g.

% !TeX TS-program = lualatex
\documentclass[12pt, letterpaper]{article}
\usepackage[margin=1in
%,showframe
]{geometry}


\usepackage[bitstream-charter]{mathdesign}

\usepackage[no-math]{fontspec}
\setmainfont{Arial}
\usepackage{fancyhdr}
\usepackage{physics}
\fancyhf{}
\pagestyle{fancy}
\lhead{Undergrad Student} % your name here
\rhead{The University}
\usepackage[style=numeric,sorting=none]{biblatex}
\addbibresource{references.bib}
\setlength{\headheight}{12.5pt}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{*.5}{*.5}
\titleformat*{\section}{\normalsize\bfseries}

\usepackage{lipsum}



\begin{document}

\begin{center}
{\underline{Math in Arial}}
\end{center}
\section{Introduction}
I think the default math font looks odd when paired with Arial. Here is an example: $n = 4$. The math just looks a lot weaker than the text. $\int_0^{\frac{\pi}{2}} \int_0^1 x \sin{(x^2-y)}\dd{y}\dd{x}$\\\\
Is there a way to use Arial font for the math symbols? $(n-1) + (2^n + 1) = 2^n + n$\\

\noindent \lipsum[1]


\end{document} 

enter image description here

2
  • Thank you! This one did the trick \usepackage[bitstream-charter]{mathdesign}.
    – Ziggy
    Commented Dec 18, 2022 at 16:05
  • @Ziggy You're welcome! Commented Dec 18, 2022 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .