Advertisement
Guest User

Untitled

a guest
May 20th, 2016
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. \documentclass[border=5]{standalone}
  2. \usepackage[svgnames]{xcolor}
  3. \usepackage{tikz}
  4. \usetikzlibrary{matrix}
  5. \newcommand*\head[1]{\textbf{#1}}
  6. \usepackage{amssymb}% provides \blacktriangle, etc.
  7. \newcommand*\up{\textcolor{ForestGreen}{$\blacktriangle$}}
  8. \newcommand*\down{\textcolor{DarkRed}{$\blacktriangledown$}}
  9. \newcommand*{\blackrectangle}{\rule{1.2ex}{1.2ex}}
  10. \newcommand*\const{\textcolor{darkgray}{\blackrectangle}}
  11.  
  12. % The table environment: hard-coded for 4 columns
  13. \newenvironment{matrixtable}[4]{%
  14. \begin{tikzpicture}[matrix of nodes/.style = {
  15. execute at begin cell = \node\bgroup\strut,
  16. execute at end cell = \egroup;}]
  17. \matrix (m) [matrix of nodes,
  18. top color = blue!20,
  19. bottom color = blue!80,
  20. draw = white,
  21. nodes = {draw, top color = blue!10, bottom color = blue!35,
  22. draw, inner sep = 2pt, minimum height = 3.1ex},
  23. column sep = 1ex,
  24. row sep = 0.6ex,
  25. inner sep = 2ex,
  26. rounded corners,
  27. column 1/.style = {minimum width=#1},
  28. column 2/.style = {minimum width=#2},
  29. column 3/.style = {minimum width=#3},
  30. column 4/.style = {minimum width=#4}]}%
  31. {;\end{tikzpicture}}
  32.  
  33. \begin{document}
  34.  
  35. \begin{matrixtable}{1.2cm}{2.4cm}{1.2cm}{0.6cm}{%
  36. \head{Rank} & \head{Distribution} & \head{Hits} & \\
  37. 1 & Ubuntu & 2114 & \down \\
  38. 2 & Fedora & 1451 & \up \\
  39. 3 & Mint & 1297 & \const \\
  40. 4 & OpenSUSE & 1228 & \up \\
  41. 5 & Debian & 910 & \down \\
  42. 6 & Mandriva & 907 & \up \\
  43. 7 & PCLinuxOS & 764 & \up \\
  44. 8 & Puppy & 738 & \up \\
  45. 9 & Sabayon & 671 & \up \\
  46. 10 & Arch & 625 & \down \\ }%
  47. \end{matrixtable}
  48. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement