From f13c6901aa06c287164bc1826ef4a4944f70e2f5 Mon Sep 17 00:00:00 2001 From: udifogiel Date: Sat, 30 May 2026 10:26:32 +0300 Subject: [PATCH 1/3] use \vbox_center:n instead of \tex_vcenter:D, and box it outside math (fixes #351) --- tabularray.sty | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tabularray.sty b/tabularray.sty index f8f02ba..b3c230e 100644 --- a/tabularray.sty +++ b/tabularray.sty @@ -6991,12 +6991,15 @@ } } +%% We box the vertical box outside of math for correct alignment of +%% the rules in LuaTeX (the directions inside math can switch, see #351) \cs_new_protected:Npn \__tblr_get_vcenter_box:N #1 { \hbox:n { + \vbox_set:Nn \l_tmpa_box { \vbox_center:n { \vbox_unpack_drop:N #1 } } $ \m@th \l__tblr_delim_left_tl - \tex_vcenter:D { \vbox_unpack_drop:N #1 } + \box_use_drop:N \l_tmpa_box \l__tblr_delim_right_tl $ } } From c8340847a3162b14d525ac08268220c1fc231694 Mon Sep 17 00:00:00 2001 From: udifogiel Date: Sun, 31 May 2026 00:02:42 +0300 Subject: [PATCH 2/3] second try --- tabularray.sty | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tabularray.sty b/tabularray.sty index b3c230e..3093735 100644 --- a/tabularray.sty +++ b/tabularray.sty @@ -6993,13 +6993,13 @@ %% We box the vertical box outside of math for correct alignment of %% the rules in LuaTeX (the directions inside math can switch, see #351) -\cs_new_protected:Npn \__tblr_get_vcenter_box:N #1 +\cs_set_protected:Npn \__tblr_get_vcenter_box:N #1 { \hbox:n { - \vbox_set:Nn \l_tmpa_box { \vbox_center:n { \vbox_unpack_drop:N #1 } } + \vbox_set:Nn \l_tmpa_box { \vbox:n { \vbox_unpack_drop:N #1 } } $ \m@th \l__tblr_delim_left_tl - \box_use_drop:N \l_tmpa_box + \tex_vcenter:D { \vbox_unpack_drop:N \l_tmpa_box } \l__tblr_delim_right_tl $ } } From f11dbb7d81a87862d9ffd1b16b6e7d9f13f3532e Mon Sep 17 00:00:00 2001 From: udifogiel Date: Sun, 31 May 2026 00:33:55 +0300 Subject: [PATCH 3/3] simplify --- tabularray.sty | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tabularray.sty b/tabularray.sty index 3093735..fd164c7 100644 --- a/tabularray.sty +++ b/tabularray.sty @@ -6991,15 +6991,14 @@ } } -%% We box the vertical box outside of math for correct alignment of +%% Use the vertical box from the outside of math for correct alignment of %% the rules in LuaTeX (the directions inside math can switch, see #351) -\cs_set_protected:Npn \__tblr_get_vcenter_box:N #1 +\cs_new_protected:Npn \__tblr_get_vcenter_box:N #1 { \hbox:n { - \vbox_set:Nn \l_tmpa_box { \vbox:n { \vbox_unpack_drop:N #1 } } $ \m@th \l__tblr_delim_left_tl - \tex_vcenter:D { \vbox_unpack_drop:N \l_tmpa_box } + \tex_vcenter:D { \box_use_drop:N #1 } \l__tblr_delim_right_tl $ } }