从 tabularray longtable 的标题中删除继续

从 tabularray longtable 的标题中删除继续

我想删除下面红色框里的内容:

在此处输入图片描述

我正在使用以下代码:

\documentclass{article}
\usepackage{tabularray}
\usepackage{xcolor}
\usepackage{lipsum}

\definecolor{mygray}{RGB}{238, 238, 238}
    
\begin{document}
    
\begin{longtblr}[
    caption = {Example of a long table with merged rows},
    label = {tab:example},
    ]{
        width = \textwidth,
        colspec = {|X[1,c,m]|X[1,l,m]|X[1,l,m]|},
        rowhead = 1,
        row{1} = {bg=mygray},
    }
    \hline
    Name & Country & Description \\
    \hline
    Alice & USA & \lipsum[1][1-1] \\
    \cline{2-3}
    & Canada & \lipsum[2][1-1] \\
    \cline{2-3}
    & Mexico & \lipsum[3][1-1] \\
    \hline
    Bob & UK & \lipsum[4][1-2] \\
    \cline{2-3}
    & France & \lipsum[5][1-3] \\
    \cline{2-3}
    & Germany & \lipsum[6][1-4] \\
    \hline
    Charlie & China & \lipsum[7][1-1] \\
    \cline{2-3}
    & Japan & \lipsum[8][1-1] \\
    \cline{2-3}
    & Korea & \lipsum[9][1-1] \\
    \hline
\end{longtblr}

\end{document}

答案1

对于此功能的整体设置,请在序言中输入以下说明:

\DefTblrTemplate{contfoot-text}{default}{}
\DefTblrTemplate{conthead-text}{default}{}

梅威瑟:

\documentclass{article}
\usepackage{lipsum}
\usepackage[latin]{babel}   % for hyphenation of lipsum text, 
                            % remove in real document

\usepackage{xcolor}
\definecolor{mygray}{RGB}{238, 238, 238}
\usepackage{ragged2e}
\usepackage{tabularray}
\DefTblrTemplate{contfoot-text}{default}{}  % <---
\DefTblrTemplate{conthead-text}{default}{}  % <---

\begin{document}

\begin{longtblr}[
    caption = {Example of a long table with merged rows},
    label = {tab:example},
    ]{hlines, vlines,
        colspec = {X[c,h] X[l] X[cmd={\RaggedRight\hspace{0pt}}]},
        row{1} = {bg=mygray},
        rowhead = 1,
    }
Name    & Country   & Description       \\*
%
\SetCell[r=3]{} Alice   
        & USA       & \lipsum[1][1-1]   \\*
        & Canada    & \lipsum[2][1-1]   \\*
        & Mexico    & \lipsum[3][1-1]   \\

\SetCell[r=3]{} Bob     
        & UK        & \lipsum[4][1-2]   \\*
        & France    & \lipsum[5][1-3]   \\*
        & Germany   & \lipsum[6][1-4]   \\
\SetCell[r=3]{} Charlie 
        & China     & \lipsum[7][1-1]   \\*
        & Japan     & \lipsum[8][1-1]   \\*
        & Korea     & \lipsum[9][1-1]   \\
\end{longtblr}

\end{document}

在此处输入图片描述

相关内容