Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{array}
- usepackage[table]{xcolor}
- usepackage{longtable}
- % Before starting give a little space:
- setlengthminrowclearance{2pt}
- % This example shows rather poor taste but is quite colourful! Inspect the source
- % file, colortbl.dtx, to see the full code for the example, but it uses the following
- % column types.
- newcolumntype{A}{%
- >{color{white}columncolor{red}[.5tabcolsep]%
- raggedright}%
- p{2cm}}
- newcolumntype{B}{%
- >{columncolor{blue}[.5tabcolsep]%
- color{yellow}raggedright}
- p{3cm}}
- newcolumntype{C}{%
- >{columncolor{yellow}[.5tabcolsep]}%
- D{.}{cdot}{3.3}}
- newcolumntype{E}{%
- >{largebfseries
- columncolor{cyan}[.5tabcolsep]}c}
- newcolumntype{F}{%
- >{color{white}
- columncolor{magenta}[.5tabcolsep]}c}
- newcolumntype{G}{%
- >{columncolor[gray]{0.8}[.5tabcolsep][tabcolsep]}l}
- newcolumntype{H}{>{columncolor[gray]{0.8}}l}
- newcolumntype{I}{%
- >{columncolor[gray]{0.8}[tabcolsep][.5tabcolsep]}%
- D{.}{cdot}{3.3}}
- begin{document}
- % The code below is directly extracted from colortbl.dtx
- % http://tug.ctan.org/macros/latex2e/contrib/colortbl/colortbl.dtx
- begin{longtable}{ABC}
- multicolumn{3}{E}{A long table example}\
- multicolumn{2}{F}{First two columns}&
- multicolumn{1}{F}{Third column}\
- multicolumn{2}{F}{p-type}&
- multicolumn{1}{F}{D-type (textsf{dcolumn})}endfirsthead
- multicolumn{3}{E}{A long table example (continued)}\
- multicolumn{2}{F}{First two columns}&
- multicolumn{1}{F}{Third column}\
- multicolumn{2}{F}{p-type}&
- multicolumn{1}{F}{D-type (textsf{dcolumn})}endhead
- multicolumn{3}{E}{Continuedldots}endfoot
- multicolumn{3}{E}{The End}endlastfoot
- P-column&and another one&12.34\
- multicolumn{1}{G}{Total}&
- multicolumn{1}{H}{(wrong)}&
- multicolumn{1}{I}{100.6}\
- Some long text in the first column&bbb&1.2\
- aaa&and some long text in the second column&1.345\
- multicolumn{1}{G}{Total}&
- multicolumn{1}{H}{(wrong)}&
- multicolumn{1}{I}{100.6}\
- aaa&bbb&1.345\
- Note that the coloured rules in all columns stretch to accomodate
- arge entries in one column. &bbb&1.345\
- aaa&bbb&100\
- aaa&Depending on your driver you may get unsightly gaps or lines
- where the `screens' used to produce different shapes interact
- badly. You may want to cause adjacent panels of the same colour by
- specifying a larger overhang
- or by adding some negative space (in a "noalign" between rows.&12.4\
- aaa&bbb&45.3\
- end{longtable}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement