Skip to content

Commit

Permalink
Merge pull request #366 from Yodude2002/nopagebreak
Browse files Browse the repository at this point in the history
Fix #361
  • Loading branch information
lvjr committed Feb 15, 2024
2 parents 0060844 + 371a531 commit 1c650d4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tabularray.sty
Original file line number Diff line number Diff line change
Expand Up @@ -5609,17 +5609,28 @@
% \pagetotal maybe exceed \pagegoal after adding presep,
% or after adding rowhead or rowfoot of the table.
% In these cases, we will not typeset table in this page,
% but rather do some negative \vskip and execute \newpage.
\skip_vertical:n { \pagegoal - \pagetotal }
% but rather force a page break.
\group_begin:
\dim_set:Nn \l_tmpb_dim
{
% Enough to overfill the page (including shrink).
\pagegoal - \pagetotal + \l_tmpa_dim
+ \__tblr_box_height:N \l__tblr_table_firsthead_box
+ \__tblr_box_height:N \l__tblr_table_firstfoot_box
}
\skip_vertical:n { \l_tmpb_dim }
\tex_penalty:D 9999
\skip_vertical:n { -\l_tmpb_dim }
\group_end:
}
{
\__tblr_build_page_table:nnx {#1}
{ \int_use:N \l__tblr_long_from_int }
{ \int_use:N \l__tblr_prev_i_int }
\int_incr:N \l__tblr_table_page_int
\int_set:Nn \l__tblr_long_from_int { \l__tblr_prev_i_int + 1 }
\TblrNewPage
}
\TblrNewPage
\hbox{}\kern-\topskip\nobreak
\noindent
\LogTblrTracing { page }
Expand Down

0 comments on commit 1c650d4

Please sign in to comment.