LaTex表格内单元格内容强制换行
2015-09-08 16:38
786 查看
/newcommand{/tabincell}[2]{/begin{tabular}{@{}#1@{}}#2/end{tabular}}%放在导言区
%然后使用&/tabincell{c}{}&就可以在表格中自动换行
%比如这么用
/begin{tabular}{|c|c|}
/hline
1 & the first line //
/hline
2 & /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|}\hline
1 & \tabincell{c}{the first line \\ the next\\the next\\ last} & \tabincell{c}{one \\ one}\\\hline
2 & \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
/newcommand{/tabincell}[2]{/begin{tabular}{@{}#1@{}}#2/end{tabular}}%放在导言区
%然后使用&/tabincell{c}{}&就可以在表格中自动换行
%比如这么用
/begin{tabular}{|c|c|}
/hline
1 & the first line //
/hline
2 & /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|}\hline
1 & \tabincell{c}{the first line \\ the next\\the next\\ last} & \tabincell{c}{one \\ one}\\\hline
2 & \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
相关文章推荐
- UI 设计师提供 iOS 字体和长度应当用什么单位
- Redis在Java中的使用
- PDO多种方式取得查询结果
- 0.3.1 设计原则知多少
- 关于Qt在子线程中使用QMessageBox的折衷方法
- 用python画xy散点图
- winform中隐藏窗体边框
- 原生JS写toggleclass方法
- java中的内部类总结
- LeetCode || Maximal Square
- NIO框架之MINA源码解析(四):粘包与断包处理及编码与解码
- html5培训课程培训 顺利完成获得宝贵财富
- 调整cell的间距
- C#委托与事件
- HTML5+NodeJs实现WebSocket即时通讯
- 不同语言的Unix时间戳
- href="javascript:void(0)"
- react-native试玩(32)-推送通知API
- mysql主从复制
- 从零开始自学Swift(一)