10

我在 LaTeX 中有一个很长的表格,它跨越了几页,并且(现在这样)对于页面来说也太宽了。

我正在使用p{width}命令指定的每个列宽的 longtable 包。

问题是,大多数行都包含多列调用,因此不遵守前导p{width}命令,这导致表的总宽度太大。

最小的例子:

\begin{longtable}{|p{1in}|p{0.75in}|p{0.5in}|p{0.5in}|>{p{1in}|p{1in}|}
\caption{some cap} \label{somelable}\\
\hline
\multicolumn{2}{|c|}{\textbf{Text Header One}} & \multicolumn{2}{|c|}{\textbf{Text Header Two}} & \multirow{2}{*}{\textbf{Three}} & \multirow{2}{*}{\textbf{Four}} \tabularnewline \cline{1-4}
\textbf{Five} & \textbf{Six} & \textbf{Seven} & \textbf{Eight} &  & \tabularnewline \hline
Some Text String & Longer Text String Here & More Text Here & Text Example & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hlineExample Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & \multicolumn{2}{|l|}{Multi-column Text String that doesn't fit column width} & Text & Text \tabularnewline \hline
Example Text String Two & Longer Text String Example Two & width of box & text & Text & Text  \tabularnewline \hline
\end{longtable} 

我在序言中加载 longtable,并多次运行 pdflatex(如 longtable 文档中所述)。它编译时出现 0 个警告和 0 个错误。

我怎样才能得到正常的“窄”细胞?

4

3 回答 3

8

您是否尝试过使用|p{<sum of widths>}|格式化选项\multicolumn

这里只是猜测。

于 2009-07-10T17:53:15.827 回答
3

即使有前导码大小,您也必须为多列提供大小参数。下一个示例是表格宽度大小的多列单元格:

\begin{tabular}{p{0.3\textwidth} p{0.7\textwidth}}
\multicolumn{2}{ p{\textwidth}} {YOUR TEXT HERE}
\end{tabular}
于 2014-12-07T21:53:21.943 回答
1

\begin{longtable}{p{2.8cm} p{2.8cm} 为我工作..

于 2009-08-20T05:30:57.783 回答