On Wed, 14 Jan 2026 at 10:56, Udi Fogiel <[email protected]> wrote:

> Hello,
>
> Here is what happens when \vcenter is encountered:
>
> static void run_vcenter (void) {    scan_spec(vcenter_group);    
> normal_paragraph();    push_nest();    mode = -vmode;    prev_depth_par = 
> ignore_depth;    if (every_vbox_par != null)        
> begin_token_list(every_vbox_par, every_vbox_text);}
>
> So unlike other boxes is uses scan_spec and not scan_full_spec, which
> means it cannot accept the attr and (b)dir keywords, and the directions
> registers are not set to its direction
> inside of it.
>
> Then when it finishes we have:
>
> void finish_vcenter(void){    halfword p;    unsave();    save_ptr--;    p = 
> vpack(vlink(cur_list.head_field), saved_value(0), saved_level(0), -1);    
> pop_nest();    p = math_vcenter_group(p);    tail_append(p);}
>
> And because of the -1 in the last argument, its direction is determined by
> \bodydirection,
> unlike other boxes which in math context use \mathdirection if a (b)dir
> keyword was not specified.
>
> Why is that? It feels a bit inconsistent, and makes it a bit hard to
> follow directions.
>
>
I guess since mathematical typesetting is quite complex and we want to
maintain some degree of compatibility with pdftex, \vcenter remains largely
unchanged
(on the other hand, I think using the token lib it is possible to get
something similar to \hbox/\vbox for \vcenter) .

--
luigi
_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to