# Insert text line in array

I am looking for a (clean) way to keep text aligned in a situation like the following:

thesis under the direction of:
[tab] Title [&] Name [&] University
with the supervision of:
[tab] Title [&] Name [&] University
[tab] Title [&] Name [&] University
[tab] Title [&] Name [&] University


The (dirty) way I found so far is to fix empirically the width of the first and second column. Here's an MWE

\documentclass[11pt]{article}
\begin{document}
\begin{titlepage}

\vspace*{\fill}

\noindent{\emph{thesis under the direction of}}\\[.3cm]
\hspace*{.4cm}\begin{tabular}{p{.1\textwidth}p{.4\textwidth}l}
Title & First Name Last Name  &  University A\\
\end{tabular}

\vspace*{.5cm}

\noindent{\emph{with the supervision of}}\\[.3cm]
\hspace*{.4cm}\begin{tabular}{p{.1\textwidth}p{.4\textwidth}l}
Title & First Name Last Name &  University B\\
Title & First Name Last Name &  University C\\
\end{tabular}
\end{titlepage}
\end{document}


I was just curious to know whether there would be a cleaner, more systematic way of doing that?

Thanks!

-

Can you use tabbing?

\begin{tabbing}
\emph{thesis under the direction of} \\
\hspace{.4cm} \= Longest Title \= Longest First Name Last Name \= Longest University A \kill
\> Title \> First Name Last Name \> University A \\[.5cm]
\pushtabs
\emph{with the supervision of} \\
\poptabs
\> Title \> First Name Last Name \> University B \\
\> Title \> First Name Last Name \> University C \\
\end{tabbing}


(The \pushtabs and \poptabs commands are unneeded here, but may be useful in other casses.)

-
thanks a lot! I didn't know of the tabbing environment. –  tibL Jun 16 '12 at 10:41

Since you are willing to specify the longest entry for each column you could just define a macro to place the text within an appropriate sized box to yield:

Using a \parbox for the University name allows for longer names. The width of this paragraph is set to the width that would be taken up by Longest University.

## Code:

\documentclass{article}
\usepackage{calc}

\par\noindent%
\makebox[\widthof{Longest Title}][l]{#1}%
\makebox[\widthof{Longest First Name Last Name}][l]{#2}%
\parbox[t]{\widthof{Longest University}}{#3}%
}%

\begin{document}
\noindent
\emph{thesis under the direction of:}