Re: [NTG-context] bug: \bot and \top in markiv

2008-11-20 Thread Hans Hagen
Aditya Mahajan wrote:
> On Thu, 20 Nov 2008, Chen Shen wrote:
> 
>> Hi,
>>
>> A small problem: the definition of \bot and \top in math mode should
>> be interchanged. Thanks.
> 
> Thanks for reporting this.
> 
> Hans, in math-ini.lua the unicode slots for top and bot are interchanged
> (char-ini.lua is correct). top is 0x22A5 (Unicode DOWN TACK) and bot is 
> 0x22A4 (Unicode TOP TACK). Who came up with these unicode names.

ok, done

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] bug: \bot and \top in markiv

2008-11-20 Thread Aditya Mahajan

On Thu, 20 Nov 2008, Chen Shen wrote:


Hi,

A small problem: the definition of \bot and \top in math mode should
be interchanged. Thanks.


Thanks for reporting this.

Hans, in math-ini.lua the unicode slots for top and bot are interchanged
(char-ini.lua is correct). top is 0x22A5 (Unicode DOWN TACK) and bot is 
0x22A4 (Unicode TOP TACK). Who came up with these unicode names.


Chen, if you want an immediate solution, replace math-ini.lua with the 
attached file and regenerate formats.


Adityaif not modules then modules = { } end modules ['math-ini'] = {
version   = 1.001,
comment   = "companion to math-ini.tex",
author= "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license   = "see context related readme files"
}

--[[ldx--
Math definitions. This code may move.
--ldx]]--

-- if needed we can use the info here to set up xetex definition files
-- the "8000 hackery influences direct characters (utf) as indirect \char's

local texsprint, format, utfchar, utfbyte = tex.sprint, string.format, 
utf.char, utf.byte

mathematics   = mathematics   or { }
mathematics.data  = mathematics.data  or { }
mathematics.slots = mathematics.slots or { }

mathematics.classes = {
ord = 0,  -- mathordcomm mathord
op  = 1,  -- mathopcomm  mathop
bin = 2,  -- mathbincomm mathbin
rel = 3,  -- mathrelcomm mathrel
open= 4,  -- mathopencommmathopen
close   = 5,  -- mathclosecomm   mathclose
punct   = 6,  -- mathpunctcomm   mathpunct
alpha   = 7,  -- mathalphacomm   firstofoneargument
accent  = 8,
radical = 9,
inner   = 0,  -- mathinnercomm   mathinner
nothing = 0,  -- mathnothingcomm firstofoneargument
choice  = 0,  -- mathchoicecomm  @@mathchoicecomm
box = 0,  -- mathboxcomm @@mathboxcomm
limop   = 1,  -- mathlimopcomm   @@mathlimopcomm
nolop   = 1,  -- mathnolopcomm   @@mathnolopcomm
}

mathematics.classes.alphabetic  = mathematics.classes.alpha
mathematics.classes.unknown = mathematics.classes.nothing
mathematics.classes.punctuation = mathematics.classes.punct
mathematics.classes.normal  = mathematics.classes.nothing
mathematics.classes.opening = mathematics.classes.open
mathematics.classes.closing = mathematics.classes.close
mathematics.classes.binary  = mathematics.classes.bin
mathematics.classes.relation= mathematics.classes.rel
mathematics.classes.fence   = mathematics.classes.unknown
mathematics.classes.diacritic   = mathematics.classes.accent
mathematics.classes.large   = mathematics.classes.op
mathematics.classes.variable= mathematics.classes.alphabetic
mathematics.classes.number  = mathematics.classes.nothing

mathematics.families = {
mr = 0, bs  =  8,
mi = 1, bi  =  9,
sy = 2, sc  = 10,
ex = 3, tf  = 11,
it = 4, ma  = 12,
sl = 5, mb  = 13,
bf = 6, mc  = 14,
nn = 7, md  = 15,
}

mathematics.families.letters   = mathematics.families.mr
mathematics.families.numbers   = mathematics.families.mr
mathematics.families.variables = mathematics.families.mi
mathematics.families.operators = mathematics.families.sy
mathematics.families.lcgreek   = mathematics.families.mi
mathematics.families.ucgreek   = mathematics.families.mr
mathematics.families.vargreek  = mathematics.families.mi
mathematics.families.mitfamily = mathematics.families.mi
mathematics.families.calfamily = mathematics.families.sy

mathematics.families[0] = mathematics.families.mr
mathematics.families[1] = mathematics.families.mi
mathematics.families[2] = mathematics.families.sy
mathematics.families[3] = mathematics.families.ex

function mathematics.mathcode(target,class,family,slot)
if class <= 7 then
return ("\\omathcode%s=\"%X%02X%04X "):format(target,class,family,slot)
end
end
function 
mathematics.delcode(target,small_family,small_slot,large_family,large_slot)
return ("\\odelcode%s=\"%02X%04X\"%02X%04X 
"):format(target,small_family,small_slot,large_family,large_slot)
end
function mathematics.radical(small_family,small_slot,large_family,large_slot)
return ("\\radical%s=\"%02X%04X%\"02X%04X 
"):format(target,small_family,small_slot,large_family,large_slot)
end
function mathematics.mathchar(class,family,slot)
return ("\\omathchar\"%X%02X%04X "):format(class,family,slot)
end
function mathematics.mathaccent(class,family,slot)
return ("\\omathaccent\"%X%02X%04X "):format(class,family,slot)
end
function mathematics.delimiter(class,family,slot,largefamily,largeslot)
return ("\\odelimiter\"%X%02X%04X\"%02X%04X 
"):format(class,family,slot,largefamily,largeslot)
end
function mathematics.mathchardef(name,class,family,slot) -- we can avoid this 
one
return ("\\omathchardef\\%s\"%X%02X%04X "):format(name,class,family,slot)
end

function 
mathematics.setmathsymbol(name,class,family,slot,largefamily,largeslot,unicode)
class = mathematics.classes[class] or class -- no real checks n

[NTG-context] bug: \bot and \top in markiv

2008-11-20 Thread Chen Shen
Hi,

A small problem: the definition of \bot and \top in math mode should
be interchanged. Thanks.

regards,
shenchen
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___