zoukankan      html  css  js  c++  java
  • {Notes}{Latex}{multirow}

    这个文章写的真的太牛比了!

    ============================================================

    在latex文件最前面用这个包usepackage{multirow}

    multirow 宏包提供了 multirow 命令可以在表格中排版横跨两行以上的文本。命令的格式如下:

    multirow{nrows}[bigstructs]{width}[fixup]{text}

    nrows   设定所占用的行数。

    bigstructs  此为可选项,主要是在你使用了 bigstruct 宏包时使用。

    width  设定该栏文本的宽度。如果想让 LaTeX 自行决定文本的宽度,则用 * 即可。

    fixup   此为可选项,主要用来调整文本的垂直位置。

    text     所要排版的文本。可用 \ 来强迫换行。

    更多介绍与实例:http://www.ctex.org/documents/packages/table/multirow.htm

    补充例子1: http://blog.sina.com.cn/s/blog_5e16f1770100u40t.html

           
            
    enewcommand{multirowsetup}{centering}  
            egin{tabular}{|l|l|l|l|} 
            hline  
            multirow{4}{2cm}{This is a demo table}  
                    & C2a & 
            multirow{4}{2cm}{This is another one} & C4a\ 
                    & C2b &  & C4b\ 
                    & C2c &  & C4c\ 
                    & C2d & & C4d\ 
            hline 
            end{tabular} 
      



    补充例子2:http://jhengjyun.blogspot.fr/2011/01/latexmulticolumnmultirow.html
    通常畫表格需要使用到multicolumn, multirow, hline, cline四種指令
    其中要使用multirow,必須在前頭先行加入usepackage{multirow}
    直接看例子,Latex程式碼 =>
    de style="" >egin{tabular}{|c|c|c|c|c|}
    hline
    multirow{2}{*}{Multi-Row}&
    multicolumn{2}{c|}{Multi-Column}&
    multicolumn{2}{c|}{multirow{2}{*}{Multi-RowandCol}} \
    cline{2-3}
      & column-1& column-2& multicolumn{2}{c|}{} \
    hline
    label-1& label-2& label-3& label-4& label-5 \
    hline
    end{tabular}de>
    顯示結果 =>
    LaTex 制作表格 合并行multirow  合并列multicolumn - 百年万里 - 百年萬裏








    补充个例子3:http://blog.sina.com.cn/s/blog_5e16f1770100h6jl.html

    使用宏包multirow,提供了如下命令:参看http://www.ctan.org/tex-archive/macros/latex/contrib/multirow/
    效果图:
    LaTeX技巧286:表格合并行的绘制技巧

    演示代码:
    documentclass{article}
    usepackage{longtable}
    usepackage{rotating}
    usepackage{multirow}
    egin{document}
    egin{longtable}{| c | c | c | c 

    | c | c |}
        hline
        & multicolumn{5}{| c |}{ } \
        & multicolumn{5}{| c |}{ extbf{large Father's Occupation}} \
        & multicolumn{5}{| c |}{ } \
        hline
        & & & & & \
        multicolumn{1}{|c|}{ extbf{}}
        &  multicolumn{1}{|c|}{ extbf{}}
        &  multicolumn{1}{c|}{ extbf{Group A}}
        &  multicolumn{1}{c|}{ extbf{Group B}}
        &  multicolumn{1}{c|}{ extbf{Group C}}
        &  multicolumn{1}{c|}{ extbf{Group D}} \
        & & & & & \
         cline{2-6}
        & & & & & \
        multirow{5}{*}{egin{sideways}{ extbf{large Mother's Occupation}}end{sideways}}
        &   extbf{Group A}   &   $8$      &   $3$      &   $4$      &   $1$   \
        & & & & & \
        cline{2-6}
        & & & & & \
       &   extbf{Group B}   &   $3$      &   $3$      &   $0$      &   $1$   \
        & & & & & \
         cline{2-6}
        & & & & & \
        &   extbf{Group C}   &   $0$      &   $0$      &   $1$      &   $0$   \
        & & & & & \
         cline{2-6}
        & & & & & \
        &   extbf{Group D}   &   $2$      &   $0$      &   $0$      &   $1$   \
        & & & & & \
        hline
        & & & & & \
        &   extbf{Total:}      &   extbf{26}   &   extbf{10}   &   extbf{10}   &   extbf{4}    \
        & & & & & \
        hline
        end{longtable}
      
      
        end{document}

  • 相关阅读:
    《Cracking the Coding Interview》——第2章:链表——题目5
    《Cracking the Coding Interview》——第2章:链表——题目4
    《Cracking the Coding Interview》——第2章:链表——题目3
    《Cracking the Coding Interview》——第2章:链表——题目2
    《Cracking the Coding Interview》——第2章:链表——题目1
    《Cracking the Coding Interview》——第1章:数组和字符串——题目8
    《Cracking the Coding Interview》——第1章:数组和字符串——题目7
    extern 用法,全局变量与头文件(重复定义)
    关于#ifdef #ifndef
    C语言中extern的用法
  • 原文地址:https://www.cnblogs.com/lvpengms/p/3360445.html
Copyright © 2011-2022 走看看