[Tex/LaTex] MinionPro, including math, in ConTeXt

contextfontsmath-mode

A rather simple question, which probably will have a complex answer. I'm trying to migrate to ConTeXt, since I want to have a layout not easily achieved with LaTeX (grid…). In LaTeX, MinionPro is working fine, including the math, after some voodoo and lots of hair pulling. I haven't touched it since. Now, how to get this stuff to work in ConTeXt as well? I started with the body font, that's the easy part. I have no clue where to look for the math font, or how to port/translate the TeX stuff I have to something ConTeXt will understand. Where do I begin?

Edit: To clarify, what I currently have is

\starttypescript [serif] [minionpro]
    \definefontsynonym [Serif] [name:minionproregular] [features=default]
\stoptypescript

\starttypescript [minionpro]
    \definetypeface [minionpro] [rm] [serif] [minionpro] [default]
    \definetypeface [minionpro] [mm] [math] [minionpro] [default]
\stoptypescript

\usetypescript [minionpro]
\setupbodyfont [minionpro,10pt]

\starttext
Hi, this is text. A formula: $x + y = z$.
\stoptext

This is obviously not enough information to make it go, it helpfully cries out with the error

error on line 14 in file tmp.tex: Math error: parameter \Umathquad\displaystyle is not set ...

Best Answer

To use the Minion fonts in ConTeXt:

  1. Make sure that you have the fonts. Running

    mtxrun --script fonts --list --pattern="*minion*" --all 
    

    should give you:

    minionpro             minionprobold      MinionPro-Bold.otf
    minionprobold         minionprobold      MinionPro-Bold.otf
    minionproboldit       minionproboldit    MinionPro-BoldIt.otf
    minionprobolditalic   minionproboldit    MinionPro-BoldIt.otf
    minionproit           minionproit        MinionPro-It.otf
    minionproitalic       minionproit        MinionPro-It.otf
    minionpronormal       minionproit        MinionPro-It.otf
    minionproregular      minionproregular   MinionPro-Regular.otf
    
  2. The Minion fonts do not come with a accompanying math fonts. However, for simple math you can use symbols from a different math font (e.g., Pagella Math), and use letters and digits from Minion. To do so, you need a recent (2013.12.20 or newer) version of ConTeXt. Then use the following test file:

    \definefontfamily [mainface] [rm] [Minion Pro]
    
    \definefallbackfamily [mainface] [math] [Minion Pro] [math:lowercaseitalic] [force=yes]
    \definefallbackfamily [mainface] [math] [Minion Pro] [math:digitsnormal]    [force=yes]
    \definefontfamily     [mainface] [math] [TeX Gyre Pagella Math]
    
    \setupbodyfont[mainface]
    
    \starttext
    \input ward
    
    \startformula
      c^2 = a^2 + b^2
    \stopformula
    
    \stoptext
    

which gives:

enter image description here

Related Question