0

I'd fancy to use XeLaTeX with the font Cascadia Cod3 but the standard math font is not up to the task.

Is it possible to use a different, better matching math font or, as a second option, manipulate the default math font to increase a little bit its size and weight?

A minimal example, showing the poor match between Cascadia Cod3:

\documentclass[10pt]{article}
\usepackage{unicode-math,siunitx,xcolor}
\setromanfont{Cascadia Cod3}
\begin{document}
\section*{Impulsive Load}
We can compute the total impulse using the trapezoidal rule,
{\small
\begin{align*}
  m\Delta\dot{x} &\approx
  \SI{0}{\kilo\newton}\cdot\SI{10}{\milli\second} +
  \SI{40}{\kilo\newton}\cdot\SI{20}{\milli\second} +
  \SI{50}{\kilo\newton}\cdot\SI{20}{\milli\second} +
  \SI{30}{\kilo\newton}\cdot\SI{20}{\milli\second} +
  \SI{0}{\kilo\newton}\cdot\SI{10}{\milli\second} \\
  &=
  \SI{2400}{\newton\second}=\SI{2400}{\kilo\gram\metre\per\second}.
\end{align*}
}
\end{document}

enter image description here

gboffi
  • 911
  • 3
    It's unlikely that there is a perfect match for this monospaced sans-serif font. You could try Fira Math (see https://tex.stackexchange.com/questions/425098/which-opentype-math-fonts-are-available) – Sergei Golovan Jan 18 '22 at 11:02
  • @SergeiGolovan It's a good match, if only I could fine tune the size and the weight of one of the two fonts it'd be excellent. – gboffi Jan 18 '22 at 11:13
  • If you don't have complicate symbols in your math, you could use the mathastext package to use characters from your text font in math, see e.g. https://tex.stackexchange.com/questions/668939/change-math-font-to-arial/668942#668942 for an example how to use this with fontspec. – samcarter_is_at_topanswers.xyz Feb 13 '23 at 21:25

1 Answers1

1

First, I'd like to thank Sergei for his illuminating comment: "use FiraMath-Regular".

Now I have the following preamble

\documentclass[10pt]{article}
\usepackage{unicode-math,siunitx,xcolor}
\setromanfont{Cascadia Cod3}
\setmathfont{FiraMath-Regular}
\setmathfont[range=\mathup/{num}]{Cascadia Cod3}

and this is what I get (not too bad indeed)

enter image description here

gboffi
  • 911
  • 2
    Please, if you write on Physics, dont write the fraction for numeric result (infinite precision), but a decimal with a number of digits that your problem authorize. – Raffaele Santoro Feb 18 '22 at 06:12