加载中…
个人资料
LaTeX_Fun
LaTeX_Fun
  • 博客等级:
  • 博客积分:0
  • 博客访问:20,451
  • 关注人气:2,408
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

latex中不规则表格合并multirow的使用

(2011-05-09 00:25:19)
标签:

latex

multirow

multicolumn

表格

table

分类: 表格制作

QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

选自:http://lc52520.iteye.com/blog/755398

multirow 宏包提供了 \multirow 命令可以在表格中排版横跨两行以上的文本。命令的格式如下:

\multirow{nrows}[bigstructs]{width}[fixup]{text}

nrows   设定所占用的行数。

bigstructs  此为可选项,主要是在你使用了 bigstruct 宏包时使用。

width  设定该栏文本的宽度。如果想让 LaTeX 自行决定文本的宽度,则用 * 即可。

fixup   此为可选项,主要用来调整文本的垂直位置。

text     所要排版的文本。可用 \\ 来强迫换行。

下面是几个例子:


结果如图所示:

           \newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}} 

           \begin{tabular}{|c|c|} 

           \hline 

           \multirow{4}{1in}{Common g text} & Column g2a\\ 

                   & Column g2b \\ 

                   & Column g2c \\ 

                   & Column g2d \\ 

           \hline 

           \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2} 

                   & Column g2b \bigstrut\\\cline{2-2} 

                   & Column g2c \bigstrut\\ 

           \hline 

           \multirow{4}[8]{1in}{Common g text} & Column g2a\bigstrut\\\cline{2-2} 

                   & Column g2b \bigstrut\\\cline{2-2} 

                   & Column g2c \bigstrut\\\cline{2-2} 

                   & Column g2d \bigstrut\\ 

           \hline 

           \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\ 


                   & Column g2b \\ 

                   & Column g2c \\ 

                   & Column g2d \\ 

           \hline 

           \end{tabular}

http://www.ctex.org/documents/packages/images/multirow-1.gif

 

更多的例子:

      

        \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}
 
http://www.ctex.org/documents/packages/images/multirow-2.gif

        \bigstrutjot=1pt%

        \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}

http://www.ctex.org/documents/packages/images/multirow-3.gif


  \begin{tabular}{|l|l|l|l|}

        \hline \multirow{4}{2cm}{This is a demo table} & C2a &

        \multirow{4}[30]{2cm}{This is another one} & C4a\\

                & C2b & & C4b\\

                & C2c & & C4c\\

                & C2d & & C4d\\

        \hline

        \end{tabular}

http://www.ctex.org/documents/packages/images/multirow-4.gif

 


       \begin{tabular}{|l|l|l|l|}

        \hline \multirow{4}{2cm}{This is a demo table} & C2a &

        \multirow{4}{2cm}[30pt]{This is another one} & C4a\\

                & C2b & & C4b\\

                & C2c & & C4c\\

                & C2d & & C4d\\

        \hline

        \end{tabular}

http://www.ctex.org/documents/packages/images/multirow-5.gif

 


         \begin{tabular}{|l|l|l|l|}

        \hline \multirow{4}{2cm}{This is a demo table} & C2a &

        \multirow{4}[30]{2cm}[-30pt]{This is another one} & C4a\\

                & C2b & & C4b\\

                & C2c & & C4c\\

                & C2d & & C4d\\

        \hline 

        \end{tabular}
 
http://www.ctex.org/documents/packages/images/multirow-6.gif

 

有关 multirow 宏包更详细的说明,可参见它的说明文档(英文 PDF 格式)

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有