Latex:表格制作全攻略

Posted by 冰河 at 16:29 Add comments 82,056 Views
212010

给出一个制作复杂表格的例子,制作表格主要用到multicolumn,multirow和cline,其中,要使用multirow,必须usepackage{multirow}

如果要制作出如下图所示的表格:

Latex表格制作全攻略

则可以通过如下的代码:

\begin{table*}

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

hline hline

multirow{2}{*}{Multi-Row} & multicolumn{2}{|c|}{Multi-Column} & multicolumn{2}{|c|}{multirow{2}{*{Multi-Row and Col}} \

cline{2-3}

& column-1 & column-2 & multicolumn{2}{|c|}{} \

hline

label-1 & label-2 & label-3 & label-4 & label-5 \

hline

end{tabular}

end{table*}

其中,multirow{2}{*}{text}的第一个参数表示行的数目,*表示由系统自动调整文字,text表示要写入的文字

multicolumn与multicolumn类似,功能是跨多列, multicolumn{2}{|c|}{text}表示跨2行,文字采用中心对齐的方式,text是要写入的文字。

multicolumn和multirow可以组合使用,跨多行多列,只需要将multirow作为multicolumn的text即可。

最后,cline用于画横线 cline{i-j}表示从第i列画到第j列。

hline画一整条横线。

multicolumn使用比较简单,因为latex的表格本来就是按行组织的。下面附上multirow的使用文档:

http://www.ctex.org/documents/packages/table/multirow.htm

相关日志

8 Responses to “Latex:表格制作全攻略”

  1. 表格的标题怎么做?
    每次我的标题是这样的:
    Table 1
    NOTATION

    可我希望是
    Table 1: NOTATION
    请楼主赐教。 QQ 364956405

  2. 几天没更新了这是

  3. Linux下的搞不懂

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Protected by WP Anti Spam
© 2009 - 2024 冰河的博客