Math in MKIV  HOWTO (was: Lucida Fonts with MKIV)
These basic set of rules should also apply to fourier or any other font that still needs better math support. I'm posting them on the list for future reference (for when the next volunteer pops up). On Fri, Feb 19, 2010 at 14:50, Troy Henderson wrote:
I have followed the first set of instructions at
...
Is there an easy way to adapt the configuration file(s) for MKII to MKIV? If this is possible but just requires a tedious process, I'm willing to do this, but I have no clue of the steps needed.
So here are some basic instructions:
Step 1: check what's in the fonts
=====
The file lucida.map includes the following lines:
hlcda LucidaNewMathArrowsDemi
Thanks for the guidance, I finally get my Lucida Math work.
After the \showfont step, I found that I didn't have the "texma"
vector font, and the last two lines in mathvfu.lua should be changed
to:
{ name = "hlcra.tfm", vector = "texmb" },
{ name = "hlcrm.tfm", vector = "texmi" },
in my case.
By the way, there's a typo in fonts.enc.math["texmi"] in
mathvfu.lua, the comment "righttharpoonup" has an extra "t" and I
just wish it could be perfect.
On Tue, Feb 23, 2010 at 7:02 AM, Mojca Miklavec
These basic set of rules should also apply to fourier or any other font that still needs better math support. I'm posting them on the list for future reference (for when the next volunteer pops up).
On Fri, Feb 19, 2010 at 14:50, Troy Henderson wrote:
I have followed the first set of instructions at
...
Is there an easy way to adapt the configuration file(s) for MKII to MKIV? If this is possible but just requires a tedious process, I'm willing to do this, but I have no clue of the steps needed.
So here are some basic instructions:
Step 1: check what's in the fonts =====
The file lucida.map includes the following lines:
hlcda LucidaNewMathArrowsDemi
After short inspection you may notice that some are just bold variants, so you are basically left with only 6 files that you need to take care of:
hlcrm LucidaNewMathRoman
hlcrv LucidaNewMathExtension
You may want to visualize the content of those fonts by using:
\loadmapfile[lucida.map] \starttext \showfont[hlcrm] \showfont[hlcrim] \showfont[hlcrima] \showfont[hlcrv] \showfont[hlcry] \showfont[hlcra] \stoptext
Step 2: compare =====
It might be interesting to know what's in LM (so that you know what you need to modify):
\starttext \showfont[rmlmr10] \showfont[lmmi10] \showfont[lmex10] \showfont[lmsy10] \stoptext
as well as seing what's in ams fonts perhaps. Now all the info that describes the content of these files is in mathtex.mkii (for MKII) and mathvfu.lua (for MKIV):
mathematics.make_font ( "lmroman10math", { { name = "lmroman10regular.otf", features = "virtualmath", main = true }, { name = "rmlmr10.tfm", vector = "texmrmissing" } , { name = "lmmi10.tfm", vector = "texmi", skewchar=0x7F }, { name = "lmmi10.tfm", vector = "texit", skewchar=0x7F }, { name = "lmsy10.tfm", vector = "texsy", skewchar=0x30, parameters = true } , { name = "lmex10.tfm", vector = "texex", extension = true } , { name = "msam10.tfm", vector = "texma" }, { name = "msbm10.tfm", vector = "texmb" },  { name = "rmlmbx10.tfm", vector = "texbf" } , { name = "lmroman10bold.otf", vector = "texbf" } , { name = "lmmib10.tfm", vector = "texbi", skewchar=0x7F } , { name = "lmsans10regular.otf", vector = "texss", optional=true }, { name = "lmmono10regular.otf", vector = "textt", optional=true }, { name = "eufm10.tfm", vector = "texfraktur", optional=true }, { name = "eufb10.tfm", vector = "texfrakturbold", optional=true }, } )
You may want to check any tfm font mentioned here as well as any vector="..." mentioned.
fonts.enc.math["texmi"] = { [0x1D6E4] = 0x00,  Gamma [0x1D6E5] = 0x01,  Delta [0x1D6E9] = 0x02,  Theta [0x1D6F3] = 0x02,  varTheta (not present in TeX) [0x1D6EC] = 0x03,  Lambda [0x1D6EF] = 0x04,  Xi [0x1D6F1] = 0x05,  Pi
There's a very precious source of information available for unicode mappings for many fonts that might be worth considering: tex4ht/htfonts/unicode/
Step 3: make use of available glyph information =====
3a) You may use lucidabr.sty as a pretty reliable source of information to extract the mapping between:  glyph name (in LaTeX)  font  slot
3b) In chardef.lua there are some mappings between context commands and unicode points. If any mapping is missing, you need to add it anyway (else you won't be able to use that particular command), for all other commands you already have unicode point, so when you find "rightarrow" or some other glyph in font, you may look it up in chardef.lua to determine the unicode number.
You may want to use both the comprehensive TeX symbol list as well as the Unicode Standard to help you out if there are some glyphs you don't know.
Step 4: fix mathlbr =====
Step 5: complete the vectors in mathvfu.lua =====
I'm not completly sure about some aspects of bold math, but here are at least some points to start with.
Step 6: test =====
Translate ams test paper and the comprehensive LaTeX symbol list to ConTeXt in order to test if all the characters work ok in all the math fonts supported by ConTeXt :) :) :)
Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntgcontext@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntgcontext webpage : http://www.pragmaade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
 Best Regards Chen  Zhichu Chen  Shanghai Synchrotron Radiation Facility No. 2019  Jialuo Rd.  Jiading  Shanghai  P.R. China tel: 086 21 5955 3405  zhichu.chen.googlepages.com  www.sinap.ac.cn 
On 2422010 4:15, Zhichu Chen wrote:
Thanks for the guidance, I finally get my Lucida Math work.
After the \showfont step, I found that I didn't have the "texma" vector font, and the last two lines in mathvfu.lua should be changed to: { name = "hlcra.tfm", vector = "texmb" }, { name = "hlcrm.tfm", vector = "texmi" }, in my case.
that's not okay either ... i was under the impression that the font was repackaged in a way that matches tex default math encoding but it looks like there is some other encoding used ... what a mess ... it looks like we need special lucida vectors then
By the way, there's a typo in fonts.enc.math["texmi"] in mathvfu.lua, the comment "righttharpoonup" has an extra "t" and I just wish it could be perfect.
ok Hans  Hans Hagen  PRAGMA ADE Ridderstraat 27  8061 GH Hasselt  The Netherlands tel: 038 477 53 69  fax: 038 477 53 74  www.pragmaade.com  www.pragmapod.nl 
On 2422010 10:01, Hans Hagen wrote:
On 2422010 4:15, Zhichu Chen wrote:
Thanks for the guidance, I finally get my Lucida Math work.
After the \showfont step, I found that I didn't have the "texma" vector font, and the last two lines in mathvfu.lua should be changed to: { name = "hlcra.tfm", vector = "texmb" }, { name = "hlcrm.tfm", vector = "texmi" }, in my case.
that's not okay either ... i was under the impression that the font was repackaged in a way that matches tex default math encoding but it looks like there is some other encoding used ... what a mess ... it looks like we need special lucida vectors then
By the way, there's a typo in fonts.enc.math["texmi"] in mathvfu.lua, the comment "righttharpoonup" has an extra "t" and I just wish it could be perfect.
i uploaded a beta with mkiv lbr vectors (quick and dirty conversion hackery) \usemodule[fnt25] \starttext \setupbodyfont[lucida,12pt] \showmathfontcharacters \stoptext up to others to check and complete them Hans  Hans Hagen  PRAGMA ADE Ridderstraat 27  8061 GH Hasselt  The Netherlands tel: 038 477 53 69  fax: 038 477 53 74  www.pragmaade.com  www.pragmapod.nl 
On Wed, Feb 24, 2010 at 6:24 PM, Hans Hagen
On 2422010 10:01, Hans Hagen wrote:
i uploaded a beta with mkiv lbr vectors (quick and dirty conversion hackery)
\usemodule[fnt25]
\starttext \setupbodyfont[lucida,12pt] \showmathfontcharacters \stoptext
up to others to check and complete them
The double stroke AZ from U+1D538  U+02124 in hlcra.tfm(lbma.pfb) from 0x410x5a are missing, even though I added to the lbrma vector :(
Hans
 Hans Hagen  PRAGMA ADE Ridderstraat 27  8061 GH Hasselt  The Netherlands tel: 038 477 53 69  fax: 038 477 53 74  www.pragmaade.com  www.pragmapod.nl 
 Best Regards Chen  Zhichu Chen  Shanghai Synchrotron Radiation Facility No. 2019  Jialuo Rd.  Jiading  Shanghai  P.R. China tel: 086 21 5955 3405  zhichu.chen.googlepages.com  www.sinap.ac.cn 
On 2422010 12:55, Zhichu Chen wrote:
On Wed, Feb 24, 2010 at 6:24 PM, Hans Hagen
wrote: On 2422010 10:01, Hans Hagen wrote:
i uploaded a beta with mkiv lbr vectors (quick and dirty conversion hackery)
\usemodule[fnt25]
\starttext \setupbodyfont[lucida,12pt] \showmathfontcharacters \stoptext
up to others to check and complete them
The double stroke AZ from U+1D538  U+02124 in hlcra.tfm(lbma.pfb) from 0x410x5a are missing, even though I added to the lbrma vector :(
you should coordinate this with mojca Hans  Hans Hagen  PRAGMA ADE Ridderstraat 27  8061 GH Hasselt  The Netherlands tel: 038 477 53 69  fax: 038 477 53 74  www.pragmaade.com  www.pragmapod.nl 
participants (3)

Hans Hagen

Mojca Miklavec

Zhichu Chen