1

I want to change the math font by mathspec. My code is

\documentclass{article}
\usepackage{mathspec}
\setmathsfont(Latin,Greek){Eu-bx.ttf}
\setmathsfont(Digits){EU-bz.ttf}
\usepackage{fontspec}
\setmainfont{EU-bz.ttf}
\begin{document}
Hello world!

$a+b=2^t$

$\mathbf{abcd}$ \end{document}

However the math font hasn't got bold. So I'd like another font called EU-hx.ttf to be used for bold math(that is to say, make LaTeX call this font when it meets \mathbf{}). How can I do this?

Mico
  • 506,678
youthdoo
  • 861
  • Is there a reason for using mathspec instead of unicode-math? Put differently, are you willing to switch to unicode-math? Separately, are the font files Eu-bx.ttf and EU-bz.ttf available online? – Mico Feb 25 '23 at 16:04
  • @Mico Because I haven't known the unicode-math package. I'll try switching to it. Is it better? – youthdoo Feb 25 '23 at 16:48
  • 1
    @youthdoo The differences are discussed in https://tex.stackexchange.com/questions/118244/what-is-the-difference-between-unicode-math-and-mathspec, but the short version is: unicode-math uses OpenType math fonts, while mathspec uses OpenType text fonts and tries to combine them withother fonts to make them usable in math. If you have a proper math font then unicode-math will give much better results, if you try to use text fonts for math then things will get complicated anyway but mathspec might be a reasonable option. – Marcel Krüger Feb 25 '23 at 16:57
  • Question: Are letters and digits all you need from your document's math font? Any \sum, \int, or \frac terms? Any other math-y symbols, such as \in, \subset, \leq, \cap, or \cup? If you answer some (or all) of these questions with "yes", you should probably start looking around for an opentype math font that's visually compatible with the text font of your choice. – Mico Feb 25 '23 at 17:20
  • @Mico I only need to change the letters, digits. – youthdoo Feb 26 '23 at 07:16

0 Answers0