latex 表格中如何精细控制行高,行距,行与行之间的距离

若是简单调整行距,则可以在插入表格前添加一行这样的命令:

\renewcommand\arraystretch{1.5}

或 \linespread{1.5}

若更加精细调整,各行间距可能不一样,之前在网上搜索,一直没有找到 latex 中控制表格行高的解决方案,最近几天使用latex 忽然找到了一个简单并且实用的方法:

使用表格线安装包,插入一个透明的表格线,通过控制表格线的上下距离来控制行高。

\usepackage{array}

\usepackage{booktabs}

使用表格时的命令:

\begin{tabular}

\specialrule{0em}{1pt}{1pt}

\end{tabular}

specialrule 命令第一个大括号控制表格线的粗细,若为0,则表格线透明,第二个大括号是表格线与上方内容的距离,第三个大括号是表格线与下方内容的距离,通过改变后两个大括号中的值来控制行高!

举例:

\usepackage{array}
\usepackage{booktabs} %调整表格线与上下内容的间隔
\usepackage{multirow}

\begin{tabular}[b]{p{5cm}<{\raggedright}p{7cm}<{\raggedright}}
\multicolumn{2}{l}{\small{\textbf{Table 1}}}\\
\multicolumn{2}{l}{\small{Notations adopted in our paper}}\\\specialrule{0.05em}{3pt}{3pt}
Notations  &Description\\\specialrule{0.05em}{3pt}{3pt}
Indices  &\\
\specialrule{0em}{1pt}{1pt}
$t$        &Period index, $t=1,2,\dots,T$\\
\specialrule{0em}{3pt}{3pt}
Problem parameters  &\\
\specialrule{0em}{1pt}{1pt}
$B_{0}$  &Initial capital quantity\\
$P$      &Product price\\
$a$      &Fixed production launching cost\\
$v$      &Unit variable production cost\\
$h$      &Unit inventory cost\\
$\pi$    &Unit penalty cost for back orders\\
\specialrule{0em}{3pt}{3pt}
Random variables  &\\
\specialrule{0em}{1pt}{1pt}
\multirow{3}*{$d_{t}$}      &Random demand at period $t$ with probability density function $f_{t}(d_{t})$,cumulative distribution function $F_{t}(d_{t})$, mean $\mu_{t}$, variance $\sigma^{2}$\\
\specialrule{0em}{3pt}{3pt}
State variables  &\\
\specialrule{0em}{1pt}{1pt}
$I_{t}$      &Inventory at the end of period $t$\\
$B_{t}$      &Capital quantity at the end of period $t$\\
\specialrule{0em}{3pt}{3pt}
Decision variables  &\\
\specialrule{0em}{1pt}{1pt}
$Q_{t}$ &order quantity at the beginning of period $t$\\
\specialrule{0.05em}{2pt}{0pt}
\end{tabular}


显示效果:


--------------------- 
作者:心态与做事习惯决定人生高度 
来源:CSDN 
原文:https://blog.csdn.net/robert_chen1988/article/details/52695496 
版权声明:本文为博主原创文章,转载请附上博文链接!

  • 4
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值