I have the problem that tables that are larger than one page are not properly split but just overlap the first page.
I use tabularx with ltablex what works fine on its own but as soon as I wrap the whole thing into a threeparttable it doesn't break the page anymore. Is this combination supported? I know I could try longtable but I'd prefer to not have to have a special package depending on the size of the table.
Here's a MWE
\documentclass[a4paper,10pt,notitlepage]{article} % papersize, fontsize, documentclass;
\usepackage{xltabular}
\usepackage[flushleft]{threeparttablex} % to have a dedicated notes section after tables
\usepackage[font=small, margin=0pt]{caption} % table and figure captions
\usepackage[table]{xcolor} % used for table alternatively colors
\usepackage{booktabs} % use package booktabs for easy creating tables
% Spacing and margin rules
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{1pt}%
\setlength{\abovecaptionskip}{7pt}
\setlength{\belowcaptionskip}{10pt}
\setlength{\textfloatsep}{5pt}
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% CAPTION STYLE
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
\DeclareCaptionFormat{labelstyle}{%
\setlength\fboxsep{3pt}%
\colorbox{blue}{{#1}}#2#3
}
\captionsetup[table]{singlelinecheck=false, labelfont={color=white}} % Rechtsbündige Tabellen und Bildbeschreibung
\captionsetup[figure]{singlelinecheck=false, labelfont={color=white}, justification = raggedright, format=labelstyle}
% ------------------------------------------------------------------------------------------------------------------------
% TABLE
\newcommand{\tablestyle} {
\captionsetup{type=table, format=labelstyle}
\renewcommand{\arraystretch}{1.25}
\arrayrulecolor{blue}
\aboverulesep = 0mm
\belowrulesep = 0mm
}
\newenvironment{tableenv}[2]{
\par\vspace{0.5cm}
\def\tablecaption{#1}
\def\tablelabel{tab:#2}
\small
\tablestyle
\begin{table}
\begin{threeparttable}
}{
\caption{\tablecaption}
\label{\tablelabel}
\end{threeparttable}
\end{table}
}
\begin{document}
\section{Section with long table}
\begin{tableenv}{test}{test}
\begin{xltabular}{\linewidth}{@{} X @{}}
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
awdafgawfgawfa\\
\end{xltabular}
\end{tableenv}
\end{document}
It's still not breaking the table and I can't figure out why, it does break if I remove the tableenv environment tough.
threeparttablex? – leandriis Apr 14 '20 at 09:05threeparttablexin combination with longtable (for multi page tables), is there a solution for using it withtabularxas well? – po.pe Apr 14 '20 at 09:10xltabularoverltablexwhen it comes to multiple page tables withXtype columns.xltabularandthreeparttablexwork well together (See https://tex.stackexchange.com/a/504666/134144) – leandriis Apr 14 '20 at 09:14xltabularpackage and its eponymous environment, which loadsltablexand automatically adds the\keepXColumnsautomatically;threeparttablexworks with xltabular. – Bernard Apr 14 '20 at 09:27xltabularbut couldn't get it working insidethreeparttablex- posted a MWE – po.pe Apr 15 '20 at 07:00threeparrtablexhas a different syntax thanthreeparttable.\begin{ThreePartTable}vs.\begin{threeparttable}. Also, you can't place a tabular that should break across pages into atableenvironment. – leandriis Apr 15 '20 at 07:06\begin{document}
\section{Section with long table} \begin{tableenv}{test}{test} \begin{xltabular}{\linewidth}{@{} X @{}} \caption{my caption text here}\label{label}\ awdafgawfgawfa\ `
– leandriis Apr 15 '20 at 07:09tablethere in the first place, we'll see when something else stops working :) Do you wanna post an answer? – po.pe Apr 15 '20 at 07:23