[Tex/LaTex] More Math Fonts in ConTeXt

contextfontsmath-mode

Yesterday Aditya very helpfully updated the Wiki:
http://wiki.contextgarden.net/Math_fonts#Using_Math_fonts_in_MkIV.

Modern, times, palatino, bonus, iwona (not iowna), antykwa-torunska, lucidanova, xits, xitsbidi and cambria appear to work properly under MKIV current, and 2013.11.10 12:23 MKIV beta.

Lucida and asana work under current but not under beta. However, lucida does not create all symbols. For example, the \nabla symbol is not created. (This problem does not occur with lucidanova).

Hvmath, informal and mathtimes would not build under either beta or current.

Charter, garamond and utopia would not build under beta and defaulted to modern under current.

Euler defaulted to modern under both current and beta.

Do others find the same issues with math fonts?

When, for example, lucida builds under current it uses fonts in /usr/local/texlive/texmf-local/fonts. I have copied the contents of the /texlive/texmf-local into the /texmf-local folder of my standalone beta version. I have used sudo texhash and the ls-R file has built and appears to list the contents properly. However, there is no sign that beta recognises the contents of the texmf-local folder.

Why should current recognise/use its texmf-local folder but beta not recognise/use its texmf-local?

I have been looking at some of the typescript files. The basic structure is recognisable from the documentation. However, most of the entries are preceded by ‘\s!’. What does this mean?

I am sure I am not the only person to find math fonts in ConTeXt difficult. Any assistance would be much appreciated.

Best Answer

Here is a complete example on how to use Euler.

  1. Download Euler OTF from Github
  2. Move the font somewhere in your $TEXMF/fonts/opentype tree. To see the list of folders that ConTeXt searches, run:

    mtxrun --expand-var=TEXMF
    

    or

    mtxrun --expand-var=TEXMFHOME
    
  3. Update the font database by running

    mtxrun --script font --reload --force
    
  4. Check that ConTeXt can find the fonts:

    mtxrun --script fonts  --list --pattern=euler --all
    

    (you should see euler.otf in the list).

  5. Compile the following example file (this needs ConTeXt version from October, 2013 or later).

    \usetypescriptfile[euler]
    
    \definetypeface[mainface][rm][serif][palatino]         [default]
    \definetypeface[mainface][ss][sans] [helvetica]        [default] [rscale=auto]
    \definetypeface[mainface][mm][math] [pagellaovereuler] [default] [rscale=auto]
    
    \setupbodyfont[mainface,12pt]
    
    \appendtoks \rm \to \everymathematics
    \setupmathematics
      [lcgreek=normal, ucgreek=normal]
    
    \starttext
    
    \startformula
       {\Bbb P}(x) = \sum_{i=1}^n α_i x^i
    \stopformula
    
    \stoptext
    

I get the following output:

enter image description here

Note that Euler opentype font is not complete. The pagellaovereuler typescript loads Pagella as a fallback font, so the missing symbols (like the blackboard bold P in the above example) are taken from Pagella.

Related Question