Difference between revisions of "math calligraphic"

From Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Using math calligraphic fonts in mkiv ==
 
== Using math calligraphic fonts in mkiv ==
  
In mkii it is possible to replace the standard calligraphic math fonts with rsfs (Ralph Smith's Formal Script fonts): see the dedicated page on this wiki [http://wiki.contextgarden.net/rsfs].
+
In mkii it is possible to replace the standard calligraphic (alias script) math fonts with rsfs (Ralph Smith's Formal Script fonts): see the dedicated page on this wiki [http://wiki.contextgarden.net/rsfs].
  
However this does not work properly in mkiv, where nevertheless it is rather easy to specify any font to be used for the calligraphic math fonts.
+
However this old method does not work in mkiv where there is a more robust way to use any opentype or truetype font. Indeed in mkiv it is rather easy to specify any such font to be used for the calligraphic (alias script) math fonts.
For instance let us assume that we want to use math calligraphic fonts from Asana Math, while other characters come from Latin Modern. To do so, use the following setups:
+
For instance let us assume that we want to use math calligraphic fonts from Asana Math, while other glyphs come from Latin Modern. To do so, use the following setups:
  
 
<texcode>
 
<texcode>

Revision as of 21:19, 21 May 2014

Using math calligraphic fonts in mkiv

In mkii it is possible to replace the standard calligraphic (alias script) math fonts with rsfs (Ralph Smith's Formal Script fonts): see the dedicated page on this wiki [1].

However this old method does not work in mkiv where there is a more robust way to use any opentype or truetype font. Indeed in mkiv it is rather easy to specify any such font to be used for the calligraphic (alias script) math fonts. For instance let us assume that we want to use math calligraphic fonts from Asana Math, while other glyphs come from Latin Modern. To do so, use the following setups:

\definefallbackfamily[mainface][math][Asana Math][range={uppercasescript,lowercasescript}]

\definefontfamily [mainface] [rm] [Latin Modern]
\definefontfamily [mainface] [math] [Latin Modern Math]

\setupbodyfont[mainface]

\starttext
${\cal ABCDEFGHIJKLMNOPQRSTUVWXYZ}$

${\cal abcdefghijklmnopqrstuvwxyz}$

The space of distributions on $\Omega$ is denoted by ${\cal D}'(\Omega)$, while ${\cal S}({\Bbb R}^n)$ is the space of Schwartz functions, and ${\cal S}'({\Bbb R}^n)$ is its dual.
\startformula
\langle T,\phi \rangle_{{\cal D}'(\Omega),{\cal D}(\Omega)}
\stopformula
The set of admissible controls is denoted by ${\cal U}_{\rm ad}$.
\stoptext

Here, the command

\definefallbackfamily[mainface][math][Asana Math][range={uppercasescript,lowercasescript}]

tells mkiv that the fallback font for mainface in math mode comes from Asana Math, as far as the slots of lowercase and uppercase calligraphic (or script) glyphs are concerned.

If one wishes to use for instance Palatino instead of Latin Modern as the text font, it is enough to replace

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

with

\definefontfamily [mainface] [rm] [Palatino]