{Notes}{Latex}{multirow}
这个文章写的真的太牛比了!
============================================================
在latex文件最前面用这个包\usepackage{multirow}
multirow 宏包提供了 \multirow 命令可以在表格中排版横跨两行以上的文本。命令的格式如下:
\multirow{nrows}[bigstructs]{width}[fixup]{text}
nrows 设定所占用的行数。
bigstructs 此为可选项,主要是在你使用了 bigstruct 宏包时使用。
width 设定该栏文本的宽度。如果想让 LaTeX 自行决定文本的宽度,则用 * 即可。
fixup 此为可选项,主要用来调整文本的垂直位置。
text 所要排版的文本。可用 \\ 来强迫换行。
更多介绍与实例:http://www.ctex.org/documents/packages/table/multirow.htm
补充例子1: http://blog.sina.com.cn/s/blog_5e16f1770100u40t.html
\renewcommand{\multirowsetup}{\centering}
\begin{tabular}{|l|l|l|l|}
\hline
\multirow{4}{2cm}{This is a demo table}
& C2a &
\multirow{4}{2cm}{This is another one} & C4a\\
& C2b & & C4b\\
& C2c & & C4c\\
& C2d & & C4d\\
\hline
\end{tabular}
补充例子2:http://jhengjyun.blogspot.fr/2011/01/latexmulticolumnmultirow.html
通常畫表格需要使用到\multicolumn, \multirow, \hline, \cline四種指令
其中要使用\multirow,必須在前頭先行加入\usepackage{multirow}
直接看例子,Latex程式碼 =>
de style="" >\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{Multi-Row}&
\multicolumn{2}{c|}{Multi-Column}&
\multicolumn{2}{c|}{\multirow{2}{*}{Multi-RowandCol}} \\
\cline{2-3}
& column-1& column-2& \multicolumn{2}{c|}{} \\
\hline
label-1& label-2& label-3& label-4& label-5 \\
\hline
\end{tabular}de>
顯示結果 =>
补充个例子3:http://blog.sina.com.cn/s/blog_5e16f1770100h6jl.html
使用宏包multirow,提供了如下命令:参看http://www.ctan.org/tex-archive/macros/latex/contrib/multirow/
效果图:
演示代码:
\documentclass{article}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{multirow}
\begin{document}
\begin{longtable}{| c | c | c | c
| c | c |}
\hline
& \multicolumn{5}{| c |}{ } \\
& \multicolumn{5}{| c |}{\textbf{\large Father's Occupation}} \\
& \multicolumn{5}{| c |}{ } \\
\hline
& & & & & \\
\multicolumn{1}{|c|}{\textbf{}}
& \multicolumn{1}{|c|}{\textbf{}}
& \multicolumn{1}{c|}{\textbf{Group A}}
& \multicolumn{1}{c|}{\textbf{Group B}}
& \multicolumn{1}{c|}{\textbf{Group C}}
& \multicolumn{1}{c|}{\textbf{Group D}} \\
& & & & & \\
\cline{2-6}
& & & & & \\
\multirow{5}{*}{\begin{sideways}{\textbf{\large Mother's Occupation}}\end{sideways}}
& \textbf{Group A} & $8$ & $3$ & $4$ & $1$ \\
& & & & & \\
\cline{2-6}
& & & & & \\
& \textbf{Group B} & $3$ & $3$ & $0$ & $1$ \\
& & & & & \\
\cline{2-6}
& & & & & \\
& \textbf{Group C} & $0$ & $0$ & $1$ & $0$ \\
& & & & & \\
\cline{2-6}
& & & & & \\
& \textbf{Group D} & $2$ & $0$ & $0$ & $1$ \\
& & & & & \\
\hline
& & & & & \\
& \textbf{Total:} & \textbf{26} & \textbf{10} & \textbf{10} & \textbf{4} \\
& & & & & \\
\hline
\end{longtable}
\end{document}
{Notes}{Latex}{multirow}的更多相关文章
- {Notes}{LaTeX}{enumerate}
\usepackage{enumerate} \begin{enumerate}{(1)} \setcounter{enumi}{2} % begin with 2 \item first \item ...
- CASthesis 模板编译的问题
使用CASthesis模板(https://github.com/xiaoyao9933/UCASthesis,介绍里说这个版本是在ThuThesis的基础上修改的),自带的说明如下. 使用须知 == ...
- [旧版] CASthesis 模板编译的问题
写在前面的话:国科大最新版的模板在这里(https://github.com/mohuangrui/ucasthesis),利用它来写博后出站报告的相关介绍在这里: 本篇博文是针对另一个模板进行介绍的 ...
- Pandas高级教程之:自定义选项
目录 简介 常用选项 get/set 选项 经常使用的选项 最大展示行数 超出数据展示 最大列的宽度 显示精度 零转换的门槛 列头的对齐方向 简介 pandas有一个option系统可以控制panda ...
- LaTex 制作表格 合并行\multirow 合并列\multicolumn
在latex文件最前面用这个包\usepackage{multirow} multirow 宏包提供了 \multirow 命令可以在表格中排版横跨两行以上的文本.命令的格式如下: \multirow ...
- Latex Notes
latex Table of Contents 1. Presentation/Slides with Beamer 2. Drawing in LaTex With TikZ 3. Tracked ...
- Latex 的Table使用multirow and multicolumn
Here are some tips: Use a \multicolumn{1}{|l}{} & \multicolumn{2}{l|}{...} construct; Add anothe ...
- Note | LaTeX
目录 一.TeX家族 1. TeX - LaTeX 2. pdfTeX - pdfLaTeX 3. XeTeX - XeLaTeX 4. CTeX - MiKTeX - TeX Live 二.入门 1 ...
- TeXstudio 编写Latex论文的若干问题
TeXstudio 编写Latex论文的若干问题解决方案总结 问题1: 如何安装TeXstudio 以及 Texstudio当中的中文字体使用问题. 一.如何安装TeXstudio 很 ...
随机推荐
- stdclass
$item = new stdClass(); $item->goods_id = $item_goods->getID(); $item->goods_name ...
- exit()子程序终止函数与return()函数的差别
在main函数中我们通常使用return (0);这样的方式返回一个值. 但这是限定在非void情况下的也就是void main()这样的形式. exit()通常是用在子程序中用来终结程序用的,使用后 ...
- JS返回一个数据的千分位格式
/** * 价钱转换-从右往左每3位数字加一个逗号 * @param price 需要转换的价格 */ formatPrice(price){ var newPrice = price.split(' ...
- Testing shell commands from Python
如何测试shell命令?最近,我遇到了一些情况,我想运行shell命令进行测试,Python称为万能胶水语言,一些自动化测试都可以完成,目前手头的工作都是用python完成的.但是无法从Python中 ...
- 【Error】:10061由于目标计算机积极拒绝,无法连接
之前Windows上连接mongodb的时候首先用mongod.exe启动程序之后,用mongo.exe来连接数据库.但是在连接的时候,出现如下错误: error:10061 由于目标计算机积极拒绝, ...
- Marketing™Series用户手册(Marketing™Series Manual)
起源(Origin) 每日构建(Daily Build) 软件不支持的功能(Functions which are not supported.) 软件支持的功能(Functions which ar ...
- LeetCode OJ:Swap Nodes in Pairs(成对交换节点)
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2-&g ...
- Python3的第一个程序(三)
现在,了解了如何启动和退出Python的交互式环境,我们就可以正式开始编写Python代码了. 在写代码之前,请千万不要用“复制”-“粘贴”把代码从页面粘贴到你自己的电脑上.写程序也讲究一个感觉,你需 ...
- 多网卡下,vlc发送IGMP组播报告包
这两天测试IGMP遇到一个问题,环境描述如下: 我的vlc客户端安装在windows下,该PC有两张网卡,本地连接1接公司网,本地链接2 接路由器.wireshark坚挺本地链接2,以测试路由的IGM ...
- Linux下的软件的安装
一.yum相关介绍及命令 [1] 用来管理软件的一个命令.通过该命令完成对软件的下载.卸载等操作. [2] 命令:(必须在yum搭建成功后才能正常运行) yum clean all 清楚 ...