# Aligning text columns

I am using the following code to try to obtain something to the effect of

Author:                      Laboratory Partners:
Amos NG                      Rebecca ROYCROFT
Nora BRACKBILL
Professor:
Huan HUANG


The code:

\begin{minipage}{0.4\textwidth}
\begin{flushleft} \small
\emph{Author:}\\
Amos \textsc{Ng}\\[0.4cm]
\emph{Professor:} \\
Huan \textsc{Huang}
\end{flushleft}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\begin{flushright} \small
\emph{Laboratory Partners:} \\
Rebecca \textsc{Roycroft}\\
Nora \textsc{Brackbill}
\end{flushright}
\end{minipage}


The resulting output:

How can I achieve the layout I want here?

-
try \begin{minipage}[t]{0.4\textwidth}  for the two minipage environments – Alain Matthes Apr 2 '11 at 7:45

I assume you're trying to get the effect of having the longest line on the right appear flush-right.

Rather than minipage I'd be inclined to use top-aligned tabular, as these automatically adjust their size, with an \hfill to align them to their respective edges.

Edit: Added @{} to the column specs to remove whitespace at the margins.

Something like this:

\begin{tabular}[t]{@{}l}
\emph{Author:}\\
Amos \textsc{Ng}\\
\rule{0.4cm}{0cm}\\% A strut for the extra line space
\emph{Professor:} \\
Huan \textsc{Huang}
\end{tabular}
\hfill
\begin{tabular}[t]{l@{}}
\small
\emph{Laboratory Partners:} \\
Rebecca \textsc{Roycroft}\\
Nora \textsc{Brackbill}
\end{tabular}

-

There is two thing you could use:

• minipage have an optional position parameter that you should set to t for top aligning
• the \hfill command will create a space between the 2 mimipage that will fill all available place.

\begin{minipage}[t]{0.4\textwidth}
.....
\end{minipage}
\hfill
\begin{minipage}[t]{0.4\textwidth}
.....
\end{minipage}

-
hfillis not necessary. The OP uses flushleftand flushright so it's possible to modify the size of the minipages like this : \begin{minipage}[t]{0.5\textwidth}` – Alain Matthes Apr 2 '11 at 7:53
In is exemple, it seem that he wanted to flushleft the right part, hence the hfill. – Rémi Apr 2 '11 at 14:59