Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hborders from the head and the foot when splitting lontblr #493

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion tabularray.sty
Original file line number Diff line number Diff line change
Expand Up @@ -5557,6 +5557,8 @@
}

\dim_new:N \l__tblr_remain_height_dim
\int_new:N \l__tblr_long_row_after_head_int
\int_new:N \l__tblr_long_row_before_foot_int
\int_new:N \l__tblr_long_from_int
\int_new:N \l__tblr_long_to_int
\int_new:N \l__tblr_curr_i_int
Expand Down Expand Up @@ -5589,16 +5591,37 @@
\dim_set:Nn \l__tblr_remain_height_dim
{ \pagegoal - \pagetotal - \l__tblr_row_head_foot_dim }
\int_set:Nn \l__tblr_long_from_int { \l__tblr_row_head_tl + 1 }
\int_set:Nn \l__tblr_long_row_after_head_int { \l__tblr_long_from_int }
\int_set:Nn \l__tblr_long_to_int { \c@rowcount - ( \l__tblr_row_foot_tl + 0 ) }
\int_set:Nn \l__tblr_long_row_before_foot_int { \l__tblr_long_to_int }
\int_set:Nn \l__tblr_curr_i_int { \l__tblr_long_from_int - 1 }
\int_do_while:nNnn { \l__tblr_curr_i_int } < { \l__tblr_long_to_int }
{
\int_set_eq:NN \l__tblr_prev_i_int \l__tblr_curr_i_int
% Copy the abovesep from the row below the head to the row below the head on the current page
\__tblr_data_gput:nene { row } { \int_use:N \l__tblr_long_from_int }
{ abovesep } { \__tblr_data_item:nen { row } { \int_use:N \l__tblr_long_row_after_head_int } { abovesep } }
\__tblr_get_next_table_rows:NNNN
\l__tblr_long_to_int \l__tblr_curr_i_int
\l_tmpa_dim \l__tblr_page_break_curr_bool
% Add the difference between the belowsep from the row above the foot and the row
% tested for a pagebreak to make the total table height on the page accurate
\int_compare:nNnTF {\l__tblr_prev_i_int} > { 0 }
{
\dim_set:Nn \l_tmpb_dim
{
\l_tmpa_dim
+
\__tblr_data_item:nen { row } { \int_use:N \l__tblr_long_row_before_foot_int } { belowsep }
-
\__tblr_data_item:nen { row } { \int_use:N \l__tblr_prev_i_int } { belowsep }
}
}
{
\dim_set:Nn \l_tmpb_dim \l_tmpa_dim
}
\__tblr_check_table_page_break:NNN
\l__tblr_remain_height_dim \l_tmpa_dim \l__tblr_page_break_prev_bool
\l__tblr_remain_height_dim \l_tmpb_dim \l__tblr_page_break_prev_bool
\__tblr_do_if_tracing:nn { page } { \int_log:N \l__tblr_curr_i_int }
\bool_if:NTF \l__tblr_page_break_prev_bool
{
Expand All @@ -5624,6 +5647,9 @@
\group_end:
}
{
% Copy the belowsep from the row above the foot to the row above the foot on the current page
\__tblr_data_gput:nene { row } { \int_use:N \l__tblr_prev_i_int }
{ belowsep } { \__tblr_data_item:nen { row } { \int_use:N \l__tblr_long_row_before_foot_int } { belowsep } }
\__tblr_build_page_table:nnx {#1}
{ \int_use:N \l__tblr_long_from_int }
{ \int_use:N \l__tblr_prev_i_int }
Expand Down