用latex写文有时候会碰到比较大的表格,对于很宽但又不长的表格能够使用rotfloat宏包的sidewaystable环境来插入旋转90度后的表格,如:shell
%导言区:\usepackage{rotfloat} \begin{sidewaystable} \centering \begin{tabular}{ccccccccccccccccccccccccccccccc} ... \end{tabular} \end{sidewaystable}
对于不宽但很长的表格能够用longtable宏包来进行分页显示。实例以下:ide
%导言区:\usepackage{longtable,booktabs} \begin{longtable}{ccccccccccc} \caption{表名}\label{tab-data} \toprule Name & Sample & $z_d$ & $z_s$ & $\sigma_{ap}$(km/s) & $R_e$(") & $\sigma_{e8}$(km/s) & $\theta_E$(") & $D_{obs}$ & $\sigma_D$ & Ref \\ \midrule \endfirsthead \multicolumn{11}{r}{续表\autoref{tab-data}}\\ \multicolumn{11}{c}{(接上页)}\\ \toprule Name & Sample & $z_l$ & $z_s$ & $\sigma_{ap}$(km/s) & $R_e$(") & $\sigma_{e8}$(km/s) & $\theta_E$(") & $D_{obs}$ & $\sigma_D$ & Ref \\ \midrule \endhead \bottomrule \multicolumn{11}{c}{(接下页)} \endfoot \bottomrule \endlastfoot ... ——(表格内容)—— ... \end{longtable}
\toprule、\midrule和\bottomrule为三线表booktabs的横线控制命令;\endfirsthead前为表格首页的表头,\endfirsthead到\endhead部分为其它页的表头,\endhead到\endfoot部分为除表格尾页外的其它页的表尾,若表格接口处须要链接提示(如实例中的“续表”“接上页”“接下页”等内容)可在上述两个部分设置,\endfoot到\endlastfoot部分是最后一页的表尾。spa
最简单的使用也可不作\endhead等设置,直接使用longtable环境,这样表格也会在分页时自动断开。而插入\newpage命令能在命令插入处强制分页。须要交叉引用时label可如上所示放在caption的后面。code
须要注意的是longtable环境不能放在table的浮动体内,不然只会在一页显示。orm
有时候表格的内容太多过宽,须要用小号的字,可在\begin{longtable}前加\small等控制字号的命令。但这样会一个问题:caption的内容也变小了。在caption内容前加\normalsize等字号命令虽可以使内容成为大字,但前面的"表?"字样仍为小字,可经过使用caption宏包解决这一问题,在导言区加入下列命令:接口
\usepackage[font=normalsize]{caption} \renewcommand{\normalsize}{\zihao{-4}}
上述命令将caption的字号设为normalsize,同时又经过重定义\normalsize来控制caption的字号大小。ci
对于又长又宽的表格,目前除了缩小字号外还不清楚是否有更好的方法,求指教!io
2016.3.4更新:table
对于又长又宽的表格,能够使用landscape环境来翻转页面,结合longtable环境将表格分页:ast
%导言区:\usepackage{longtable,pdflscape} \begin{landscape} \begin{longtable}{ccccccccccc} ... \end{longtable} \end{landscape}
某些模板内置的表格环境可能也支持表格翻转并分页,如American Astronomical Society (AAS)提供的模板,可直接使用模板中的deluxetable环境加上rotate命令来实现:
\begin{deluxetable}{cccccccccc} \rotate %翻转表格 \startdata ... (data) \enddata \end{deluxetable}