[NTG-context] Mixing math and text font

Wolfgang Schuster schuster.wolfgang at gmail.com
Sat Jan 4 19:50:24 CET 2014


Am 04.01.2014 um 18:22 schrieb Joshua Krämer <joshua.kraemer at gmail.com>:

> Am Sat, 04 Jan 2014 17:44:22 +0100 schrieb Wolfgang Schuster:
> 
>> This is possible but you have to use the context suite [1] and not
>> texlive or miktex because the context version they provide doesn’t
>> include the necessary mechanism.
>> 
>> [1] http://wiki.contextgarden.net/ConTeXt_Standalone
>> 
>> Wolfgang
> 
> Thanks for your answer.  I already use context standalone, but even after 
> an update (first-setup.sh), the fonts are not mixed.  What are the 
> additional steps to do?

You have to switch from the simplefonts module to the new fontfamily
command (a new built-in system which replaces simplefonts) to set
the fonts for your document.

The fourth argument specifies which part of the font you want to replace
(you could also have written [preset=math:lowercaseitalic] instead of
[math:lowercaseitalic]).

\definefontfamily     [mainface] [rm] [Latin Modern Roman]

\definefallbackfamily [mainface] [mm] [Latin Modern Roman] [math:lowercaseitalic]
\definefontfamily     [mainface] [mm] [TeX Gyre Termes Math]

\setupbodyfont[mainface]

\starttext
TeX uses different fonts for text and math, e.g. \math{f(x)=x^2+2x+4} but it possible to replace certain characters in the math font with glyphs from a text font.
\stoptext

Wolfgang


More information about the ntg-context mailing list