![29acd03fc83a5251fdeb704d1a0488fc.png](https://i-blog.csdnimg.cn/blog_migrate/7f849f7bc16127a486a1f4ab749d9b9b.png)
解决了表格,latex论文写作就解决了一半,所以今天我们谈一下在论文写作中表格生成的几个问题。
对于表格,很多人的解决办法,就是利用excel的插件完成,也就是Excel2LaTeX 插件
excel2latexctan.org这个插件真的非常好用,只用在excel里面编辑好你的表格,就会正常生成tex代码。
![d8580687692569fd9c553b85586465b3.png](https://i-blog.csdnimg.cn/blog_migrate/39e6e67654f33d67391cac9cfb41e255.jpeg)
这种傻瓜式的方法在大部分情况下都很有用,但是它不能处理有修饰性的表格,而且有时候大型表格不是很美观,会发生越界等。
这里我们提供另外一个生成的表格的方法 tablesgenerator
Create LaTeX tables onlinewww.tablesgenerator.com这个网站的表格数据支持从 spreadsheet (e.g. Microsoft Excel), a text document, a Markdown / HTM code, or even a website 中导入数据。功能也非常强大,界面简单,操作也简单,熟悉一下几分钟就能搞定怎么使用。
从我写论文过工程中,我觉得以下几个关键地方:
1:对于一些大部分表格,其实我们采用的是三线表,所以对于三线表还需要我们自己在上述代码中添加一些 toprule midrule botrule
直接利用Excel2LaTeX生成的,效果如下:
![ed4037600b8b2be66f3e3039691b494a.png](https://i-blog.csdnimg.cn/blog_migrate/1650026d8c37044785bdc17f6c673a8f.png)
修改过后m,代码如下:
begin{table*}[!b]
centering
caption{SNRs OF THE RECONSTRUCTED M-D}
begin{tabular}{ccccc}
toprule
& multicolumn{2}{c}{0dB} & multicolumn{2}{c}{10dB}
& Proposed method & Ridge detector & Proposed method & Ridge detector
midrule
IF of component one & 27.28dB & 3.16dB & 28.36dB & 37.45dB
IF of component two & 28.88dB & -5.16dB & 25.01dB & 31.33dB
botrule
end{tabular}%
label{tabl}%
end{table*}%
效果如下:
![672fcaff8c8abcd9033401eb03a832e4.png](https://i-blog.csdnimg.cn/blog_migrate/5a665d96a73002a7a158dcf55759ee7d.png)
2:有的表格需要还需要我们添加表注,我平时使用threeparttable
为latex的table加上footnote,经典代码如下:
begin{table}[htbp]
caption{}
label{tab4}
centering
begin{threeparttable}
begin{tabular}{clccrrr}
toprule
& multicolumn{1}{l}{Numtnote{1}} & $F_1$,P1 & $F_1$,P2 & $F_1$, AVG tnote{2} &
midrule
Radar & 6 & 93.95±0.56 & 92.83±1.12 & 93.39±0.31 &
bottomrule
end{tabular}
begin{tablenotes}
footnotesize
item[1] Num: the number of subjects.
item[2] AVG:averaged.
end{tablenotes}
end{threeparttable}
end{table}
3:有的时候我们的表格太大,按照上面的生成的代码,表格会越界,并且显示不全。我给出一种简单粗暴的方法,就是人工分行,也就说自己将某个表格太长的内容自己分行。然后利用tablesgenerator 编辑,因为一般太大的表格我们不采用三线表的形式,需要自己定义规划表格横竖边界线。
例如这样,虽然最后的代码很复杂,但是我们只用复制粘贴,也不用看懂。
![83bcbb6b02b51e464b18a2832f95160d.png](https://i-blog.csdnimg.cn/blog_migrate/cac86ad44cb79aac080a0ed8489d4de2.jpeg)
最后,祝愿大家论文必中。