[texhax] alignment of parbox and fbox

Lars Madsen daleif at imf.au.dk
Tue Sep 8 17:16:27 CEST 2009


bill lam wrote:
> Hi,
> 
> I got some troubles in aligning bill-to and delivery-to box in a
> invoice heading. I attach a sample source and the pdf output. My
> problems are 
> 
> 1. I guess the letter 'p' in "Ship" has a descender that make the
>    frame lower than that of the left because "To" got no descenders.
> 

use a \strut to make them both desend equal amounts


> 2. When the content is empty such as the last fbox, its height is
>    smaller than that of the first two box.  I also tried specified a
>    height for fbox but no avail.
> 

read up on minipage and \parbox they can actually take three optional 
arguments. But if the contents is dynamic, then you will need to do some 
measuring in the background to find the biggest height and then use that 
to specify the height of the \parbox

> I want to known how to make all these 3 fbox to be exact the same
> height and aligns to each other.  Thanks in advance.
> 
> 
> % papersize, size of letters
> \documentclass[a4paper]{article}
> \usepackage[english]{babel}
> \usepackage[utf8]{inputenc}
> \usepackage{geometry}
> \geometry{left=1cm,top=1.5cm}
> % do not set pagenumbers
> \usepackage{nopageno}
> 
> \begin{document}
> \begin{minipage}[t]{\textwidth}
>   \parbox[t]{.31\textwidth}{%
>    \bf To:\\
>    \fbox{\parbox{.3\textwidth}{%
>    Mr. No Name \\
>    Door No. \\
>    Street \\
>    City}}}
>   \parbox[t]{.31\textwidth}{%
>    \bf Ship To:\\
>    \fbox{\parbox{.3\textwidth}{%
>    Mr. No Name \\
>    Door No. \\
>    Street \\
>    City}}}
>   \parbox[t]{.31\textwidth}{%
>    \bf ~ \\
>    \fbox{\parbox{.3\textwidth}{%
>    ~ \\
>    ~ \\
>    ~ \\
>    ~ }}}
> \end{minipage}
> 
> \end{document}
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> 
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org


-- 

/daleif


More information about the texhax mailing list