if not modules then modules = { } end modules ['math-ext'] = { version = 1.001, comment = "companion to math-ini.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } -- This is a completely different file from the lua one but the name fits. -- We actually have a mechanism for this but it has never been used so let's go -- simple till we have that active again. This kind of trickery only works in -- controlled situations anyway. ----- texnest = tex.nest ----- setproperty = nodes.setproperty local getproperty = nodes.getproperty local extensibles = { } function mathematics.registerextensible(specification) local unicode = specification.unicode if unicode then extensibles[unicode] = specification end end -- function mathematics.setextensibledata(data) -- local target = texnest[texnest.ptr].tail -- if target then -- maybe also check type -- setproperty(target,data) -- end -- end function mathematics.setextensibledata(data) context(nodes.upcomingproperties { extensible = data }) end function mathematics.getextensibledata(target) local property = getproperty(target) return property and property.extensible end callback.register("make_extensible",function(target,fnt,chr,size,width,height,depth,linewidth,axis,exheight,emwidth) local found = extensibles[chr] if found then local action = found.action if action then return action(target,fnt,chr,size,width,height,depth,linewidth,axis,exheight,emwidth) end end end) if not nodes.setattrlist then local tonut = nodes.tonut local setattrlist = nodes.nuts.setattrlist function nodes.setattrlist(target,source) setattrlist(tonut(target),tonut(source)) end end