Latex排版——表格插入

时间:2021-09-15 06:05:35

Latex排版——表格插入

 Latex排版——表格插入(2010-07-16 12:35:44)

http://blog.sina.com.cn/s/blog_57235cc70100jnpo.html
Latex排版——表格插入转载
标签: 

latex

 

tabel

 

杂谈

分类: 办公与排版

%看以下代码: 表格单元格内强制换行


\documentclass{article}
\begin{document}


Structural Health Monitoring (SHM) is a fast-developing, interdisciplinary field of research due to the fact that SHM is heavily stimulated by the engineering problems of maintenance and safe operation of technical infrastructure.
$$\sum_{i=1}^{n}$$
The core problem of SHM is the damage identification, which can be divided into five levels

%表格
\begin{table}[tbp]
\centering  % 表居中
\begin{tabular}{lccc}  % {lccc} 表示各列元素对齐方式,left-l,right-r,center-c
\hline
Player &Round 1 &Round 2 &Round 3\\ \hline  % \hline 在此行下面画一横线
Dave &89 &91 &88\\         % \\ 表示重新开始一行
Don &102 &105 &99\\        % & 表示列的分隔线
Todd &153 &256 &357\\ \hline
\end{tabular}
\caption{Through three rounds at the Muni.}
\end{table}
%结束

1) detection of damage existence; 2) localization of damage; 3) identification of damage type; 4) quantification of damage extent; and 5) damage prognosis.


\end{document}

 

%编译后如下格式

Latex排版——表格插入

%将红色代码 tbp 改为 htbp, 编译后显示为

Latex排版——表格插入





=====================================================================================================================


/newcommand{/tabincell}[2]{/begin{tabular}{@{}#1@{}}#2/end{tabular}}%放在导言区%然后使用&/tabincell{c}{}&就可以在表格中自动换行%比如这么用/begin{tabular}{|c|c|}/hline1 & the first line ///hline2 & /tabincell{c}{haha// heihei//zeze} ///hline/end{tabular}以下为一例子,可直接存为.tex文件编译运行:\documentclass[a4paper,12pt]{article}\begin{document}\begin{table}\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}  \centering  \begin{tabular}{|c|c|c|}\hline1 & \tabincell{c}{the first line \\ the next\\the next\\ last} & \tabincell{c}{one \\ one}\\\hline2 & \tabincell{c}{hello\\ aha\\ ok \\yes \\en} & \tabincell{c}{two \\ two \\ two} \\\hline\end{tabular}  \caption{longtitle}\end{table}\end{document}结果如下图:

http://blog.sina.com.cn/s/blog_531bb7630101841e.html