Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. |C{0.2}L{0.2}R{0.2}L{0.4}| -> C{0.2}|L{0.2}|R{0.2}|L{0.4}
  2. |C{0.2}|L{0.2}|R{0.2}|L{0.4}| -> C{0.2}|L{0.2}|R{0.2}|L{0.4}
  3. C{0.25}L{0.75} -> C{0.25}|L{0.75}
  4.  
  5. documentclass{article}
  6.  
  7. usepackage[table]{xcolor} % Provides coloring for tables and text
  8. usepackage{tabularx} % Customized table formatting
  9. RequirePackage{environ} % Used to define custom table environment
  10.  
  11. % Define table related commands and properties
  12. definecolor{greyblue}{rgb}{0.6353,0.6863,0.7686} % Define a color used in the tables
  13. newcommandsetrow[1]{gdefrowmac{#1}#1ignorespaces} % Used for making a row bold
  14. newcommandclearrow{globalletrowmacrelax} clearrow % Used for clearing a row formatting
  15. newcolumntype{C}[1]{>{hsize=#1hsizerowmaccenteringarraybackslash}X} % Centered column, input is relative width of page
  16. newcolumntype{L}[1]{>{hsize=#1hsizerowmacraggedrightarraybackslash}X} % Left-aligned column, input is relative width of page
  17. newcolumntype{R}[1]{>{hsize=#1hsizerowmacraggedleftarraybackslash}X} % Left-aligned column, input is relative width of page
  18.  
  19. % Defines an environment to create a table in the document according to
  20. % a common formatting. This uses the environ package.
  21. NewEnviron{doctable}[4]{
  22. begin{table}[!htbp]
  23. centering
  24. rowcolors{2}{black!5}{black!15}
  25. begin{tabularx}{#3linewidth}{#4<{clearrow}}%
  26. hline
  27. rowcolor{greyblue} setrow{bfseries} % Make the header row bold and colored grey-blue
  28. BODY
  29. hline
  30. end{tabularx}
  31. caption{#2}
  32. label{#1}
  33. end{table}
  34. }
  35.  
  36. begin{document}
  37. begin{doctable}
  38. {tbl:label}
  39. {Table Caption}
  40. {1} { C{0.25}L{0.75} }
  41. Heading 1 & Heading 2 \
  42. Text 1 & Text 2 \
  43. end{doctable}
  44. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement