基本语法
Latex录入表格一般使用tabular
基本格式如下:
\begin{tabular}{对齐方式}
<表项> & <表项> &...& \\
<表项> & <表项> &...& \\
\end{tabular}
现在对对齐方式进行简单的描述
一般情况下我们都使用c(centering的第一个字母),{对齐方式}->{ccc},表示三列的内容都是居中对齐。
讲个例子:
\documentclass{
article}
\begin{
document}
\begin{
tabular}{
cccc}
a11 & a12 & a13 & b1 \\
a21 & a22 & a23 & b2 \\
a31 & a32 & a33 & b3 \\
\end{
tabular}
\end{
document}
效果如下:
当然,我们还可以适当的给这个表格添加横、竖线。
横线:需要在该行添加语句\hline,
竖线:需要在{对齐方式}这里进行设置,例如{cc|c},表示在第二三列之间添加竖线
例子如下:
\documentclass{
article}
\begin{
document}
\begin{
tabular}{
c|c|cc}
\hline
a11 & a12 & a13 & b1 \\
a21 & a22 & a23 & b2 \\
\hline
a31 & a32 & a33 & b3 \\
\end{
tabular}
\end{
document}
效果如下:
三线表
了解前面的语法,接下来便可以做出三线表的效果了。
例子如下:
\documentclass{
article}
\begin{
document}
\begin{
tabular}{
ccc}
\hline
id & name & sex \\
\hline
1 & John & man \\
2 & Jack & woman \\
\hline
\end{
tabular}
\end{
document}
效果如下:
通常情况,为了让表格更具美感,我们希望第一根线和最后一根线比中间那根线更粗点。此时我们需要引入宏包booktabs,之后便可以使用\toprule 和 \bottomrule 命令分别画出表格头和表格底的粗横线,而用 \midrule 画出表格中的横线。
例子如下:
\documentclass{
article}
\usepackage{
booktabs}
\begin{
document}
\begin{
tabular}{
ccc}
\toprule
id & name & sex \\
\midrule
1 & John & man \\
2 & Jack & woman \\
\bottomrule
\end{
tabular}
\end{
document}
效果如下:
单元格合并
在唠唠怎么给他做单元格合并。
对于某一行
\multicolum{行数}{对齐方式}{文本内容}
例子如下:
\documentclass{
article}
\begin{
document}
\begin{
tabular}{
|c|c|c|}
\multicolumn{
3}{
c}{
information} \\
\hline
id & name & sex \\
\hline
1 & John & man \\
\hline
2 & Jack & woman \\
\hline
\end{
tabular}
\end{
document}
效果如下:
对于列的单元格合并,需要导入包
\usepackage{multirow}
例子如下:
\documentclass{
article}
\usepackage{
multirow}
\begin{
document}
\begin{
tabular}{
|c|c|c|c|}
\hline
\multicolumn{
4}{
|c|}{
information} \\
\hline
\multirow{
3}*{
data}
&id & name & sex \\
\cline{
2-4} %%只为第2-4列添加横线
&1 & John & man \\
\cline{
2-4} %%只为第2-4列添加横线
&2 & Jack & woman \\
\hline
\end{
tabular}
\end{
document}
效果如下:
现在,我们用上面的合并基础语法,来做一个稍微复杂点的表格
例子如下
\documentclass{
article}
\usepackage{
multirow}
\begin{
document}
\begin{
tabular}{
|c|c|c|c|c|c|c|}
\hline
\multicolumn{
2}{
|c|}{
\multirow{
2}*{
$S_i$} }& \multicolumn{
4}{
c|}{
x} &\multirow{
2}*{
max}\\
\cline{
3-6}
\multicolumn{
2}{
|c|}{
}&50&100&150&200&\\
\hline
\multirow{
4}*{
y}&50&0&100&200&300&300\\
\cline{
2-7}
&100&100&0&100&200&200\\
\cline{
2-7}
&150&200&100&0&100&200\\
\cline{
2-7}
&200&300&200&100&0&300\\
\hline
\end{
tabular}
\end{
document}
效果如下:
我们还可以做一个斜线表头,需要导入包
\usepackage{diagbox}
例子如下
\documentclass{
article}
\usepackage{
diagbox}
\begin{
document}
\begin{
tabular}{
|c|c|c|c|}
\hline
\diagbox{
A}{
$\alpha_{
i,j}$}{
B}&$\beta_1$&$\beta_2$&$\beta_3$\\ %添加斜线表头
\hline
$\alpha_1$&-4&0&-8\\
\hline
$\alpha_2$&3&2&4\\
\hline
$\alpha_3$&16&1&-9\\
\hline
$\alpha_4$&-1&1&7\\
\hline
\end{
tabular}
\end{
document}
如果我们需要斜线+单元格并列效果。
先简单讲一个例子:
\documentclass{
article}
\usepackage{
diagbox}
\usepackage{
multirow}
\begin{
document}
\begin{
tabular}{
|c|c|c|c|c|c|c|}
\hline
\multicolumn{
2}{
|c|}{
\multirow{
2}*{
\diagbox{
$S_i$}{
$\lambda_i$}}}& \multicolumn{
4}{
c|}{
x} &\multirow{
2}*{
max}\\
\cline{
3-6}
\multicolumn{
2}{
|c|}{
}&50&100&150&200&\\
\hline
\multirow{
4}*{
y}&50&0&100&200&300&300\\
\cline{
2-7}
&100&100&0&100&200&200\\
\cline{
2-7}
&150&200&100&0&100&200\\
\cline{
2-7}
&200&300&200&100&0&300\\
\hline
\end{
tabular}
\end{
document}
效果如下:
上述就完成这个要求,注意调节\diagbox[innerwidth=2cm],如果斜线对不准,请条件这个参数
table环境
我们在写论文时,需要将表格插入文档中,表格的环境是table,类似于图片的环境是figure。基本的用法和图片环境figure类似,这里也简单的提一下吧
\begin{table}[htbp]
\centering %居中
\caption{名称}
\label{} %引用表格所需
\begin{tabular}{对齐方式}
........
\end{tabular}
\end{table}
[htbp]
,选择将表格放入文档中的哪个位置
h(here):将表格插入在当前文字位置
t(top):将表格放在下一页首
b(bottoom):将表格放在当前页底部
p(page):放入下一页
简单讲一个例子:
\documentclass{
article}
\begin{
document}
As the favorable food for Scotch, the herring and mackerel bring generous profits to fishing
companies. Due to the hotter ocean, more fish move to the north to seek better habitats, laying a
negative impact on the fishing industry. The aim of this report is to build a migratory prediction
model to evaluate the influences on the income of fishing companies. We are expected to provide
some strategies for fishing companies who can adapt to the migration of fish under the constraints of
various objective conditions and prevent themselves from going bankrupt as much as possible. Three
models are established: Model I: Seawater Temperature Prediction Model; Model II: Fish Migration
Prediction Model; Model III: Fishing Company Earnings Evaluation Model.
\begin{
table}[htbp]
\centering
\caption{
三线表}
\label{
tab:1}
\begin{
tabular}{
ccc}
\hline
name& id& sex\\
\hline
Steve Jobs& 001& Male\\
Bill Gates& 002& Female\\
\hline
\end{
tabular}
\end{
table}
For Model I, global ocean temperature date monthly from 1960 to 2019 is firstly collected. Then,
based on the analysis of intrinsic trend of the data and the verification of the stationarity, the validation
of using ARIMA model to predict temperature is proved. Next, historical data is used to fit the
parameters of ARIMA, with introduction of k-fold cross validation to identify the final prediction
model as ARIMA(1,1,0). Finally, according to ARIMA(1,1,0), bootstrap method is used to simulate
10000 possible prediction cases, which lays a great foundation to predict the migration of fish.
\end{
document}
效果如下:
如果你还是不会用,在此给你留个链接Latex表格在线网址
觉得有用的客官点个赞啊๑乛◡乛๑,你的鼓励是我创作的动力,欢迎有问题给我留言~
文章浏览阅读2.2k次,点赞4次,收藏4次。一、目的在使用CentOS6.3版本linux系统的时候,发现根目录(/)的空间不是很充足,而其他目录空间有很大的空闲,所以本文主要是针对现在已有的空间进行调整。首先,先来查看一下系统的空间分配情况:01.[root@CentOS-78 /]# df -h 02.Filesystem Size Used Avail Use% Mounted on 03./dev..._alloc pe 如何移到 free pe
文章浏览阅读267次。Java JDBC调用存储过程:无参、输入带参、输出及输出带参示例代码:package xzg; import java.sql.CallableStatement;import java.sql.Connection;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.T...
文章浏览阅读1.5w次,点赞4次,收藏4次。根据业务需求,有一台存放日志文件的服务器即将清空日志,要将所有日志文件上传至S3,想使用时在另一台机器下载即可。原本直接使用boto3传输,但传输过程报错了,原因是传输的文件太大了,超过传输限定阈值。解决方法是导入TransferConfig,将传输配置为分段传输即可,实现很简单,上代码:#导入需要的包from boto3.session import Sessionimport boto3from boto3.s3.transfer import TransferConfigREGI_高于阈值文件传输失败
文章浏览阅读5.6k次。elasticsearch head插件安装步骤环境:本地windows测试1:进入elasticsearch的bin目录cd D:\elasticsearch-0.20.5\bin2:执行plugin.batplugin -install mobz/elasticsearch-head3:如何访问?http://localhost:9200/_plugin/h_java.io.filepermission" "d:\program%20files%20(x86)\elasticsearch-5.6.8\plu
文章浏览阅读2.8k次。1、在mysql中新建了存储过程SQL_base_of_Data,但是调用执行时,报上面错误,找了半天没发现存储过程有啥问题,求高手指教。新建存储过程如下:DELIMITER$$CREATEPROCEDURE`SQL_base_...1、在mysql 中新建了存储过程SQL_base_of_Data,但是调用执行时,报上面错误,找了半天没发现存储过程有啥问题,求高手指教。新建存储过程如下:DELI...
文章浏览阅读4.1k次。参考:http://www.cnblogs.com/hellozg/p/9268131.html # 总结 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Pragma # Pragma - HTTP | MDN<?phpheader('HTTP/1.1 200 OK')..._php http_header
文章浏览阅读936次,点赞2次,收藏5次。涉及知识点:1、fofa搜索代码2、bp抓包3、cookie分析参数4、逻辑漏洞常在页面跳转参数传递中HACK学习呀Author 硝基苯好家伙,居然还真有这种商城,原谅我孤陋寡闻了。于是乎,想进去学习了一下首先,进行了一下初步的信息收集基本上都是伪静态的,没有什么发现可以明显判断其网站后端语言的地方在搜索框点击搜索后可以发现这个地址并不能帮助我们判断该站的类型但也要尝试一下SQL注入然后直接被 Ban IP了,索性放弃..._如何通过抓包修改商品价格
文章浏览阅读401次,点赞2次,收藏4次。基于前面两节人脸检测,特征值获取及跟踪,我们进一步实现人脸的跟踪,我们可以让机器人跟踪人脸,暨当人脸移动时控制机器人转动,使得人脸始终在图像窗体的中间位置,基本流程如下人脸检测,lesson 16中已经介绍过了,这里直接引用就可以。特征获取,lesson 17中也已经实现,但要达到比较好的效果,需要对特征点做一些补偿及噪声点的剔除人脸跟踪,需要根据ROI的位置,来判断机器人需要怎样移动才能...
文章浏览阅读1.7w次,点赞22次,收藏152次。利用matlab对音频做左右声道的分析_用matlab对声音进行频谱分析
文章浏览阅读682次。一、前奏:熟悉Python内存管理在Python中,变量在第一次赋值时自动声明,在创建---也就是赋值的时候,解释器会根据语法和右侧的操作数来决定新对象的类型。引用计数器:一个内部跟踪变量引用计数:每一个对象各有多少个引用当对象被创建并(将其引用)赋值给变量时,该对象的引用计数就被设置为 1>>> x = 3.14语句 x=3.14,创建一个浮点型对象并将其引用赋值_深拷 和浅拷 的区别
文章浏览阅读718次。之前跑团的时候想着要不弄个自己的私人骰子,正好最近在复习js!就写了个简单网页,之后学完了再来扩充功能。这是页面<h1>我是一个<span id="h">骰子</span></h1> <p>你应该按回车骰点,支持rd和rc,例如: <strong>rd6或者r2d6或者rc6</strong>分别代表: 选取1-6的随机数、 取1-6的2位随机数、 取1-100随机数,判断6与随机数大小关系。&
文章浏览阅读111次。本节书摘来自异步社区《C语言点滴》一书中的第1章,第1.4节,作者 赵岩,更多章节内容可以访问云栖社区“异步社区”公众号查看1.4 程序=数据结构+算法C语言点滴程序员首先要有自己的想法,而写程序只是为了实现自己的想法而已。而程序员的想法就是用数据结构+算法来描述的。如果程序是一个人,正确的数据结构就像是强壮的体格,高效的算法就像是高尚的性格,而...