我是安卓手机,我用2018微信分身版官方版注册了一个新的微信,搜索附近人我能看见

用户名:AchengCug
文章数:43
访问量:42715
注册日期:
阅读量:1297
阅读量:3317
阅读量:427255
阅读量:1115384
51CTO推荐博文
除了使用multirow的方式(比较麻烦),更好地办法是用下面的语句,可以使得一个单元格中显示多行,再配合其它格式语句,就能使得表格非常美观。\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}下面一个比较综合的例子:\begin{table*}[htbp]\centering\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}\caption{XXXXXXX}\begin{tabular}{|m{0.5cm}&{\centering}|m{2.5cm}&{\centering}|m{1.5cm}&{\centering}|m{1.5cm}&{\centering}|m{1.5cm}&{\centering}|m{1.5cm}&{\centering}|m{1.5cm}&{\centering}|}\hline\multicolumn{2}{|m{3cm}&{\centering}|}{Test instance}&Number of the decision variables &The decision space &Number of the linear equations &Number of the nonlinear equations &Number of the optimal solutions\\\hlineF1 &\tabincell{l}{equ1 \\ equ2} &2 &2 &2 &2 &2 \\\hlineF1 & & & & & & \\\hlineF2 & & & & & & \\\hlineF3 & & & & & & \\\hlineF4 & & & & & & \\\hlineF5 & & & & & & \\\hlineF6 & & & & & & \\\hlineF7 & & & & & & \\\hline\end{tabular}\end{table*}最终效果如图:本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)LaTeX 表格的处理 [转] - 龙豆 - 博客园
随笔 - 284, 文章 - 0, 评论 - 43, 引用 - 0
[转] http://space./u1/ryang/latex-table.html
LaTeX 表格的处理
LaTeX 表格处理概述一般三线表的处理带表格注释的三线表固定列宽和自动伸缩列宽固定列宽与对齐方式自动伸缩列宽跨页表格表格旋转和后置表格旋转表格后置辅助转换工具
LaTeX 表格处理概述
与 word 不同,LaTeX 通过一定的语法规则将表格写成纯文本形式。基本规则包括:表格从上到下,每一行从左到右,单元格内容使用 & 分隔,用 \\ 换行。最基本的表格环境是 tabular 环境。下面是一个简单的表格代码和实际效果:
\begin{tabular}[t]{l|c}
姓名 & 年龄 \\
张三 & 32 \\
李四 & 12 \\
王五 & 24 \\
\end{tabular}
一般三线表的处理
学术论文普遍使用三线表。三线表的特点主要是:整个表格通常只有三条横线,首尾两条横线较粗,中间一条较细,一般不使用竖线。LaTeX 处理三线表相当简单方便。用到的宏包主要是 booktabs 。下面是普通三线表的代码和效果:
\begin{table}[htbp]
\caption{\label{tab:test}示例表格}
\begin{tabular}{lcl}
姓名 & 年龄 & 地址\\
张三 & 32 & 中华人民共和国\\
李四 & 12 & 中华人民共和国\\
王五 & 24 & 中华人民共和国\\
\bottomrule
\end{tabular}
\end{table}
带表格注释的三线表
三线表有时候还需要加上注释以便给出表格的资料来源等信息。解决这一问题可以使用下面三个办法之一:
使用 ctable 宏包。该宏包用法简单,下面是典型代码和效果:
caption=The Skewing Angles,
label=tab:nowidth,
{\tnote{for the abstraction reaction,
$Mu+HX \rightarrow MuH+X$.}
\tnote[b]{1 degree${} = \pi/180$ radians.}
\tnote[c]{this is a particularly long note, showing that footnotes
are set in raggedright mode as we don't like hyphenation
in table footnotes.}
{\FL & $H(Mu)+F_2$ & $H(Mu)+Cl_2$ \ML
$\beta$(H) & $80.9$\tmark[b] & $83.2$ \NN
$\beta$(Mu) & $86.7$ & $87.7$ \LL
使用 threeparttable 宏包。下面是典型代码和效果:
\begin{table}[htbp]
\centering\small
\begin{threeparttable}
\caption{\label{tab:results}Effect of Trade Openness on
Environment (Air Pollution)}
\begin{tabular}{lccc}
$\ln(y/pop)$ &
(121.79) &
(118.81) &
(336.19) \\
$\ln(y/pop)^2$ &
$-$22.85* &
$-$16.58* &
$-$35.57** \\
(19.06) \\
$(X+M)/Y$ &
$-$.29** &
$Polity$ &
$-$3.20* &
$-$6.58* &
$-$6.70** \\
$\ln(LandArea/pop)$ &
$-$2.92* &
$-$13.02* \\
\bottomrule
\end{tabular}
Note: Robust standard errors in parentheses. Intercept
included but not reported.
\begin{tablenotes}
\item[*] significant at 5\% level
\item[**] significant at 10\% level
\end{tablenotes}
\end{threeparttable}
\end{table}
固定列宽和自动伸缩列宽
有时三线表需要固定某列的列宽,或者指定整个表格的总宽度,指定某几列自动伸缩。
固定列宽与对齐方式
固定列宽可以使用 array 宏包的 p{2cm} 系列命令,如果需要指定水平对齐方式,可以使用下面的形式 &{\centering}p{2cm} 实现,但如果使用这种方式,缺省情况下不能使用 \\ 换行,需要使用 \tabularnewline 代替。为了仍然使用 \\ 换行,需要在导言区加上下面的代码:
\usepackage{array}
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\newcolumntype{C}[1]{&{\PreserveBackslash\centering}p{#1}}
\newcolumntype{R}[1]{&{\PreserveBackslash\raggedleft}p{#1}}
\newcolumntype{L}[1]{&{\PreserveBackslash\raggedright}p{#1}}
使用 C{3cm} 命令即可指定该列宽度为 3cm,并且文字居中对齐,左对齐和右对齐命令分别是 L{2cm} 和 R{2cm}。
下面是一个的例子:
\begin{table}[htbp]
\centering\caption{\label{tab:test}2000 和~2004 年中国制造业产品的出口份额}
\begin{tabular}{l*{2}{R{2cm}}}
& 2000 & 2004 \\
钢铁 & 3.1 & 5.2 \\
化学制品 & 2.1 & 2.7 \\
办公设备及电信设备 & 4.5 & 15.2 \\
汽车产品 & 0.3 & 0.7 \\
纺织品 & 10.4 & 17.2 \\
服装 & 18.3 & 24\\
\bottomrule
\end{tabular}
\end{table}
自动伸缩列宽
使用 tabularx 宏包可以实现自动伸缩列宽。下面是一个简单的例子。与普通的 tabular 环境不同之处在于:(1)需要指定整个表格的总宽度;(2)需要用 X 指定至少一列为自动伸缩列。
\begin{table}[htbp]
\centering\caption{\label{tab:test}2000 和~2004 年中国制造业产品的出口份额}
\begin{tabularx}{10cm}{Xrr}
& 2000 & 2004 \\
钢铁 & 3.1 & 5.2 \\
化学制品 & 2.1 & 2.7 \\
办公设备及电信设备 & 4.5 & 15.2 \\
汽车产品 & 0.3 & 0.7 \\
纺织品 & 10.4 & 17.2 \\
服装 & 18.3 & 24\\
\bottomrule
\end{tabularx}
\end{table}
普通的表格不能跨页。如果需要跨页表格,需要使用 longtable 或 supertabular 等宏包。此处以 longtable 为主介绍。
下面是一个例子。
\begin{longtable}{p{1.2cm}p{8cm}p{5cm}}
\caption{\label{tab:test}WTO 英语缩写}\\
缩写 & 原\hspace{1em}文 & 解\hspace{1em}释\\
\endfirsthead
{\bf 续表~\ref{tab:test}}\\
缩写 & 原\hspace{1em}文 & 解\hspace{1em}释\\
\bottomrule
\endlastfoot
WTO & World Trade Organization & 世界贸易组织\\
TRIMs & Trade-Related Investment Measures & 与贸易有关的投资措施\\
TPR & Trade Policy Review & 贸易政策审议\\
\end{longtable}
表格旋转和后置
如果表格过宽,可以将表格旋转 90 度横放。使用 rotating 宏包即可实现此功能。与普通表格的不同之处是:需要将 table 环境替换成 sidewaystable 环境。
使用 endfloat 宏包可以将文章中的所有图表置于文章末尾,以满足某些杂志的排版要求。
辅助转换工具
calc2latex 或 excel2latex 可以将电子表格文件数据转换为 latex 表格。
dat2latex.pl 这是 perl 脚本,可将 gnuplot 的文本数据文件转换为 latex 表格。点击此处下载。你正在使用的浏览器版本过低,将不能正常浏览和使用知乎。

我要回帖

更多关于 2018微信分身版官方版 的文章

 

随机推荐