Tabularx 表格行为异常,一些文本没有换行到下一行

Tabularx 表格行为异常,一些文本没有换行到下一行

我有以下使用回忆录类的代码阿苏迪斯

\newcommand*{\pointsize}{12pt}
\documentclass[letterpaper,             % Use US letter-size paper
                       oneside,                 % No verso and recto differences
                       \pointsize]              % Uses the font size defined above
                       {memoir}
\usepackage{booktabs}
    
\usepackage{multirow}
\begin{document}    
\begin{table}
\begin{tabularx}{\textwidth}{@{} p{0.15\textwidth}p{0.15\textwidth}p{0.15\textwidth}p{0.2\textwidth}p{0.25\textwidth}@{}}
\toprule
Node name &
  Type &
  Conditional dependcy &
  States &
  Description \\ \midrule
Prior &
  \multirow{6}{*}{Initial ($t=0$)} &
  None &  11 states indicating score in the range {[}0-10{]} &
  A state of 0 denotes a student who scored a 0 in the pre-test while a state of 10 represents a student who scored 100\% in the pre-test \\ \cmidrule(r){1-1} \cmidrule(l){3-5} 
Knowledge0 &  & Prior &
  \multirow{10}{*}{True and False} &
  State of true denotes the possibility that the student has the required knowledge at timestep $t=0$ \\ \cmidrule(r){1-1} \cmidrule(lr){3-3} \cmidrule(l){5-5} 
Distractor00 & &
  \multirow{5}{*}{Knowledge0} &
 &
  \multirow{3}{*}{True denotes the evidence that the student has collected this distractor at timestep $t=0$} \\ \cmidrule(r){1-1}
Distractor01 & & & &
 \\ \cmidrule(r){1-1}
Distractor02 & & & &
 \\ \cmidrule(r){1-1} \cmidrule(l){5-5} 
Question0 & & & &
  True denotes the evidence that the student answered the quiz correctly at timestep $t=0$ \\ \cmidrule(r){1-2} \cmidrule(l){5-5} 
Knowledge1 &
  \multirow{5}{*}{Temporal ($t=1,2,3$)} & & &
  True denotes the possibility that the student has the required knowledge at timestep $t=1,2,3$ \\ \cmidrule(r){1-1} \cmidrule(lr){3-3} \cmidrule(l){5-5} 
Distractor10 & &
  \multirow{4}{*}{Knowledge1} & &
  \multirow{3}{*}{True denotes the evidence that the student has collected this distractor at timestep $t=1,2,3$} \\ \cmidrule(r){1-1}
Distractor11 & & & &
 \\ \cmidrule(r){1-1}
Distractor12 & & & &
 \\ \cmidrule(r){1-1} \cmidrule(l){5-5} 
Question1 & & & &
  True denotes the evidence that the student answered the quiz correctly at timestep $t=1,2,3$ \\ \bottomrule
\end{tabularx}
\end{table}
\end{document}

表格的呈现方式如下。我不知道为什么最后一列第 3 行和第 5 行的文本没有像其上下其余行一样换行。

此外,我如何使第 7 行第 2 列像其他行一样换行? 在此处输入图片描述

答案1

在使您的文档最低限度地可编译后(例如,通过用 替换 specious\pointsize选项12pt),我确定您(a)应摆脱所有\multirow指令,(b)切换到\small相对字体大小,(c)将 的值减小\tabcolsep3pt(默认值:6pt),以及(d)减小前四行的宽度并将列类型分配X给最后一列,以便有机会使表格适合文本块。

话虽如此,我还是无法弄清楚各个\cmidrule指令应该完成什么。这是你需要弄清楚的事情。

在此处输入图片描述

\documentclass[letterpaper,             % Use US letter-size paper
               oneside,                 % No verso and recto differences
               12pt]                    % Use a specific font size
               {memoir}
\usepackage{booktabs,ragged2e,array}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}
\begin{table}
\small % switch to 11pt inside this 'table' env.
\setlength\tabcolsep{3pt} % default: 6pt

\begin{tabularx}{\textwidth}{@{} 
     P{0.12\textwidth}
     P{0.11\textwidth}
     P{0.13\textwidth}
     P{0.16\textwidth} 
     L   @{}} % use at least one column of (modified) type 'X'
\toprule
Node name &
  Type &
  Conditional dependcy &
  States &
  Description \\ 
\midrule
Prior &
  Initial ($t=0$) &
  None &  11 states indicating score in the range [0--10] &
  A state of 0 denotes a student who scored a 0 in the pre-test, while a state of 10 represents a student who scored 100\% in the pre-test \\ 
  \cmidrule(r){1-1} \cmidrule{3-5} 
Knowledge0 &  & Prior & True and False &
  State of true denotes the possibility that the student has the required knowledge at timestep $t=0$ \\ 
  \cmidrule(r){1-1} \cmidrule(r){3-3} \cmidrule{5-5} 
Distractor00 & &
  Knowledge0 & &
  True denotes the evidence that the student has collected this distractor at timestep $t=0$ \\ 
  \cmidrule(r){1-1}
Distractor01 & & & &
 \\ \cmidrule(r){1-1}
Distractor02 & & & &
 \\ \cmidrule(r){1-1} \cmidrule{5-5} 
Question0 & & & &
  True denotes the evidence that the student answered the quiz correctly at timestep $t=0$ \\ \cmidrule(r){1-2} \cmidrule{5-5} 
Knowledge1 &
  Temporal ($t=1,2,3$) & & &
  True denotes the possibility that the student has the required knowledge at timestep $t=1,2,3$ \\ 
  \cmidrule(r){1-1} \cmidrule(r){3-3} \cmidrule{5-5} 
Distractor10 & &
  Knowledge1 & &
  True denotes the evidence that the student has collected this distractor at timestep $t=1,2,3$ \\ 
  \cmidrule(r){1-1}
Distractor11 & & & &
 \\ \cmidrule(r){1-1}
Distractor12 & & & &
 \\ \cmidrule(r){1-1} \cmidrule{5-5} 
Question1 & & & &
  True denotes the evidence that the student answered the quiz correctly at timestep $t=1,2,3$ \\ 
\bottomrule
\end{tabularx}
\end{table}
\end{document}

相关内容