17

I have just started using Minion Pro and mathspec for my work and now I have the following in my preamble:

\usepackage[MnSymbol]{mathspec}
\usepackage{xltxtra}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont[Numbers=OldStyle]{Minion Pro}
\setallsansfonts[Numbers={OldStyle,Proportional},Scale=MatchLowercase]{Myriad Pro}
\setallmonofonts[Numbers=OldStyle,Scale=MatchLowercase]{Ubuntu Mono}
\setmathsfont(Digits,Latin)[Scale=MatchLowercase]{Minion Pro}
\setmathsfont(Greek)[Scale=MatchLowercase]{Minion Pro}
\setmathrm{Minion Pro}
\exchangeforms{phi}

Now I have a number of questions:

  1. What fonts can you use for mathbb, mathcal, mathfrak, ... I mean I don't even know what I have to choose from here.

  2. I want Myriad Pro Bold whenever I have either math or text bold. How can I do that?

  3. I have been playing around with the mathspec commands but often I get the "too many fonts" error. How do I keep track of how many fonts I have defined?

  4. Also my mono font does not work. In other words mathtt is just mathrm in my text.

Henri Menke
  • 109,596
Hesam
  • 1,971

1 Answers1

21

Using unicode-math:

\usepackage{amsmath} % always load before mathspec or unicode-math
\usepackage[math-style=ISO]{unicode-math} % try sans-style=upright
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\setmainfont[Numbers={OldStyle,Proportional},SmallCapsFeatures={LetterSpace=6},%
             BoldFont={Myriad Pro Bold},BoldFeatures={LetterSpace=3}]{Minion Pro}
\setsansfont[Numbers={OldStyle,Proportional},LetterSpace=3]{Myriad Pro}
\setmonofont{Crystal}
\setmathfont{xits-math.otf}
\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro}
\setmathfont[range=\mathsf/{num,latin,Latin,greek,Greek}]{Myriad Pro}
\setmathfont[range=\mathbfsf/{num,latin,Latin,greek,Greek}]{Myriad Pro Bold}
\setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]%
            {Minion Pro Italic}
\setmathfont[range=\mathsfit/{num,latin,Latin,greek,Greek}]%
            {Myriad Pro Italic}
\setmathfont[range=\mathbfsfit/{num,latin,Latin,greek,Greek}]%
            {Myriad Pro Bold Italic}
\setmathfont[range=\mathtt->\mathup]{Crystal}
\let\mathbf\mathbfsf
\let\mathbfit\mathbfsfit
\AtBeginDocument{\let\phi\varphi}

(N.B. unicode-math loads fontspec, xltxtra, and xunicode)

  1. mathbb, mathscr, &c. all have sensible defaults with this. If you want, say, serifed mathbb, you could add \setmathfont[range=\mathbb/{Latin}->\mathup,Scale=MatchUppercase]{Hoefler Text Engraved}. The /{Latin} part applies it only to uppercase latin letters.
  2. Use BoldFont and BoldFeatures with fontspec. For unicode-math, I just used \let commands, although I know there's probably a more elegant way to do this.
  3. Removing MnSymbol frees up a lot of math alphabets, and unicode-math increases the limit.
  4. Apparently Ubuntu Mono is bugged; I couldn't use it, so I tested with Crystal. And it works.

EDIT: To use Minion for even more symbols, you could replace the \mathup line with:

\setmathfont[range={\mathup/{num,latin,Latin,greek,Greek},\question,\exclam,\mathdollar,%
    \percent,\ampersand,\lparen,\rparen,\plus,\comma,\period,\mathslash,\mathcolon,%
    \semicolon,\less,\equal,\greater,\backslash,\rbrack,\lbrack,\atsign,\vert,\lbrace,%
    \rbrace,\times,\div}]{Minion Pro}
Chel
  • 6,110
  • 1
    This can be simplified by removing the /{num,latin,Latin,greek,Greek} part as it is the default so no need to explicitly set it. You can also use vargreek-shape=unicode package option instead of the \AtBeginDocument thing to get the same effect. – خالد حسني Dec 13 '11 at 08:36
  • @KhaledHosny, I was sort of nervous about excluding the /{...} part since I've seen unicode-math try to use operators in the new font, too. Or is that only for mathbb? – Chel Dec 13 '11 at 09:11
  • This works but it has two flaws: 1) the new math font (XITS? awful name btw) is quite ugly and different compared to MnSymbol (summation signs for example). 2) I have lost \prime 3) How do I change the numbers for math font to osf as well? – Hesam Dec 13 '11 at 19:34
  • 1
    @Hesam (1) You could try loading Asana-Math.otf instead, or swapping in Cambria Math from Office. There's a comparison here. (2) Use ^\prime or '. (3) You can specify OpenType features in \setmathfont – e.g., \setmathfont[range=\mathup,Numbers=OldStyle]{Minion Pro}. – Chel Dec 14 '11 at 05:59
  • Conversely what font is better suited to XITS? It seems to me Minion is not a good text font to accompany it? 2) I was using ^\prime and I tried ' no luck 3) I tried it but did not work, should I do it for all \setmathfont commands? 4) My fraktur font is bold for some reason! 5) The commands \hat, \check don't work properly and produce very large symbols for those with subscripts and superscripts (and my syntax is fine).
  • – Hesam Dec 14 '11 at 13:50
  • @Hesam (1) It's designed for STIX – hence the name. (2) That's odd; maybe post an MWE? (3) Add Numbers=OldStyle to all the existing \setmathfont commands, or at least the ones you set numbers in. (4) Asana-Math.otf has lighter Fraktur; you can either use it outright or change just \mathfrak using \setmathfont[range=\mathfrak]{Asana-Math.otf}. (5) If you aren't just completely turned off by unicode-math, you should make a new question for \hat and \check. – Chel Dec 14 '11 at 15:24
  • 2
    It seems this needs updating; this fails with Range alphabets cannot include alphabets referring to bf, sf…. – Michaël Sep 02 '19 at 16:28