I try to place a talltblr environment from Tabularray inside a table environment. However, this is messing up the pagebreak from the longtblr table above it. It somehow ends up inside the longtblr. The same thing happens when I change talltblr to tblr. I assumed the table environment would give me a better page layout (verticle space, placement etc). Is it not recommended to place a tblr inside a table environment?
See the MWE below and a picture of the outcome with and without the table environment wrapped around (tall)tblr. Blue header of longtblr, red header of talltblr.
\documentclass{article}
\usepackage{xcolor}% Colors
\usepackage{tabularray}%
\UseTblrLibrary{amsmath,booktabs}%
%--------------------------------------------------------------%
\begin{document}
%--------------------------------------------------------------%
\section{Long table error}
Text needed 1?
\begin{longtblr}[
caption = {Long tblr caption},% Caption
]{
colspec = {lX},
rowhead = 1,% # rows footer, header
hline{1,Z} = {1pt},% top & bottomrule
hline{2} = {0.3pt},% midrule
row{1} = {cyan},
}
% Header
Head 1 & Head 2 \
% Table
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\end{longtblr}
Text needed 2?
\begin{table}
\begin{talltblr}[
caption = {Tall tblr caption},% Caption
]{
colspec = {ll},
hline{1,Z} = {1pt},% top & bottomrule
hline{2} = {0.3pt},% midrule
row{1} = {purple},
}
% Header
Head 1 & Head 2 \
% Table
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\hline
AA & 1 \
BB & 2 \
CC & 3 \
DD & 4 \
\end{talltblr}
\end{table}
Text needed 3?
\end{document}
With table environment:
Blue header of longtblr, red header of talltblr.


Without table environment:
Blue header of longtblr, red header of talltblr.


