TL;DR - 我想知道当内容空间不足时如何才能完全阻止转到下一页longtable
。hline
我决定在大学使用 latex 写我的论文。表格特别费劲,因为我似乎找不到任何资源来帮助我弄清楚如何使表格的内容longtable
继续hlines
到下一页而不是从新页面开始。为了提供更多信息,下面的屏幕截图显示了我想与我有
复制命令
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{longtable}
\title{SO}
\author{Visal Rajapakse}
\date{September 2021}
\begin{document}
\maketitle
\section{Introduction}
\lipsum[1-3]
\begin{longtable}{| p{.20\textwidth} | p{.80\textwidth} |}
\hline
foo & bar \\ \hline
% As rendered in the document, the first row of the long table remains in page 1, while the rest of the content moves to the next page as there isn't enough vertical space in page 1 to show the content in the second row. What I want is to have most of the content in the second row to remain in page 1, while the extra content of row 2 that wouldn't fit in page 1 to start in page 2. Such that, there isn't a huge space in page 1
Something 1 & \lipsum[1] \\ \hline
foo & bar \\ \hline
\caption{Your caption here} % needs to go inside longtable environment
\label{tab:myfirstlongtable}
\end{longtable}
\end{document}
可以看到上面的输出
我为这个问题制作的背面虚拟文档可以在以下网址找到:这里
我也尝试过解决方案这里但似乎不起作用。相反,它将表头移到下一页,溢出的内容超出了页脚。