在tabularray宏包的长表格环境中,单个单元格能否自动拆分

发布于 2023-07-12 16:33:12

太长不看党可直接跳转到标题3、4 

1 背景

排版了一个又长又宽的长表格。该表格中有2个单元格特别长(红色箭头),使用较大的字号会溢出页面,内容不全。

2 预想的解决方法

2.1 【当前采用】目前使用\tiny字号刚好放下,但是字号太小不便于阅读,而且如果再多几行就放不下了。此外,编译后会使得前一页留下大面积空白区域(蓝色箭头),如下图所示:

Snipaste_2023-07-12_15-07-27.png

2.2 原本想让该单元格在中间(如黄色线段处)自动断开,上部分配到第1页,下部接续后面的表格,但未能查到相应的解决方法。

2.3 手动拆分单元格。将一个超长的单元格手动拆分成两个较短的单元格,以便排版引擎自动排版。比较麻烦,内容形式好像并没有分离。

2.4 使用geometry宏包增加文本宽度。字号还是很小,表格依旧是不连续的

3 提问

操作系统Windows10,发行版TeX Live 2022,编辑器Visual Studio Code,编译命令xelatex。

该如何实现跨页长表格中,某个超长的单元格中间自动断开,并分配到前后两页(即2.2),使得表格更具连续性。类似下图的排版样式:

question.png

4 MWE

\documentclass[a4paper]{ctexbook}

\usepackage{xcolor}
\usepackage{lscape}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{geometry} 
\geometry{left=0.5cm,right=0.5cm,top=2.5cm,bottom=2.5cm}

\begin{document}

\begin{landscape}
  {\scriptsize
  \begin{longtblr}[
      caption = {Four-word and Longer Lexical Bundles in Steps},
      label = {tab:Four-word and Longer Lexical Bundles in Steps},
  ]{
      width = \linewidth,
      colspec = {X[2,c,h]  X[8,l,h]  X[8,l,h]  X[6,l,h]},
      rowhead = 1, rowfoot = 0, % 每个分页里表头表尾的数量
      row{even} = {azure9},
  }
      
  \toprule
  \textbf{Move/ Step} & \textbf{Communicative functions} & \textbf{Specific bundles} & \textbf{Common bundles}\\
  \midrule

  M1 & Creating a research territory/ space &  & \\
  1S1 & Presenting current knowledge or relevant information established by previos studies & {has been asociated with \\
      has been shown to \\
      is one of the} & {for the teatment of \\
      in patients with advanccd \\
      in the emergency depatmen \\
      in the treatment of}\\
  1S2 & Establishing a niche/problem & {little is known about the \\
      little is known about} & \\
  1S3a & Indicating main purposs & {the aim of this study was to evaluate the \\
      the aim of this study was to invesigate \\
      the aim of this study was to asscss \\
      the aim of this study was to \\
      the pupose of this study was to \\
      the objecive of this study was to \\
      of this study was to determine the \\
      of this study was to invsigate \\
      of this sudy was to determine \\
      of this study was to evaluate \\
      of this sudy was to compare \\
      of this study was to examine \\
      aim of the study was to \\
      of this study was to \\
      study was to evaluate the \\
      study was to investigate the \\
      of the study was to \\
      the efficacy and safety of \\
      study was to assess the \\
      the safety and efficacy of \\
      study was to determine the \\
      of this study were to \\
      we aimed to asses the\\
      of this study is to\\
      study was to compare the\\
      to determine the effect of\\
      to examine the association between\\
      the aim of this\\
      aim of this study\\
      the purpose of this\\
      study was to investigate\\
      study was to evaluate\\
      this study aimed to\\
      study was to assess\\
      we aimed to assess\\
      of the study was\\
      the study was to\\
      study was to compare\\
      the aim of the\\
      our objective was to\\
      our aim was to\\
      we sought to determine\\
      aimed to determine the\\
      aimed to investigate the\\
      was to determine whether\\
      aimed to evaluate the\\
      we aimed to evaluate\\
      study aimed to determine\\
      the objective of the\\
      was to examine the} & {for the treatment of \\
      in patients with advanced \\
      in the emergency departnent \\
      in the treatment of}\\
  1S3b & Raising hypotheses & tested the hypothesis that & in patients with advanced\\
  M2 & Describing research process &  & \\
  2S1 & Reporting on medical ethics review & study was approved by the & \\
  2S2 & Explaining briefly research design & {a retrospective cohort study of\\
      a retrospective cohort study\\
      we conducted a retrospective\\
      a cross-sectional study\\
      a secondary analysis of} & \\
  2S3 & Describing subjects or data and their selection criteria & {were included in the\\
      were included in this\\
      years or older with\\
      data were collected from} & {at the time of\\
      on the basis of}\\
  2S4 & Describing experimental procedure, such as interventions, examinations,
    etc. & {patients were randomly assigned to receive\\
      were randomly assigned to receive\\
      patients were randomly assigned to\\
      were randomly assigned to\\
      were randomized to receive\\
      were masked to treatment\\
      patients were randomized to\\
      we randomly assigned patients\\
      masked to treatment allocation\\
      participants were randomly assigned\\
      masked to treatment assignment} & {all patients who received at least one dose of \\
      at the time of \\
      on the basis of \\
      at the end of\\
      at a dose of\\
      was assessed using the\\
      was used to assess\\
      were used to assess\\
      were used to evaluate}\\
  
  \bottomrule
  
  \end{longtblr}
  }
\end{landscape}

\end{document}

查看更多

关注者
0
被浏览
1k
2 个回答
雾月
雾月 2023-07-12
这家伙很懒,什么也没写!

tabularray 做不到。LaTeX 格式下,现在所有在 CTAN 上发布的表格宏包都做不到自动在单元格中间断开。

ConTeXt 格式有几个表格可以做到,比如 https://wiki.contextgarden.net/TABLE

如果一定要在 LaTeX 中实现,可以参考
https://www.zhihu.com/question/592211454/answer/2957730520

g(x)
g(x) 2023-07-13
这家伙很懒,什么也没写!

不能,还是手动隔吧

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览