Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. documentclass{article}
  2.  
  3. usepackage{array}
  4. usepackage[table]{xcolor}
  5. usepackage{longtable}
  6.  
  7. % Before starting give a little space:
  8. setlengthminrowclearance{2pt}
  9.  
  10. % This example shows rather poor taste but is quite colourful! Inspect the source
  11. % file, colortbl.dtx, to see the full code for the example, but it uses the following
  12. % column types.
  13.  
  14. newcolumntype{A}{%
  15. >{color{white}columncolor{red}[.5tabcolsep]%
  16. raggedright}%
  17. p{2cm}}
  18.  
  19. newcolumntype{B}{%
  20. >{columncolor{blue}[.5tabcolsep]%
  21. color{yellow}raggedright}
  22. p{3cm}}
  23.  
  24. newcolumntype{C}{%
  25. >{columncolor{yellow}[.5tabcolsep]}%
  26. D{.}{cdot}{3.3}}
  27.  
  28. newcolumntype{E}{%
  29. >{largebfseries
  30. columncolor{cyan}[.5tabcolsep]}c}
  31.  
  32. newcolumntype{F}{%
  33. >{color{white}
  34. columncolor{magenta}[.5tabcolsep]}c}
  35.  
  36. newcolumntype{G}{%
  37. >{columncolor[gray]{0.8}[.5tabcolsep][tabcolsep]}l}
  38.  
  39. newcolumntype{H}{>{columncolor[gray]{0.8}}l}
  40.  
  41. newcolumntype{I}{%
  42. >{columncolor[gray]{0.8}[tabcolsep][.5tabcolsep]}%
  43. D{.}{cdot}{3.3}}
  44.  
  45.  
  46. begin{document}
  47.  
  48. % The code below is directly extracted from colortbl.dtx
  49. % http://tug.ctan.org/macros/latex2e/contrib/colortbl/colortbl.dtx
  50.  
  51. begin{longtable}{ABC}
  52. multicolumn{3}{E}{A long table example}\
  53. multicolumn{2}{F}{First two columns}&
  54. multicolumn{1}{F}{Third column}\
  55. multicolumn{2}{F}{p-type}&
  56. multicolumn{1}{F}{D-type (textsf{dcolumn})}endfirsthead
  57. multicolumn{3}{E}{A long table example (continued)}\
  58. multicolumn{2}{F}{First two columns}&
  59. multicolumn{1}{F}{Third column}\
  60. multicolumn{2}{F}{p-type}&
  61. multicolumn{1}{F}{D-type (textsf{dcolumn})}endhead
  62. multicolumn{3}{E}{Continuedldots}endfoot
  63. multicolumn{3}{E}{The End}endlastfoot
  64. P-column&and another one&12.34\
  65. multicolumn{1}{G}{Total}&
  66. multicolumn{1}{H}{(wrong)}&
  67. multicolumn{1}{I}{100.6}\
  68. Some long text in the first column&bbb&1.2\
  69. aaa&and some long text in the second column&1.345\
  70. multicolumn{1}{G}{Total}&
  71. multicolumn{1}{H}{(wrong)}&
  72. multicolumn{1}{I}{100.6}\
  73. aaa&bbb&1.345\
  74. Note that the coloured rules in all columns stretch to accomodate
  75. arge entries in one column. &bbb&1.345\
  76. aaa&bbb&100\
  77. aaa&Depending on your driver you may get unsightly gaps or lines
  78. where the `screens' used to produce different shapes interact
  79. badly. You may want to cause adjacent panels of the same colour by
  80. specifying a larger overhang
  81. or by adding some negative space (in a "noalign" between rows.&12.4\
  82. aaa&bbb&45.3\
  83. end{longtable}
  84.  
  85.  
  86. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement