使用 SetCell 跨行时分页符处的 longtblr 布局出现问题

使用 SetCell 跨行时分页符处的 longtblr 布局出现问题

我遇到了一个问题,即longtblr基础表的中间页脚在分页之前覆盖了部分行。

给出以下示例:

\documentclass[letterpaper]{article}

\usepackage[sfdefault]{roboto}
\usepackage{caption}
\usepackage[table,dvipsnames]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tabularray}

\begin{document}
\section{My Section}
\begin{longtblr}[
  caption = {My Long Table},
  label = {tbl:my-long-table},
  ]{
    colspec = {X[2]X[5]},
    width = \linewidth,
    rowhead = 1,
    rowfoot = 1,
    row{even} = {azure9},
    row{1,Z} = {c,font=\sffamily\bfseries,bg=azure5,fg=white},
    hlines = {azure5,solid,0.4pt},
    vlines = {azure5,solid,0.4pt}
  }
  Column 1 & Column 2 \\
  \SetCell[r=2]{c} Row-0 & Row-0 \\
  &  Row-0 \\
  \SetCell[r=2]{c,bg=white} Row-1 & Row-1 \\
  &  Row-1 \\
  \SetCell[r=2]{c} Row-2 & Row-2 \\
  &  Row-2 \\
  \SetCell[r=2]{c,bg=white} Row-3 & Row-3 \\
  &  Row-3 \\
  \SetCell[r=2]{c} Row-4 & Row-4 \\
  &  Row-4 \\
  \SetCell[r=2]{c,bg=white} Row-5 & Row-5 \\
  &  Row-5 \\
  \SetCell[r=2]{c} Row-6 & Row-6 \\
  &  Row-6 \\
  \SetCell[r=2]{c,bg=white} Row-7 & Row-7 \\
  &  Row-7 \\
  \SetCell[r=2]{c} Row-8 & Row-8 \\
  &  Row-8 \\
  \SetCell[r=2]{c,bg=white} Row-9 & Row-9 \\
  &  Row-9 \\
  \SetCell[r=2]{c} Row-10 & Row-10 \\
  &  Row-10 \\
  \SetCell[r=2]{c,bg=white} Row-11 & Row-11 \\
  &  Row-11 \\
  \SetCell[r=2]{c} Row-12 & Row-12 \\
  &  Row-12 \\
  \SetCell[r=2]{c,bg=white} Row-13 & Row-13 \\
  &  Row-13 \\
  \SetCell[r=2]{c} Row-14 & Row-14 \\
  &  Row-14 \\
  \SetCell[r=2]{c,bg=white} Row-15 & Row-15 \\
  &  Row-15 \\
  \SetCell[r=2]{c} Row-16 & Row-16 \\
  &  Row-16 \\
  \SetCell[r=2]{c,bg=white} Row-17 & Row-17 \\
  &  Row-17 \\
  \SetCell[r=2]{c} Row-18 & Row-18 \\
  &  Row-18 \\
  \SetCell[r=2]{c,bg=white} Row-19 & Row-19 \\
  &  Row-19 \\
  \SetCell[r=2]{c} Row-20 & Row-20 \\
  &  Row-20 \\
  \SetCell[r=2]{c,bg=white} Row-21 & Row-21 \\
  &  Row-21 \\
  \SetCell[r=2]{c} Row-22 & Row-22 \\
  &  Row-22 \\
  \SetCell[r=2]{c,bg=white} Row-23 & Row-23 \\
  &  Row-23 \\
  \SetCell[r=2]{c} Row-24 & Row-24 \\
  &  Row-24 \\
  \SetCell[r=2]{c,bg=white} Row-25 & Row-25 \\
  &  Row-25 \\
  \SetCell[r=2]{c} Row-26 & Row-26 \\
  &  Row-26 \\
  \SetCell[r=2]{c,bg=white} Row-27 & Row-27 \\
  &  Row-27 \\
  \SetCell[r=2]{c} Row-28 & Row-28 \\
  &  Row-28 \\
  \SetCell[r=2]{c,bg=white} Row-29 & Row-29 \\
  &  Row-29 \\
  \SetCell[r=2]{c} Row-30 & Row-30 \\
  &  Row-30 \\
  Column 1 & Column 2 \\
\end{longtblr}
\end{document}

我得到以下输出:

在此处输入图片描述

中间页脚部分覆盖了第 27 行。我猜这是由于使用了多行命令,因为我在更简单的基础表中没有看到这种行为longtblr

有谁知道如何解决这一问题?

答案1

您应该\\*在每一行上使用 ,以便将其与下一行放在一起。这样,LaTeX 仍然可以决定将分页符放在何处,这与 的使用不同\pagebreak

  \SetCell[r=2]{c,bg=white} Row-27 & Row-27 \\*
  &  Row-27 \\

在此处输入图片描述

在此处输入图片描述

相关内容