Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[border=5]{standalone}
- \usepackage[svgnames]{xcolor}
- \usepackage{tikz}
- \usetikzlibrary{matrix}
- \newcommand*\head[1]{\textbf{#1}}
- \usepackage{amssymb}% provides \blacktriangle, etc.
- \newcommand*\up{\textcolor{ForestGreen}{$\blacktriangle$}}
- \newcommand*\down{\textcolor{DarkRed}{$\blacktriangledown$}}
- \newcommand*{\blackrectangle}{\rule{1.2ex}{1.2ex}}
- \newcommand*\const{\textcolor{darkgray}{\blackrectangle}}
- % The table environment: hard-coded for 4 columns
- \newenvironment{matrixtable}[4]{%
- \begin{tikzpicture}[matrix of nodes/.style = {
- execute at begin cell = \node\bgroup\strut,
- execute at end cell = \egroup;}]
- \matrix (m) [matrix of nodes,
- top color = blue!20,
- bottom color = blue!80,
- draw = white,
- nodes = {draw, top color = blue!10, bottom color = blue!35,
- draw, inner sep = 2pt, minimum height = 3.1ex},
- column sep = 1ex,
- row sep = 0.6ex,
- inner sep = 2ex,
- rounded corners,
- column 1/.style = {minimum width=#1},
- column 2/.style = {minimum width=#2},
- column 3/.style = {minimum width=#3},
- column 4/.style = {minimum width=#4}]}%
- {;\end{tikzpicture}}
- \begin{document}
- \begin{matrixtable}{1.2cm}{2.4cm}{1.2cm}{0.6cm}{%
- \head{Rank} & \head{Distribution} & \head{Hits} & \\
- 1 & Ubuntu & 2114 & \down \\
- 2 & Fedora & 1451 & \up \\
- 3 & Mint & 1297 & \const \\
- 4 & OpenSUSE & 1228 & \up \\
- 5 & Debian & 910 & \down \\
- 6 & Mandriva & 907 & \up \\
- 7 & PCLinuxOS & 764 & \up \\
- 8 & Puppy & 738 & \up \\
- 9 & Sabayon & 671 & \up \\
- 10 & Arch & 625 & \down \\ }%
- \end{matrixtable}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement