如何让latex表格中一个单元格的文字换行(转)
2010-09-07 17:32
826 查看
问题:如何同时让表格同一行一个单元格的文字能垂直居中?比如说文字超长超出页面范围需要分行显示
答:(来源于smth)
方案一:
/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}
/usepackage{CJK}
/begin{document}
/begin{CJK*}{GBK}{song}
/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 //fgf
//asgr
} //
/hline
/end{tabular}
/end{CJK*}
/end{document}
方案二:
/usepackage{longtable}
转自:http://raulbatigoal.blog.hexun.com/5505084_d.html
答:(来源于smth)
方案一:
/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}
/usepackage{CJK}
/begin{document}
/begin{CJK*}{GBK}{song}
/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 //fgf
//asgr
} //
/hline
/end{tabular}
/end{CJK*}
/end{document}
方案二:
/usepackage{longtable}
转自:http://raulbatigoal.blog.hexun.com/5505084_d.html
相关文章推荐
- [转] 如何让latex表格中一个单元格的文字换行(转)
- Latex 表格内文字过长自动换行 & 表格内单元格内容强制换行
- 如何用latex画一个简单的表格
- 01-如何在Excel表的同一个单元格中换行?
- 如何在excel for mac os中的一个单元格输入换行?
- 如何把表格内的文字强制换行
- 如何实现表格中文字的强制换行
- 如何使HTML中的元素TABLE的表格文字不换行
- LaTex表格内单元格内容强制换行
- excel中如何在一个单元格中输入多行文字
- LaTex表格内单元格内容强制换行
- 今天看了页面单元格内文字换行就找了下,如何不设置宽度,不换行
- CSS中如何实现表格文字的换行
- LaTeX技巧374:如何在指定列宽的表格里实现文字居中
- Latex 表格内文字过长自动换行
- LaTex表格内单元格内容强制换行
- Latex 表格内文字过长自动换行
- Latex 表格内文字过长自动换行
- latex中如何使表格被文字环绕
- LaTex表格内单元格内容强制换行