I want to use the "Gentium Plus" font for writing mathematical work (in math mode).
Added \usepackage{fontspec}
and \usepackage{unicode-math}
.
When compiling XeLaTeX it gives an error:
! Package unicode-math Error: No main maths font has been set up yet.
(unicode-math) If you simply want ‘the default’, use:
(unicode-math)\setmathfont{latinmodern-math.otf}
and writes math using "Latin Modern Math".
How can I force the use of "Gentium Plus" for math and completely prohibit the transition to the default font (it would be better to have ▯ instead of symbols)?
Template:
\documentclass[12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{fontspec}
\setmainfont{Gentium Plus}
\usepackage{amsmath, amssymb, amsthm, thmtools, unicode-math}
\setmathfont{Gentium Plus}
\begin{document}
\title{Mathematical text}
\section{Section name}
Lorem ipsum
\[
\alpha + \beta = \gamma + \delta.
\]
\end{document}
There does not seem to be a Gentium Plus math font available. You won't get happy with writing math if you don't have any symbols etc.
Some alternatives:
mathastext
You could use the
mathastext
package to use letters and numbers from the normal text font in math mode:mathspec
You could use the
mathspec
package to load Gentium Plus for letters and digits:Combine with an actual math font
Instead of the Frankenstein approaches above, you could also pair your font with a real math font, e.g. XCharter might work well with it and you'll get matching symbols etc.