1

I would like to use my custom font for mathematical symbols like integrals and summation. I have a font file (Font.ttf) with my own font, the same gets applied to numbers, letters and operators (+-) but not to integrals or summation or the operator (▽).

The following is the code.

\documentclass[a4paper, 20pt]{extarticle}
\usepackage{mathspec}

\setmainfont{Font.ttf}
\usepackage{mathastext}
\setmathrm{Font}
\setmathfont(Greek)[Uppercase=Regular,Lowercase=Regular]{Font}

\begin{document}

\begin{equation}
    \int_{a}^{b}5a^2_5-a^2 dx  =  \frac{\sin \theta}{x}
\end{equation}

$$ \lambda \alpha \beta \nabla sin sin ( \delta) \Delta \theta$$

\end{document}

The output:

This is the output I get.

Quick Note: I m a beginner to the language, hence try answering in a beginner friendly manner.

Edit 1 I would like it add that I recently came across MnSymbol package which I feel could be useful in this scenario. However, m unable to find how to use the same.

2
  • If your custom font doesn't have math characters, hope it won't work as you expected ...
    – MadyYuvi
    Commented Mar 17, 2022 at 4:07
  • @MadyYuvi My custom font has math characters. Commented Mar 18, 2022 at 11:34

1 Answer 1

1

Although I don’t have your font to test, assuming that it’s an OpenType font with a MATH table, you want to load it with unicode-math. Something like,

\usepackage[math-style=upright]{unicode-math}

\setmainfont{font.ttf} % Possibly set AutoFakeBold and AutoFakeSlant?
\defaultfontfeatures{Scale = MatchUppercase}
\setmathfont{GFS Neohellenic Math} % Or your fallback math font of choice.
\setmathfont{font.ttf}[ range={ up, % Upright letters and numerals
                                "222B-"2333, "2A0C-"2A1C, % Integrals
                                \sum, \prod, \coprod % Etc.
                              }
                      ]
1
  • Thanks for your contribution. However my font is custom made and not an OpenType Font. ~M a newbie in the language, so probably I m missing the point here. Commented Mar 14, 2022 at 8:07

You must log in to answer this question.

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