LaTeX 分页表格示例

在标准 LaTeX 中的tabular是当做一个“盒子”来处理的,不能分割,表格只能在一页,如果表格太大,超过了bottom margin,就会报Overfull vbox错误.

所以无法跨页显示。


宏包supertabular是一个tabular environment的扩展,supertabular接到\\后,会重新计算可以使用的空间,如果到了页面高度,就会自动插入tabeltail,开始新的一页,新的一页以tablehead连接.

主要用到的命令有以下几个(需要注意的是,一定要加\\)

  1. \tablefirsthead 用来显示第一行.
  2. \tablelasttail 用来显示最后第一行.
  3.  \tablehead 当分页时,会显示在下页的第一行.
  4.  \tabletail 当分页时,会显示在该页最后一行,但是最后一页不会显示.

具体的使用参考:

\usepackage{supertabular}

\begin{center}
\bottomcaption{最流行的通用Linux发行版本\label{最流行的通用Linux发行版本}}
%
\tablefirsthead{\hline\multicolumn{1}{|c|}{发行版本}&\multicolumn{1}{|c|}{说 明}\\\hline}
\tablelasttail{\hline}
%
\tablehead{\hline\multicolumn{2}{|c|}
{\small\sl continued from previous page}\\\hline
\multicolumn{1}{|c|}{发行版本}&\multicolumn{1}{|c|}{说 明}\\\hline}
\tabletail{\hline\multicolumn{2}{|c|}{\small\sl continued on next page}\\\hline}

\begin{supertabular}{|p{0.3\textwidth}|p{0.6\textwidth}|}
\href{www.centos.org}{CentOS}& 模仿Red Hat Enterprise Linux的免费发行版本\\
\href{www.debian.org}{Debian}&一种流行的非商业性质的发行版本\\
\href{fedora.redhat.com}{Fedora}&从Red Hat Linux分出的非商业动作的发行版本\\
\href{www.gentoo.org}{Gentoo}&基于源代码的发行版本\\
\href{www.mandriva.com}{Mandrivaa}&对用户最友好的发行版本之一\\
\href{www.opensuse.org}{openSUSE}&模仿SUSE Linux Enterprise的免费发行版本\\
\href{www.redhat.com}{Red Hat Enterprise}&Red Hat Linux的公司商业化动作的发行版本\\
\href{www.slackware.com}{Slackware}&稳定、基础而原始的发行版本\\
\href{www.novell.com/linux}{SUSE Linux Enterprise}&在欧亚洲流行的多语言发行版本\\
\href{www.turbolinux.com}{TurboLinux}&在亚洲流行的多语言发行版本\\
\href{www.ubuntu.com}{Ubuntu}& Cleaned-up version of Debian\\\hline
\end{supertabular}
\end{center}


发布了83 篇原创文章 · 获赞 24 · 访问量 53万+

猜你喜欢

转载自blog.csdn.net/virhuiai/article/details/7899548