Excel 转Latex 及tex表格的处理 总结
Excel 转LaTex表格 与TeX表格的处理 总结
工具使用:一个Latex表格输入神器——Excel2Tex插件的安装过程。
首先下载插件:http://www.ctan.org/tex-archive/support/excel2latex/
CTAN的下载界面如下:
然后打开excel程序,“文件”--“选项”--“加载项”--“转到”--“浏览”,找到刚才下载的插件文件选择安装即可
具体使用界面:
彩色表格
- \begin{table}
- \centering
- \caption{彩色的表格}
- \begin{tabular}
- {>{\columncolor{blue}}rccccc}
- \toprule[1pt]
- \rowcolor[gray]{0.9} &1 &2 &3 &4 &5\\
- \midrule
- A &\multicolumn{1}{>{\columncolor{green}[0pt][0pt]}c}{318.3} &327.8 &152.0 &104.9 &135.8\\
- B &&\multicolumn{1}{>{\columncolor{red}[0pt][0pt]}r}{335.5} &137.7 &290.9 &198.6\\
- \bottomrule[1pt]
- \end{tabular}
- \end{table}
- \usepackage{xcolor}%定义了一些颜色
- \usepackage{colortbl,booktabs}%第二个包定义了几个*rule
设置表格总长
- \begin{table}
- \caption{设置表格总长}
- \begin{tabular*}{12cm}{lll}
- \hline
- Start & End & Character Block Name \\
- \hline
- 3400 & 4DB5 & CJK Unified Ideographs Extension A \\
- 4E00 & 9FFF & CJK Unified Ideographs \\
- \hline
- \end{tabular*}
- \end{table}
设置表格总长是12cm,前两行剩下的都是第三行的
表格内自动换行
- \begin{table}
- \Large
- \caption{自动换行}
- \begin{center}
- \begin{tabular}{|l|l|l|l| p{5cm}|}
- \hline
- Item & Name & Gender & Habit & Self-introduction \\ \hline
- 1 & Jimmy & Male & Badminton & Hi, everyone,my name is Jimmy. I come from Hamilton,
- and it's my great honour to give this example. My topic is about how to use p{width} command \\ \hline
- 2 & Jimmy & Male & Badminton & Hi, everyone,my name is Jimmy. I come from Hamilton,
- and it's my great honour to give this example. My topic is about how to use p{width} command \\
- \hline
- \end{tabular}
- \end{center}
- \end{table}
设置表格宽度
- \begin{table}
- \caption{表格宽度X}
- \begin{tabularx}{10cm}{llX} % 10cm 減去前兩個欄位寬度後,剩下的通通給
- \hline % 第三欄位使用,文字超出的部份會自動折行
- Start & End & Character Block Name \\
- \hline
- 3400 & 4DB5 & CJK Unified Ideographs Extension A \\
- 4E00 & 9FFF & CJK Unified Ideographs \\
- \hline
- \end{tabularx}
- \end{table}
设置表格中间某列的宽度
- \begin{table}
- \caption{设置宽度}
- \begin{tabularx}{12cm}{lXl}
- \hline
- Start & End & Character Block Name \\
- \hline
- 3400 & 4DB5 & CJK Unified Ideographs Extension A \\
- 4E00 & 9FFF & CJK Unified Ideographs \\
- \hline
- \end{tabularx}
- \end{table}
记得引入包
- \usepackage{tabularx}
改变任一列宽
- \begin{table}[h] %开始一个表格environment,表格的位置是h,here。
- \caption{改变表格任一列宽} %显示表格的标题
- \begin{tabular}{p{3.5cm}|p{2cm}|p{5cm}} %设置了每一列的宽度,强制转换。
- \hline
- \hline
- Format & Extension & Description \\ %用&来分隔单元格的内容 \\表示进入下一行
- \hline %画一个横线,下面的就都是一样了,这里一共有4行内容
- Bitmap & .bmp & Bitmap images are recommended because they offer the most control over the exact image and colors.\\
- \hline
- Graphics Interchange Format (GIF) & .gif & Compressed image format used for Web pages. Animated GIFs are supported.\\
- \hline
- Joint Photographic Experts Group (JPEG) & .jpeg, .jpg & Compressed image format used for Web pages.\\
- \hline
- Portable Network Graphics (PNG) & .png & Compressed image format used for Web pages.\\
- \hline
- \hline
- \end{tabular}
- \end{table}
效果:
tabu包用法
- \begin{table}
- \caption{tab包用法}
- \begin{center}
- \begin{tabu} to 0.8\textwidth{X[c]|X[3,b]|X[2,l]|X[c]|X[3,m]|X[1,c]}
- %0.8\textwidth 为设置表格宽度
- %X[c] 表示这一列居中,所占比例为1,相当于X[1,c]
- %X[3,c] 表示这一列居中,所占比例为3,这列的宽度是X[c]列的3倍
- \hline
- $i$ &$x_i$ &$n_i$ &$i$ &$x_i$ &$n_i$\\
- \hline
- 1 &0.5$\sim$0.64 &1 &8 &1.48$\sim$1.62 &53\\
- 2 &0.64$\sim$0.78 &2 &9 &1.62$\sim$1.76 &25\\
- 3 &0.78$\sim$0.92 &9 &10 &1.76$\sim$1.90 &19\\
- 4 &0.92$\sim$1.06 &26 &11 &1.90$\sim$2.04 &16\\
- 5 &1.06$\sim$1.20 &37 &12 &2.04$\sim$2.18 &3\\
- 6 &1.20$\sim$1.34 &53 &13 &2.18$\sim$2.38 &1\\
- 7 &1.34$\sim$1.48 &56 & & & \\
- \hline
- \end{tabu}
- \end{center}
- \end{table}
不要忘记引入包
- \usepackage{tabu}
水平居中显示
- \newcommand{\tabincell}[2]{
\begin{tabular}{@{}#1@{}}#2\end{tabular}
}
- \begin{table}[!t]
- \centering
- \scriptsize
- \caption{NOTATIONS}
- \label{tab:notations}
- \begin{tabular}{ll}
- \\[-2mm]
- \hline
- \hline\\[-2mm]
- {\bf \small Symbol}&\qquad {\bf\small Meaning}\\
- \hline
- \vspace{1mm}\\[-3mm]
- $P\!M_i$ & \tabincell{l}{The $i\,th$ physical machine or host server in the data \\center, i = 1, 2, ?-}\\
- \vspace{1mm}
- $C\!M$ & \tabincell{l}{ Vector of maximum disk size; $CM[i]$ stores the maximum\\ disk size of $PM_i$}\\
- \vspace{1mm}
- $B\!M$ & \tabincell{l}{Vector of remaining disk size; $BM[i]$ stores the remaining\\ disk size of $PM_i$}\\
- \vspace{1mm}
- $S\!P(P\!M_i)$ & \tabincell{l}{Selection preference of $PM_i$ }\\
- \vspace{1mm}
- $N\!ode_m$ & \tabincell{l}{The m\,th node of the data center network. A node can be a \\host server or a switch. m = 1, 2, ?-}\\
- \hline
- \hline
- \end{tabular}
- \end{table}

- \usepackage{multicol}
- \usepackage{multirow}
- \renewcommand{\arraystretch}{1.5} %¿ØÖƱí¸ñÐиߵÄËõ·Å±ÈÀý
- \begin{table}[tp]
- \centering
- \fontsize{6.5}{8}\selectfont
- \caption{Demographic Prediction performance comparison by three evaluation metrics.}
- \label{tab:performance_comparison}
- \begin{tabular}{|c|c|c|c|c|c|c|}
- \hline
- \multirow{2}{*}{Method}&
- \multicolumn{3}{c|}{C}&\multicolumn{3}{c|}{ D}\cr\cline{2-7}
- &Precision&Recall&F1-Measure&Precision&Recall&F1-Measure\cr
- \hline
- \hline
- A&0.7324&0.7388&0.7301&0.6371&0.6462&0.6568\cr\hline
- B&0.7321&0.7385&0.7323&0.6363&0.6462&0.6559\cr\hline
- C&0.7321&0.7222&0.7311&0.6243&0.6227&0.6570\cr\hline
- D&0.7654&0.7716&0.7699&0.6695&0.6684&0.6642\cr\hline
- E&0.7435&0.7317&0.7343&0.6386&0.6488&0.6435\cr\hline
- F&0.7667&0.7644&0.7646&0.6609&0.6687&0.6574\cr\hline
- G&{\bf 0.8189}&{\bf 0.8139}&{\bf 0.8146}&{\bf 0.6971}&{\bf 0.6904}&{\bf 0.6935}\cr
- \hline
- \end{tabular}
- \end{table}
三线表法
- \usepackage{booktabs}
- \usepackage{threeparttable}
- \renewcommand{\arraystretch}{1.5} %控制行高
- \begin{table}[tp]
- \centering
- \fontsize{6.5}{8}\selectfont
- \begin{threeparttable}
- \caption{Demographic Prediction performance comparison by three evaluation metrics.}
- \label{tab:performance_comparison}
- \begin{tabular}{ccccccc}
- \toprule
- \multirow{2}{*}{Method}&
- \multicolumn{3}{c}{ G}&\multicolumn{3}{c}{ G}\cr
- \cmidrule(lr){2-4} \cmidrule(lr){5-7}
- &Precision&Recall&F1-Measure&Precision&Recall&F1-Measure\cr
- \midrule
- kNN&0.7324&0.7388&0.7301&0.6371&0.6462&0.6568\cr
- F&0.7321&0.7385&0.7323&0.6363&0.6462&0.6559\cr
- E&0.7321&0.7222&0.7311&0.6243&0.6227&0.6570\cr
- D&0.7654&0.7716&0.7699&0.6695&0.6684&0.6642\cr
- C&0.7435&0.7317&0.7343&0.6386&0.6488&0.6435\cr
- B&0.7667&0.7644&0.7646&0.6609&0.6687&0.6574\cr
- A&{\bf 0.8189}&{\bf 0.8139}&{\bf 0.8146}&{\bf 0.6971}&{\bf 0.6904}&{\bf 0.6935}\cr
- \bottomrule
- \end{tabular}
- \end{threeparttable}
- \end{table}
画了两个表格,存放在一个图片中。
- \renewcommand{\arraystretch}{1.2}
- \begin{figure}[]
- \centering
- \centerline{\bf (a). CDR samples}
- \vspace{1.5mm}
- \begin{tabular}{|l|c|c|}
- \hline
- \cline{1-1}
- \underline{\textbf{record-id}} & \textbf{caller-id} & \textbf{callee-id} \\\hline
- 1 & \#user-1 & \#user-2 \\\hline
- 2 & \#user-1 & \#user-4 \\\hline
- 3 & \#user-2 & \#user-1 \\\hline
- 4 & \#user3 & \#user-5\\\hline
- 5 & \#user1 & \#user-2\\\hline
- \vdots & \vdots & \vdots\\\hline
- \end{tabular}
- \vspace{3mm}
- \centering
- \centerline{\bf (b). DTR samples}
- \vspace{1.5mm}
- \begin{tabular}{|l|c|c|c|}
- \hline
- \cline{1-1}
- \textbf{record-id} & \textbf{user-id} & \textbf{online-time} & \textbf{offline-time} \\\hline
- 1 & \#user-1 & \#timestamp-1 & \#timestamp-2 \\\hline
- 2 & \#user-2 & \#timestamp-3 & \#timestamp-4 \\\hline
- 3 & \#user-2 & \#timestamp-5 & \#timestamp-6 \\\hline
- 4 & \#user3 & \#timestamp-7 & \#timestamp-8 \\\hline
- \vdots & \vdots & \vdots &\vdots\\\hline
- \end{tabular}
- \vspace{1.5mm}
- \caption{CDR (Call Detail Records) and DTR (Data Traffic Records) samples.}
- \end{figure}
Excel 转Latex 及tex表格的处理 总结的更多相关文章
- 用 Excel 生成和管理 Markdown 表格--转载
Markdown 作为一种轻量级的标记语言,用来进行简单的文本排版,确实方便快捷.但 Markdown 标记语言的属性,也使得其在表格处理上略显繁琐且不直观.而 Excel 几乎就是表格的代名词,借助 ...
- Excel Interactive View - 让页面表格的功能更强大
MS Office Excel Services提供了一个非常强大的功能,允许你只需要在页面上添加非常少量的JS references,就可以让你在页面上将表格的内容以Excel图表的方式呈现.这里是 ...
- EXCEL中把两列表格里的数字合成一列并且中间用逗号隔开
背景:使用loadrunner做参数化时,往往需要在excel表格中做数据,比如:第一列是用户名,第二列是密码,格式如下: 再将用户名和密码合并成一列,以逗号分隔,需要用到的公式为: =A1& ...
- excel数据复制到html表格<textarea>中
方案一 多行文本框接收到复制的excel值后,在文本框的chage事件中,将excel内容分割到二维数组中,然后填充到html的表格的input或textarea中. 数据格式: 单元格复制后的数据格 ...
- Java使用poi生成Excel,生成两种表格下拉框
想要使用POI操作以xsl结尾的Excel,首先要下载poi相关的jar包,用到的jar有: poi-3.9.jar poi-ooxml-3.9.jar poi-ooxml-schemas-3.9.j ...
- python读取excel文件中所有sheet表格
sales: store: """(1)用load_workbook函数打开excel文件,返回一个工作簿对象 (2)用工作簿对象获取所有的sheet (3)第一个for ...
- latex如何给表格添加注释
在latex中,想给表格添加注释,可以使用threeparttable这个包 代码如下: \usepackage{threeparttable} \begin{table*} \begin{three ...
- excel wps access mysql数据表格的查询之路
简直血崩,最近去做兼职,每天都有大量的表格数据要整理. 开始 还是 用 excel的用起来还算顺畅,慢慢慢慢的发现了各种弊端.大概类似于分组排序什么什么的好多啦~~~不过也确实是用了不到两个小时就能比 ...
- C# 将Excel转为PDF时自定义表格纸张大小
通过后端程序将Excel表格转为PDF格式时,直接转换后的PDF效果可能出现表格页面过小或者过大,导致页面内容分布不均.要改善转换后的文档效果,只需在转换前自定义表格纸张大小,即可调整转换后的PDF页 ...
随机推荐
- 【转】Java并发编程:深入剖析ThreadLocal
来自: http://www.importnew.com/17849.html 想必很多朋友对ThreadLocal并不陌生,今天我们就来一起探讨下ThreadLocal的使用方法和实现原理.首先,本 ...
- PPK谈JS笔记第一弹
以下内容是读书笔记,再一次温习JS好书:PPK谈JS window.load=initializePageaddEventSimple('window','load',function(){}) lo ...
- Cookie无法读取
问题描述:用谷歌调试可以看到,但是用js去读取的时候,一直提示undefined
- css3属性-webkit-font-smoothing
对字体进行抗锯齿渲染可以使字体看起来会更清晰舒服.在图标字体成为一种趋势的今天,抗锯齿渲染使用也越来越多. font-smoothing是非标准的CSS定义.它被列入标准规范的草案中,后由于某些原因从 ...
- hdu[1711]number sequence
Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], .... ...
- alexkn android第一行代码-8.sqlite使用
Android自带sqlite数据库,因此常见操作应该都掌握.包括数据库的创建/升级以及增删改查. 1.创建数据库 public class MyDatabaseHelper extends SQLi ...
- 以moosefs为例介绍iozone的使用方法
一.编译安装 首先到官网下载iozone的稳定版源码 http://www.iozone.org/ 然后解压编译 tar -vxf iozone3_458.tar cd iozone3_458/src ...
- mysql : utf8mb4 的问题
微信呢称和QQ呢称上有很多火星文和emoji表情图片,这些数据,如果直接insert到mysql数据库,一般会报错,设置成utf8都不好使,必须改成utf8mb4编码,这二者的区别见: mysql u ...
- 遭遇input与button按钮背景图失效不显示的解决办法
笔者从事网页前端代码页面工程师已有多年,作为一个网页重构人员常常会遇到一些莫名其妙的DIV+CSS(正确的说法是XHTML+CSS)在 IE.FireFox火狐. 谷歌浏览器CHROME.苹果浏览器S ...
- HTML5的postMessage使用记要
HTML5提出了一个新的用来跨域传值的方法,即postMessage(这个名字太通俗了所以你最好看看是不是自己写过一个同名的把它覆盖了).幸运的是IE8就开始支持了. 我们假设有两个网站,1.com与 ...