Tabu、多行以及一个单元格中有大量文本的问题

Tabu、多行以及一个单元格中有大量文本的问题

我正在创建一个包含大量文本的表格,但是文本似乎超出了表格/单元格的边界。

以下是代码:

\documentclass[12pt]{article}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{tabu}
\usepackage{booktabs}

\usepackage{multirow}

\begin{document}


\tabulinesep=1.2mm\begin{tabu}to \columnwidth{@{}X[0.5,l]X[2,l]X[2,l]X[4,l]@{}}

\toprule

Code & Factor                    & Example & Hypothesis      \\                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
\midrule
P    & Preposed demonstrative    &  Tiptree sits on my book while I read it.       & \multirow{4}{*}{\begin{tabu}[l]{@{}X@{}}Cats read with their butts (Robinson 2017) Cats think books are comfy places to sleep (Robinson MC) Cats are lazy jerks who never clean up after themselves (Phyle 2000). Cats are villainous creatures bent on taking over the world and enslave human kind (Smith-Jones 1985). Cats secretly really just want to have their bellies rubbed (Leacock 1965). Polydactyl cats are the next stage in evolution where cats are striving for human dominance \end{tabu}} \\ 

D    & Postposed demonstrative   &         &    \\                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
S    & Simultaneous demonstratives  &         & \\                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
B    & Bare demonstrative        &         &  \\                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
\\ \bottomrule

\end{tabu}

\end{document}

看起来像这样:

在此处输入图片描述

我太累了,看不到解决方案。抱歉,我肯定错过了一些相关信息

答案1

在此处输入图片描述

multirow单元格高于跨越行的高度总和。在这种特殊情况下,可以通过添加来补偿这种高度差异\tabulinesep

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs, multirow, tabu, tabularx}
\usepackage{ragged2e}
\begin{document}

\tabulinesep =_0.8\baselineskip
\setlength\tabcolsep{4pt}
\begin{tabu} to \linewidth {@{} l X[0.8,L] X[1,L] X[2.2,L] @{}}
    \toprule
Code & Factor                    & Example & Hypothesis         \\
    \midrule
P    & Preposed demonstrative    &  Tiptree sits on my book while I read it.       & \multirow[t]{11}{=}{Cats read with their butts (Robinson 2017) Cats think books are comfy places to sleep (Robinson MC) Cats are lazy jerks who never clean up after themselves (Phyle 2000). Cats are villainous creatures bent on taking over the world and enslave human kind (Smith-Jones 1985). Cats secretly really just want to have their bellies rubbed (Leacock 1965). Polydactyl cats are the next stage in evolution where cats are striving for human dominance}          \\
D    & Postposed demonstrative      &         &                 \\
S    & Simultaneous demonstratives  &         &                 \\
B    & Bare demonstrative           &         &                 \\
    \bottomrule
\end{tabu}

相关内容