简体   繁体   English

LaTeX中的非常宽的表

[英]Very Wide Tables in LaTeX

Is there a way to have a table in LaTeX that spans multiple pages width-wise, rather than length-wise? 有没有办法在LaTeX中有一个宽度方向跨越多个页面的表,而不是长度方式? As far as I can tell, both longtable and supertabular will break tables over multiple pages, but only by breaking between rows and I need to break between columns. 据我所知,longtable和supertabular都会在多个页面上打破表格,但只能在行之间断开,我需要在列之间中断。 Even better would be if it were possible to have a few columns repeated at on each page. 如果可以在每页上重复几列,那就更好了。

I am using this not so nice and manually configured code to split a too wide tabular: 我使用这个不太好和手动配置的代码来分割太宽的表格:

\usepackage{tikz}

\newsavebox{\boxFinal}
\begin{lrbox}{\boxFinal}
  \scalebox{0.6}{
  \begin{tabular}{...}
...
  \end{tabular}
  }
\end{lrbox}

\begin{table}[htb]
  \centering
  \begin{tikzpicture}
    \clip (0,-\dp\boxFinal) rectangle (0.5\wd\boxFinal,\ht\boxFinal);
    \pgftext[left,base]{\usebox{\boxFinal}};
  \end{tikzpicture}
  \label{table_test1}\caption{Part 1 of 2.}
\end{table}

\begin{table}[htb]
  \centering
  \begin{tikzpicture}
    \clip (0.5\wd\boxFinal,-\dp\boxFinal) rectangle
      (\wd\boxFinal,\ht\boxFinal); \pgftext[left,base]{\usebox{\boxFinal}};
  \end{tikzpicture}
  \label{table_test2}\caption{Part 2 of 2.}
\end{table}

There is usually a need to manually correct split offsets. 通常需要手动校正分割偏移。 You can do this by adding or subtracting from 0.5\\wd\\boxFinal value. 您可以通过在0.5 \\ wd \\ boxFinal值中添加或减去来实现此目的

The idea was taken from http://www.latex-community.org/forum/viewtopic.php?f=5&t=2867 该想法来自http://www.latex-community.org/forum/viewtopic.php?f=5&t=2867

I've been yanking my hair out with this same problem off and on for a week. 我一直在用同样的问题把头发拉了一个星期。 I think that this may not be entirely possible in a non-hacky sort of way. 我认为这可能不是完全可能以非黑客的方式。

One possible hackly solution is to use the dpfloat package: http://www.ctan.org/tex-archive/help/Catalogue/entries/dpfloat.html 一个可能的hackly解决方案是使用dpfloat包: http ://www.ctan.org/tex-archive/help/Catalogue/entries/dpfloat.html

Unfortunately, you'd be creating multiple tables and breaking them manually, but at least the end result should look okay. 不幸的是,你要创建多个表并手动打破它们,但至少最终结果看起来应该没问题。 Also, this will look much better if you ditch vertical rules in your tables as per the sage guidance in the booktabs package (which you will have to google because apparently I, as a new user, don't have enough reputation to post a link to the booktabs pdf manual). 此外,如果您根据booktabs软件包中的sage指导放弃表中的垂直规则,这将会更好看(您将不得不谷歌,因为显然我作为新用户,没有足够的声誉来发布链接到booktabs pdf手册)。

A good solution would be to rotate the whole table 90 degrees counterclockwise, thus having more room for it. 一个好的解决方案是将整个桌子逆时针旋转90度,从而有更大的空间。

Preamble \\usepackage{pdflscape} Preamble \\usepackage{pdflscape}

\newpage
\thispagestyle{empty}
\begin{landscape}
\begin{table}
...
\end{table}
\end{landscape}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM