# How to make a dynamic comment box next to \address cluster?

I'm sure you're aware what \address{blah} is. Well, I'd like to make a boxed comment that's just as high as my address and stretches from the left margin of the document to 3cm to the left of the address:

\documentclass[standard]{letter}
\usepackage{invoice}
\signature{Piglet Master}
\date{23. May 2009}
\begin{document}
\opening{Invoice no. 1}
My greeting \footnote{I am a man.}
\begin{invoice}{Euro}{0}
\ProjectTitle{Example Project}%
\Fee{Development} {1000.00} {1}
\end{invoice}
\closing{Invoice Release Authorization}
\end{letter}
\end{document}

-
Please add a minimal, complete document showing how are you producing your letter. – Gonzalo Medina Apr 14 '14 at 17:50
@GonzaloMedina, see my edit. – Mike McKittrick Clikeman Apr 14 '14 at 18:00

Using \address{} will give original definition of address. Using \address[]{} will give blank invoice box to the left, and using \address[comment\\comment]{} will add comment to the invoice box.

\documentclass[standard]{letter}
\usepackage[usestackEOL]{stackengine}
\edef\tmpbs{\the\baselineskip}
\setstackgap{L}{\tmpbs}
\newlength\tmpwd
\newlength\tmpht
\usepackage{invoice}
\fboxrule=1pt

\renewcommand\address[2][]{% OPTIONAL ARGUMENT AS [~] FOR EMPTY INVOICE BOX

\def\invoicenote#1{%
\def\stackalignment{l}
\tmpwd=\wd0\relax
\tmpht=\ht0\relax
\def\y{\fboxsep=0pt\fbox{\rule{0pt}{\tmpht}%
\stackon[\tmpht-\tmpbs]{\rule{\dimexpr\textwidth-\tmpwd-3cm\relax}{0pt}}%
{~\textsf{\strut INVOICE}~~\smash{\Longunderstack{#1}}}}}
}

%  ANY OF THESE FORMS WILL WORK:

\signature{Piglet Master}
\date{23. May 2009}
\begin{document}
\opening{Invoice no. 1}
My greeting \footnote{I am a man.}
\begin{invoice}{Euro}{0}
\ProjectTitle{Example Project}%
\Fee{Development} {1000.00} {1}
\end{invoice}
\closing{Invoice Release Authorization}
\end{letter}
\end{document}


-
+1. I think I'll delete my answer, since the bug in invoice.sty forces a modification of the .sty file itself which should be made by the author and not but users. – Gonzalo Medina Apr 14 '14 at 18:37
@GonzaloMedina I think you describe how it should be altered to avoid the problem. I would not delete yours yet (unless all the voters agree with you :^). – Steven B. Segletes Apr 14 '14 at 18:40
I think I'll leave it deleted. I don't like a solution involving modification (even to a copy) of a .sty file, and even if it is due to a bug. – Gonzalo Medina Apr 14 '14 at 18:46