在多行上打破长表

在多行上打破长表

是否有可能破坏长表以使其不分裂多行?

例如:

\documentclass[12pt]{article}
\usepackage[margin=2cm,bottom=2.5cm,top=3cm]{geometry}
\usepackage{longtable}
\usepackage{multirow}

\begin{document}

Here's some text to screw up spacing :)

\begin{longtable}[l]{|l|l|l|l|}\hline
  \textbf{Decade} & \textbf{Advancements} & \textbf{Works} & \textbf{Summaries}\endhead\hline
  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline'

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

\end{longtable}

\end{document}

产生这个:令人厌恶的间距

理想情况下,它会在前一个多行的底部断开,这样当它延续到下一页时,它就不会在“Decade”和孤行下方有空间。

谢谢!

答案1

通常情况下,您可以使用\\*它来阻止中断,但水平线再次允许中断,因此自动避免这种情况有点棘手。

不过,手动修复很容易,只需在块\pagebreak前插入即可\multirow

\documentclass[12pt]{article}
\usepackage[margin=2cm,bottom=2.5cm,top=3cm]{geometry}
\usepackage{longtable,array}
\usepackage{multirow}

\begin{document}

Here's some text to screw up spacing :)

\begin{longtable}[l]{|l|l|l|l|}\hline
  \textbf{Decade} & \textbf{Advancements} & \textbf{Works} & \textbf{Summaries}\endhead\hline
  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline'

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\*\cline{2-4}
                  & Stuff & Stuff & Stuff \\*\cline{2-4}
                  & Stuff & Stuff & Stuff \\*\hline

\pagebreak
  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\*\cline{2-4}
                  & Stuff & Stuff & Stuff \\*\cline{2-4}
                  & Stuff & Stuff & Stuff \\*\hline

  \multirow{3}{*}{year - year} & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\cline{2-4}
                  & Stuff & Stuff & Stuff \\\hline

\end{longtable}

\end{document}

相关内容