首页 > 其他 > 详细

Latex 表格内文字过长自动换行

时间:2015-04-30 13:49:23      阅读:717      评论:0      收藏:0      [点我收藏+]

法一:

  1. \begin{tabular}{m{5cm}}  

法二:

  1. \begin{tabular}{p{0.9\columnwidth}}  
 法三:multirow 宏包
 
  \multirow{nrows}[bigstructs]{width}[fixup]{text}  

 

  1.  nrows      设定所占用的行数。
  2. bigstructs      此为可选项,主要是在你使用了 bigstruct 宏包时使用。
  3. width      设定该栏文本的宽度。如果想让 LaTeX 自行决定文本的宽度,则用 * 即可。
  4. fixup      此为可选项,主要用来调整文本的垂直位置。
  5. text      所要排版的文本。可用 \\ 来强迫换行。

 

法四:

 

 
  1. /newcommand{/tabincell}[2]{/begin{tabular}{@{}#1@{}}#2/end{tabular}}  
然后使用&/tabincell{c}{}&就可以在表格中自动换行

 

比如这么用

 

  1. /begin{tabular}{|c|c|}  
  2. /hline  
  3.  1 & the first line //  
  4. /hline  
  5.  2 & /tabincell{c}{haha// heihei//zeze} //  
  6. /hline  
  7. /end{tabular}  
 
  1. /begin{tabular}{|c|c|}  
  2. /hline  
  3.  1 & the first line //  
  4. /hline  
  5.  2 & /tabincell{c}{haha// heihei//zeze} //  
  6. /hline  
  7. /end{tabular}  

Latex 表格内文字过长自动换行

原文:http://www.cnblogs.com/zhaoyang10/p/4468563.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!