- local p = head
- local bhead = head
- while p do
- if p.id == id_simple or p.id == id_accent then
- p.nucleus = conv_jchar_to_hbox_A(p.nucleus, sty)
- p.sub = conv_jchar_to_hbox_A(p.sub, sty + 1)
- p.sup = conv_jchar_to_hbox_A(p.sup, sty + 1)
- elseif p.id == id_choice then
- p.display = conv_jchar_to_hbox(p.display, 0)
- p.text = conv_jchar_to_hbox(p.text, 0)
- p.script = conv_jchar_to_hbox(p.script, 1)
- p.scriptscript = conv_jchar_to_hbox(p.scriptscript, 2)
- elseif p.id == id_frac then
- p.num = conv_jchar_to_hbox_A(p.num, sty + 1)
- p.denom = conv_jchar_to_hbox_A(p.denom, sty + 1)
- elseif p.id == id_radical then
- p.nucleus = conv_jchar_to_hbox_A(p.nucleus, sty)
- p.sub = conv_jchar_to_hbox_A(p.sub, sty + 1)
- p.sup = conv_jchar_to_hbox_A(p.sup, sty + 1)
- if p.degree then
- p.degree = conv_jchar_to_hbox_A(p.degree, sty + 1)
+ for p in node_traverse(head) do
+ local pid = getid(p)
+ if pid == id_simple or pid == id_accent then
+ if getsubtype(p)==12 then
+ conv_vcenter(getfield(p, 'nucleus'))
+ else
+ setfield(p, 'nucleus', conv_jchar_to_hbox_A(getfield(p, 'nucleus'), sty))
+ end
+ setfield(p, 'sub', conv_jchar_to_hbox_A(getfield(p, 'sub'), sty+1))
+ setfield(p, 'sup', conv_jchar_to_hbox_A(getfield(p, 'sup'), sty+1))
+ elseif pid == id_choice then
+ setfield(p, 'display', conv_jchar_to_hbox_A(getfield(p, 'display'), 0))
+ setfield(p, 'text', conv_jchar_to_hbox_A(getfield(p, 'text'), 0))
+ setfield(p, 'script', conv_jchar_to_hbox_A(getfield(p, 'script'), 1))
+ setfield(p, 'scriptscript', conv_jchar_to_hbox_A(getfield(p, 'scriptscript'), 2))
+ elseif pid == id_frac then
+ setfield(p, 'num', conv_jchar_to_hbox_A(getfield(p, 'num'), sty+1))
+ setfield(p, 'denom', conv_jchar_to_hbox_A(getfield(p, 'denom'), sty+1))
+ elseif pid == id_radical then
+ setfield(p, 'nucleus', conv_jchar_to_hbox_A(getfield(p, 'nucleus'), sty))
+ setfield(p, 'sub', conv_jchar_to_hbox_A(getfield(p, 'sub'), sty+1))
+ setfield(p, 'sup', conv_jchar_to_hbox_A(getfield(p, 'sup'), sty+1))
+ if getfield(p, 'degree') then
+ setfield(p, 'degree', conv_jchar_to_hbox_A(getfield(p, 'degree'), sty + 1))