1

I'm using mathspec to use an .otf font in Overleaf via the command:

setromanfont{myfont}[Path=./fonts/myfont, Extension = .otf, Uprightfont=*-regular]

myfont-regular.otf being the font file placed in a folder pointed at by the Path=.

which works great for all my normal text. However there is also a math version of the font that I would like to use for math: myfont-math.otf however I cannot find a way to import it with the mathspec package, all my attempts at using the \setmath(s)font have been futile. I've looked around and found some articles from Overleaf with instructions of how to use a .ttf font with tfm/map/type1 files but not much so far on how to do this is XeLaTeX. It might help to mention that I have all these files for my font as it has been designed to work with TeX.

Can anyone guide me in the right direction of how to do this?

HanLar
  • 11
  • if the math font is an opentype math font with a MATH table, use unicode-math rather than mathspec – David Carlisle Feb 28 '22 at 15:20
  • Thank you! This is exactly what I was looking for. I looked up the difference between mathspec and unicode-math and got the impression that they were mostly identical packages which led me down the wrong path. – HanLar Feb 28 '22 at 15:37
  • For reference, David Carlisle has an example how to use otf font with mathspec here https://tex.stackexchange.com/a/650190/250119 – user202729 Jul 08 '22 at 09:24

1 Answers1

1

If the math font is an opentype math font with a MATH table, use unicode-math rather than mathspec.

David Carlisle
  • 757,742
  • is it possible to check if the font has a MATH table in it? – Masum Mar 15 '22 at 10:30
  • 1
    @Masum look in a font editor such as fontforge or simply use the font with \setmathfont in unicode-math package, it will complain about it not being there. If the font hasn't got "math" in its name, it probably has not got a math table. – David Carlisle Mar 15 '22 at 10:33