NJU1healer的个人博客分享 http://blog.sciencenet.cn/u/NJU1healer

博文

[转载]Latex之表格问题(七)

已有 8095 次阅读 2020-6-19 00:27 |个人分类:文章投稿|系统分类:科研笔记|文章来源:转载

(一)表格过长,页面横置,表格上下左右居中

解决表格过长,页面横置,表格上下居中,左右居中的问题,看如下几个例子:

表格横置的宏包是:\usepackage{rotating} % T for table

页面横置的宏包是:\usepackage{pdflscape} %page hengzhi

1. 页面竖置,表格横置于页面

 表格横置而页面竖置

\begin{sidewaystable}

...

what you want to say

....

\begin{sidewaystable}

 表格过长,页面横置,表格上下左右居中

2. 页面横置,表格横置与页面,上下左右居中

页面横置,表格横置居中

\begin{landscape}

\vspace*{\fill}

...

what you want to say

...

\vfill % equivalent to \vspace{\fill}

\end{landscape}

表格过长,页面横置,表格上下左右居中

————————————————

原文链接:http://blog.sina.com.cn/s/blog_67f507220102v6pt.html

                    https://www.jianshu.com/p/9710c32f5e55

(二)Latex 表格过大(或过小)的调整方法

1 表格宽过窄问题: 表格宽度小, 与页面大小不匹配, 效果前后如下图所示.

image.png

目标: 调整表格宽度, 效果为”按页面宽度调整表格”.

命令: \setlength{\tabcolsep}{7mm}{XXXX}


实现代码:

\begin{center}

\textbf{Table 2}~~Improved table.\\

\setlength{\tabcolsep}{7mm}{

\begin{tabular}{cccccc} \toprule

Models  &  $\hat c$  &  $\hat\alpha$  &  $\hat\beta_0$  &  $\hat\beta_1$  &  $\hat\beta_2$  \\ \hline

model  & 30.6302  & 0.4127  & 9.4257  & - & - \\

model  & 12.4089  & 0.5169  & 18.6986  & -6.6157  & - \\

model  & 14.8586  & 0.4991  & 19.5421  & -7.0717  & 0.2183  \\

model  & 3.06302  & 0.41266  & 0.11725  & - & - \\

model  & 1.24089  & 0.51691  & 0.83605  & -0.66157  & - \\

model  & 1.48586  & 0.49906  & 0.95609  & -0.70717  & 0.02183  \\

\bottomrule

\end{tabular}}

\end{center}


2 表格宽过宽问题: 表格宽度大, 与页面大小不匹配, 效果前后如下图所示.

image.png

目标: 调整表格宽度, 效果为”按内容调整表格”.

命令: \resizebox{\textwidth}{15mm}{XXXX}

实现代码:

\begin{center}

\textbf{Table 1}~~Original table.\\

\resizebox{\textwidth}{15mm}{

\begin{tabular}{cccccccccccc} \toprule

Models  &  $\hat c$  &  $\hat\alpha$  &  $\hat\beta_0$  &  $\hat\beta_1$  &  $\hat\beta_2$ & Models  &  $\hat c$  &  $\hat\alpha$  &  $\hat\beta_0$  &  $\hat\beta_1$  &  $\hat\beta_2$  \\ \hline

model  & 30.6302  & 0.4127  & 9.4257  & - & -  & model  & 30.6302  & 0.4127  & 9.4257  & - & -\\

model  & 12.4089  & 0.5169  & 18.6986  & -6.6157  & - & model  & 30.6302  & 0.4127  & 9.4257  & - & - \\

model  & 14.8586  & 0.4991  & 19.5421  & -7.0717  & 0.2183 & model  & 30.6302  & 0.4127  & 9.4257  & - & - \\

model  & 3.06302  & 0.41266  & 0.11725  & - & - & model  & 30.6302  & 0.4127  & 9.4257  & - & - \\

model  & 1.24089  & 0.51691  & 0.83605  & -0.66157  & - & model  & 30.6302  & 0.4127  & 9.4257  & - & - \\

model  & 1.48586  & 0.49906  & 0.95609  & -0.70717  & 0.02183  & model  & 30.6302  & 0.4127  & 9.4257  & - & - \\

\bottomrule

\end{tabular}}

\end{center}

————————————————

原文链接:https://blog.csdn.net/wbl90/article/details/52597429/

     点滴分享,福泽你我!Add oil!



https://blog.sciencenet.cn/blog-3428464-1238455.html

上一篇:如何读文献?
下一篇:[转载]Kappa系数
收藏 IP: 211.162.81.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

全部作者的其他最新博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-17 04:32

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部