• LaTeX中表格多行显示的最简单设置方法


    这事实上是一个非常easy的问题,可是这两天发现我之前的解决方式太麻烦了。简介一下这样的最简单的方法:

    之前设置多行显示的时候,用类似于以下这样的方法进行多行显示:

    egin{table}
    
    ewcommand{	abincell}[2]{egin{tabular}{@{}#1@{}}#2end{tabular}}
      centering
      egin{tabular}{|c|c|c|}
            hline
                	abincell{c}{1\2\3\4\5} &
                	abincell{c}{1\2\3\4\5} &
                	abincell{c}{1\2\3\4\5}
                \
            hline
        end{tabular}
    end{table}

    可是这样的方法有个问题,有时候我们并不知道单元格在什么时候应该换行(比如单元格里有非常多文字,可是非常难精确地把这些文字划分到每一行中,这时候用以下这样的方法,能够让LaTeX自己主动分行:

    egin{table}
      centering
      egin{tabular}{|c|p{3cm}|}
            hline a & bbb\
            hline a & This is a very long sentence that may exceed the bound of this table.\
            hline
      end{tabular}
    end{table}

    用p{3cm}这样的方法限制了第二列的最大宽度。就这么简单的经验,记录一下。





  • 相关阅读:
    python:xlrd模块
    psql:转:会引起全表扫描的10种sql语句
    Linux相关
    面试题
    Siege Web服务器性能压力测试工具
    Nginx+uWSGI+Supervisor配置
    SQLAlchemy
    Virtualenv创建虚拟环境
    算法
    Mac常用快捷键
  • 原文地址:https://www.cnblogs.com/yxwkf/p/4088978.html
Copyright © 2020-2023  润新知