1

Aim

I work on a project in overleaf. I have the code for the table below, which is a table that spans multiple pages. So far so good. The problem is that due to the first column containing multirow cells, the table should do the pagebreak only after the whole multirow cell, e.g., after s04. I would like to tell latex that it can do a pagebreak after each "group" (as defined in first column). I would also like my document to not break (no pun intended) each time I add or remove text above the table in my paper.

Problem

However, inserting \pagebreak does not do anything in my code, no matter where I place it.

What I tried

I played around with adding and leaving out \\* and \\, which seems to not have any influence. Tried \pagebreak in multiple places, which did not work either. Please help me, I am really at a loss here.

Code

\documentclass{article}

\usepackage{lipsum}
\usepackage{multirow}
\usepackage[export]{adjustbox}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}

\section{Introduction}
\lipsum[1]

\begin{longtblr}[
    label={tab:codes},
    caption={Codes based on the conducted interviews.},
    ]{
    width=1\linewidth,
    colspec={ Q[1] Q[1,c,m] Q[2,c,m] Q[4,l,h] },
    row{1} = { font=\bfseries }
    }
    \toprule
    Groups & ID & Subcodes & \SetCell{c}Explanation\\*
    \midrule
    \SetCell[r=4]{c} \rotatebox[origin=c]{90}{Reliabil\-ity and Security}
    & s01 & Access Control & The option to assign different rights of access for different users or teams. This includes encapsulated environments that protect a team from critical errors made by another team.\\*
    \midrule
    & s02 & Encryption & The method that is used to encrypt data in conjunction with services that can handle encrypted data.\\*
    \midrule
    & s03 & Compliance and Certification & Certification by an independent third party insures that requirements for security and compliance are fulfilled. \\*
    \midrule
    & s04 & Data Replication and Backup & Creation of backup copies of customer data, code, and models, including repllication accross multiple locations.\\
    \midrule
    \pagebreak
    \SetCell[r=4]{c} \rotatebox[origin=c]{90}{Performance}
    & s05 & Execution Speed & The runtime of a service until it provides a result. Mainly driven by inference time.\\*
    \midrule
    & s06 & Model Performance & The quality of the model output, measured in accuracy, F1 score, or others.\\*
    \midrule
    & s07 & Geo-Spatial Location of Data & The geographic locations where the data reside or the services run.\\*
    \midrule
    & s08 & Scalability & The ability for a service to increase or decrease its usage of computational power based on the current usage. Includes deploying the service to more machines.\\
    \midrule
    \SetCell[r=3]{c} \rotatebox[origin=c]{90}{Ease of Use}
    & s12 & Entry barrier & The hoops potential customers need to go through before they can use the service.\\*
    \midrule
    & s13 & Access to Third Party Apps & The possibility for third party developers to provide additional services and plugins complementary to the services of the provider. Often provided via a central marketplace.\\*
    \midrule
    & s14 & Create Applications with Few Clicks & The ability to create a minimal working application with few clicks. Most settings for such an application are pre-configured.\\
    \midrule
    \SetCell[r=3]{c} \rotatebox[origin=c]{90}{Relation to Competing Products}
    & s09 & Degree of Integration with other Services & The integration of third party services into the provider's products.\\*
    \midrule
    & s10 & Treatment of Downstream Services & The treatment of services that build upon the own provided services.\\*
    \midrule
    & s11 & Flexibility of Product Choice & The different ways a customer can accomplish a task when using a specific AIaaS product or product family.\\
    \midrule
    \SetCell[r=4]{c} \rotatebox[origin=c]{90}{Functionalities}
    & s15 & Offered Model Size & The model size can be measured by the number of parameters, FLOPs/MACs, or the storage size of the parameters.\\*
    \midrule
    & s16 & Complexity and Variety of Functionalities & The number of possible configurations,the workload types, the types of AI capabilities, such as labelling, MLOps, and data augmentation, and others, of a service.\\*
    \midrule
    & s17 & General Methods and Specialized Methods & Methods that have very niche use-cases but are highly optimized for those. In contrast to methods that are widely applicable to many tasks.\\*
    \midrule
    & s18 & Explainability and Transparency & Methods that provide explanations behind outputs of the AI services.\\*
\end{longtblr}

\end{document}
2
  • Your question is not clear. The first column contains cells with rotated text that span multiple lines. Page breaks only occur after these cells. Where is the problem? Feb 23, 2022 at 22:55
  • The page breaks do not occur as intended. Expected behavior is what you say, i.e., page breaks after multirow cells. My question is how to fix that.
    – joba2ca
    Feb 24, 2022 at 9:23

2 Answers 2

3

You only need to use \\* to prevent page breaks after these rows. And \pagebreak is not needed in your example.

Also I added rowhead=1 and \bottomrule to your code, and removed unnecessary \usepackage{multirow} from it.

\documentclass{article}

\usepackage{lipsum}
\usepackage[export]{adjustbox}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}

\section{Introduction}
\lipsum[1]

\begin{longtblr}[
    label={tab:codes},
    caption={Codes based on the conducted interviews.},
]{
    width=\linewidth,
    colspec={ Q[1] Q[1,c,m] Q[2,c,m] Q[4,l,h] },
    row{1} = { font=\bfseries },
    rowhead = 1,
}
    \toprule
    Groups & ID & Subcodes & \SetCell{c}Explanation\\*
    \midrule
    \SetCell[r=4]{c} \rotatebox[origin=c]{90}{Reliabil\-ity and Security}
    & s01 & Access Control & The option to assign different rights of access for different users or teams. This includes encapsulated environments that protect a team from critical errors made by another team.\\*
    \midrule
    & s02 & Encryption & The method that is used to encrypt data in conjunction with services that can handle encrypted data.\\*
    \midrule
    & s03 & Compliance and Certification & Certification by an independent third party insures that requirements for security and compliance are fulfilled. \\*
    \midrule
    & s04 & Data Replication and Backup & Creation of backup copies of customer data, code, and models, including repllication accross multiple locations.\\
    \midrule
    \SetCell[r=4]{c} \rotatebox[origin=c]{90}{Performance}
    & s05 & Execution Speed & The runtime of a service until it provides a result. Mainly driven by inference time.\\*
    \midrule
    & s06 & Model Performance & The quality of the model output, measured in accuracy, F1 score, or others.\\*
    \midrule
    & s07 & Geo-Spatial Location of Data & The geographic locations where the data reside or the services run.\\*
    \midrule
    & s08 & Scalability & The ability for a service to increase or decrease its usage of computational power based on the current usage. Includes deploying the service to more machines.\\
    \midrule
    \SetCell[r=3]{c} \rotatebox[origin=c]{90}{Ease of Use}
    & s12 & Entry barrier & The hoops potential customers need to go through before they can use the service.\\*
    \midrule
    & s13 & Access to Third Party Apps & The possibility for third party developers to provide additional services and plugins complementary to the services of the provider. Often provided via a central marketplace.\\*
    \midrule
    & s14 & Create Applications with Few Clicks & The ability to create a minimal working application with few clicks. Most settings for such an application are pre-configured.\\
    \midrule
    \SetCell[r=3]{c} \rotatebox[origin=c]{90}{Relation to Competing Products}
    & s09 & Degree of Integration with other Services & The integration of third party services into the provider's products.\\*
    \midrule
    & s10 & Treatment of Downstream Services & The treatment of services that build upon the own provided services.\\*
    \midrule
    & s11 & Flexibility of Product Choice & The different ways a customer can accomplish a task when using a specific AIaaS product or product family.\\
    \midrule
    \SetCell[r=4]{c} \rotatebox[origin=c]{90}{Functionalities}
    & s15 & Offered Model Size & The model size can be measured by the number of parameters, FLOPs/MACs, or the storage size of the parameters.\\*
    \midrule
    & s16 & Complexity and Variety of Functionalities & The number of possible configurations,the workload types, the types of AI capabilities, such as labelling, MLOps, and data augmentation, and others, of a service.\\*
    \midrule
    & s17 & General Methods and Specialized Methods & Methods that have very niche use-cases but are highly optimized for those. In contrast to methods that are widely applicable to many tasks.\\*
    \midrule
    & s18 & Explainability and Transparency & Methods that provide explanations behind outputs of the AI services.\\
    \bottomrule
\end{longtblr}

\end{document}

enter image description here

3
  • Thank you very much. Works like a charm when compiling offline. Hoewever, on overleaf it does not work, just as my original code.
    – joba2ca
    Feb 24, 2022 at 9:41
  • 2
    @joba2ca overleaf has an old version of tabularray. You need to upload new version to your project on overleaf.
    – L.J.R.
    Feb 24, 2022 at 10:33
  • Uploading tabularray.sty from CTAN solved it. Thank you very much, you saved me hours of work!
    – joba2ca
    Feb 24, 2022 at 12:02
3

Some off-topic suggestion for your table setting which show another way to write your table:

  • for rotate content in cells use rotating and makecell packages,
  • use hline{1,Z} = 1pt, hline{2-Y} = {solid}, instead of rules defined in booktabs package (loaded by UseTblrLibrary{booktabs})
  • for the last two columns are used X column type
  • table breaks between pages are enables on the same way as is done in the @L.J.R answer
\documentclass{article}
\usepackage{lipsum}

\usepackage{rotating}   % needed
\usepackage{makecell}   % needed
\usepackage{tabularray}

\begin{document}

\section{Introduction}
\lipsum[66]

\begingroup
\settowidth\rotheadsize{Competing Products}
\renewcommand\cellalign{cc}
\begin{longtblr}[
    caption={Codes based on the conducted interviews.},
    label={tab:codes}, % had to be after caption?
                ]{
      hline{1,Z} = 1pt, hline{2-Y} = {solid},
         colspec = {@{} Q[c,m] Q[c,m] X[c,m] X[2,j,h] @{}},
    cell{2-Z}{1} = {cmd=\rotcell[cc]},
          row{1} = {font=\bfseries, c},
         rowhead = 1,
                  }
Groups & ID & Subcodes &    Explanation     \\*
\SetCell[r=4]{c}    Reliability and Security
    & s01   & Access Control
                & The option to assign different rights of access for different users or teams. This includes encapsulated environments that protect a team from critical errors made by another team.\\*
    & s02   & Encryption
                & The method that is used to encrypt data in conjunction with services that can handle encrypted data.\\*
    & s03   & Compliance and Certification
                & Certification by an independent third party insures that requirements for security and compliance are fulfilled. \\*
    & s04   & Data Replication and Backup
                & Creation of backup copies of customer data, code, and models, including replication across multiple locations.\\
\SetCell[r=4]{c,m}    Performance
    & s05   & Execution Speed
                & The runtime of a service until it provides a result. Mainly driven by inference time.\\*
    & s06   & Model Performance
                & The quality of the model output, measured in accuracy, F1 score, or others.\\*
    & s07   & Geo-Spatial Location of Data
                & The geographic locations where the data reside or the services run.\\*
    & s08   & Scalability
                & The ability for a service to increase or decrease its usage of computational power based on the current usage. Includes deploying the service to more machines.\\
\SetCell[r=3]{c,m}    Ease of Use
    & s12   & Entry barrier
                & The hoops potential customers need to go through before they can use the service.\\*
    & s13   & Access to Third Party Apps
                & The possibility for third party developers to provide additional services and plugins complementary to the services of the provider. Often provided via a central marketplace.\\*
    & s14   & Create Applications with Few Clicks
                & The ability to create a minimal working application with few clicks. Most settings for such an application are pre-configured.\\
\SetCell[r=3]{c,m}    {Relation to\\ Competing Products}
    & s09   & Degree of Integration with other Services
                & The integration of third party services into the provider's products.\\*
    & s10   & Treatment of Downstream Services
                & The treatment of services that build upon the own provided services.\\*
    & s11 & Flexibility of Product Choice & The different ways a customer can accomplish a task when using a specific AIaaS product or product family.\\
\SetCell[r=4]{c,m}    Functionalities
    & s15   & Offered Model Size
                & The model size can be measured by the number of parameters, FLOPs/MACs, or the storage size of the parameters.\\*
    & s16   & Complexity and Variety of Functionalities
                & The number of possible configurations,the workload types, the types of AI capabilities, such as labelling, MLOps, and data augmentation, and others, of a service.\\*
    & s17   & General Methods and Specialized Methods
                & Methods that have very niche use-cases but are highly optimized for those. In contrast to methods that are widely applicable to many tasks.\\*
    & s18   & Explainability and Transparency
                & Methods that provide explanations behind outputs of the AI services.\\
    \end{longtblr}
\endgroup
\end{document}

enter image description here

2
  • Thanks! I really appreciate the info, because your suggestions seperate formating and content much better than my code. Why does the linebreak in {Relation to\\ Competing Products}work, though? In my code, it does not. Do you need the makecell package for that?
    – joba2ca
    Feb 25, 2022 at 11:50
  • @joba2ca, rotating and makecell are employed for rotate cells' contents in the first column. For manual break of cells text tabularray define environment {...\\ ...}. For details see package documentation. Sor4y for more than one year delay ...
    – Zarko
    Mar 11, 2023 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .