I currently have set up a command that draws a box with a shadow and some text inside that box. I want it to have a minimum-width, but when I set it, the table is now aligned in the center of the box when the table is smaller than the boxes width. I'd like it to be right-aligned. Here's the current setup:
\documentclass{scrlttr2}
\usepackage{tikz}
\usepackage{color}
\usetikzlibrary{shadows}
\definecolor{myblue}{rgb}{0, 0.58, 0.85}
\newcommand*\invhead[1]{\sffamily{\color{myblue}\footnotesize{\textbf{#1}}}}
\tikzstyle{shadedbox} = [
draw=black,
shade,
top color=white,
bottom color=bottom,
drop shadow={
top color=black,
bottom color=black,
shadow xshift=2pt,
shadow yshift=-2pt,
},
thin,
rectangle,
inner sep=2pt,
inner ysep=2pt
]
\newcommand*\monobox[2]{%
\begin{tikzpicture}
\definecolor{top}{RGB}{250,250,250}
\definecolor{bottom}{RGB}{235,235,235}
\node [shadedbox, minimum width=3.1cm] (box) {
\begin{tabular}{r}
\invhead{\scriptsize #1}\\
\footnotesize{#2}\\
\end{tabular}
}
\end{tikzpicture}
}
\setkomavar{fromname}{TestCompany}
\setkomavar{fromaddress}{37 Test Road, Someplace\\Somewhere, 6020\\Australia}
\setkomavar{fromphone}{+61 123 1234 1234}
\setkomavar{fromemail}{[email protected]}
\setkomavar{signature}{TestCompany}
\setkomavar{invoice}[Invoice number]{1234}
\setkomavar{date}[Issue Date]{\today}
\setkomavar{customer}[Account number]{1234567}
\begin{document}
\begin{letter}{%
Mr Nick Sandford\\
23 Test St\\
Somewhere, Someplace\\
Australia
}
\opening{Dear Nick Sandford,}
\monobox{Test Box}{\$0.00}
\closing{Regards}
\end{letter}
\end{document}
I call it like \monobox{This Bill}{\$20.00}
. This is what it looks like when it is rendered:
Hopefully I'm not doing anything too wrong :).
middle right
and the PGF/TikZ manual doesn't mentioned it either.