您的位置:首页 > 其它

LaTex表格内单元格内容强制换行

2014-10-16 10:13 120 查看
/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
来自为知笔记(Wiz)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: