[texhax] text inside box

John Culleton john at wexfordpress.com
Tue Aug 18 03:32:14 CEST 2009


On Saturday 15 August 2009 11:46:55 pm bill lam wrote:
> I want to write a template for invoice in latex.  The invoice
> looks like this:
>
> Billing Address     Delivery Address
> +----------------+  +-----------------+
> + ABC            +  + ABC             +
> + CCCCCCCCC      +  + CCCCCCCCCC      +
> +                +  +                 +
> +                +  +                 +
> +                +  +                 +
> +----------------+  +-----------------+
>
> +---------------------------------------------------------------+
> +  Item                     Qty           Price       Amount    +
> +---------------------------------------------------------------+
> +---------------------------------------------------------------+
> +                                                               +
> +  Pencil                   10 pc           0.4          4.0    +
> +                                                               +
> +                                                               +
> +                                                               +
> +                                                               +
> +                                                               +
> +                                                               +
> +                                                               +
> +                                                               +
> +                                                               +
> +---------------------------------------------------------------+
>
> I think the bottom part can be done using tabular.  But any
> suggestion for the two bounding boxes on top?  They should be
> fixed in size and position with textual contents.

I dug into a little used part of the TeX family and used the table 
macros from texsys  thus:
------------------------------------------------------------------------------
\input eplain.tex
\input TXSruled.tex
\def\today{\ifcase\month\or
January\or February\or March\or April\or
May\or June\or July\or August\or 
September \or October\or November\or December\fi
\space\number\day, \number\year}

\nopagenumbers
\parindent=0pt
\parskip=0pt
\font\bigss=cmss17 at 25pt
\centerline{\bigss INVOICE}
\noncenteredtables
\vskip .25in
\hrule height 1.5pt 
\bigskip
\line{\hfill Date: \today}
\vskip .25in
\line{\ruledtable
VENDOR \cr
John Culleton \hfill\crnorule
009-20-0626\hfill\crnorule
2401 Haight Avenue\hfill\crnorule
Eldersburg, MD 21784 \hfill\endruledtable
\hfill
\ruledtable
CUSTOMER\cr
Independent Contract Services\hfill\crnorule
Landmark Community Newspapers\hfill\crnorule
Carroll County Times\hfill\crnorule
P.O. Box 346\hfill\crnorule
Westminster, MD 21158\hfill\endruledtable
}
\centeredtables
\bigskip
\ruledtable
Item\dbl Desc|Date |Amount \cr
  1 \dbl \para{Column}| Nov 6  | \$40.00  \cr
  2 \dbl \para{Column}| Nov 20 |\$40.00  \cr

\dbl \multispan2 \hfil TOTAL: | \$80.00\endruledtable
\def\uline#1{\vrule height 0pt depth .75pt width #1 in} 

{\baselineskip=25pt
\vskip 30pt

Signed:\uline{2}
\vskip 30pt

Approved:\uline{2} \hfill Approved Date:\uline{1.5}\break}
\vfil\eject\null
\vskip -.5in
\moveleft .75truein
\vbox{{\bf John Culleton}\par
2401 Haight Ave\par
Eldersburg MD 21784\par
}
	\vskip 30pt
\moveright 3truein
\vbox{\obeylines
Independent Contract Services
Landmark Community Newspapers
Carroll County Times
P.O. Box 346
Westminster, MD 21158
}\vfill
\bye
------------------------------------------------------------------------
I print the first page on paper, then reinsert the paper to put the 
address and return on the other side. Fold it in three, use a dab 
or two of Scotch glue stick, and  I don't even need an envelope!

Each month I copy the tex file, change the variables as needed and 
go forth again.
-- 
John Culleton
Create Book Covers with Scribus/e-book $5.95
http://www.booklocker.com/books/4055.html


More information about the texhax mailing list