require('luatexja.jfont'); local ltjf = luatexja.jfont
require('luatexja.inputbuf'); local ltji = luatexja.inputbuf
require('luatexja.jfmglue'); local ltjj = luatexja.jfmglue
+require('luatexja.math'); local ltjm = luatexja.math
require('luatexja.pretreat'); local ltjp = luatexja.pretreat
require('luatexja.stack'); local ltjs = luatexja.stack
require('luatexja.setwidth'); local ltjw = luatexja.setwidth
local node_insert_before = node.insert_before
local node_insert_after = node.insert_after
local node_hpack = node.hpack
-local round = tex.round
local id_penalty = node.id('penalty')
local id_glyph = node.id('glyph')
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
local attr_yablshift = luatexbase.attributes['ltj@yablshift']
local attr_icflag = luatexbase.attributes['ltj@icflag']
+local cat_lp = luatexbase.catcodetables['latex-package']
local ITALIC = 1
local PACKED = 2
-- EXT: print \global if necessary
function ltj.ext_print_global()
- if ltj.isglobal=='global' then tex.sprint('\\global') end
+ if ltj.isglobal=='global' then tex.sprint(cat_lp, '\\global') end
end
-
-- main process
-- mode = true iff main_process is called from pre_linebreak_filter
local function main_process(head, mode, dir)
local s
local pt=node_type(p.id)
local base = debug_depth .. string.format('%X', has_attr(p,attr_icflag) or 0)
- .. ' ' .. pt .. ' ' .. p.subtype
+ .. ' ' .. pt .. ' ' .. tostring(p.subtype )
if pt == 'glyph' then
s = base .. ' ' .. utf.char(p.char) .. ' ' .. tostring(p.font)
.. ' (' .. print_scaled(p.height) .. '+'
elseif pt=='hlist' then
s = base .. '(' .. print_scaled(p.height) .. '+'
.. print_scaled(p.depth) .. ')x' .. print_scaled(p.width)
+ if p.shift~=0 then
+ s = s .. ', shifted ' .. print_scaled(p.shift)
+ end
if p.glue_sign >= 1 then
s = s .. ' glue set '
if p.glue_sign == 2 then s = s .. '-' end
s = s .. node.subtype(p.subtype)
end
print_fn(s)
+ -------- math node --------
+ elseif pt=='noad' then
+ s = base ; print_fn(s)
+ if p.nucleus then
+ debug_depth = k .. 'N'; debug_show_node_X(p.nucleus, print_fn);
+ end
+ if p.sup then
+ debug_depth = k .. '^'; debug_show_node_X(p.sup, print_fn);
+ end
+ if p.sub then
+ debug_depth = k .. '_'; debug_show_node_X(p.sub, print_fn);
+ end
+ debug_depth = k;
+ elseif pt=='math_char' then
+ s = base .. ' fam: ' .. p.fam .. ' , char = ' .. utf.char(p.char)
+ print_fn(s)
+ elseif pt=='sub_box' then
+ print_fn(base)
+ if p.head then
+ debug_depth = k .. '.'; debug_show_node_X(p.head, print_fn);
+ end
else
print_fn(base)
end