Who is online

In total there are 17 users online :: 1 registered, 0 hidden and 16 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Bing [Bot] and 16 guests

Align columns in tables when using enumerate

Add tags Information and discussion about graphics, figures & tables in LaTeX documents.

Align columns in tables when using enumerate

Can someone please help me align the two columns such that they start at the same vertical position? Compiling the code below results in the second column starting higher than the first and ending lower than the first. Why is that happening?

Thanks. Here is the code, that I am trying to use and the use of option [t] in the tabular environment does not seem to help.

Code: Select all  •  Open in writeLaTeX
\documentclass[12pt]{article}

\begin{document}

\begin{enumerate}
\begin{tabular}{*{2}{p{0.5\textwidth}}}
\item First item & \item Third item    \\
\item Second item &  \item Fourth item
\end{tabular}

\end{enumerate}

\begin{enumerate}
\begin{tabular}[t]{*{2}{p{0.5\textwidth}}}
\item First item & \item Third item    \\
\item Second item &  \item Fourth item
\end{tabular}

\end{enumerate}

\end{document
}

Thanks very much.
curiouslearn

Posts: 105
Joined: Fri Nov 30th, 2007

Re: Align columns in tables when using enumerate

Try another approach with the multicol package.
Code: Select all  •  Open in writeLaTeX
\documentclass[11pt,a4paper]{article}
\usepackage{multicol}

\begin{document}
\begin{multicols}{2}
\begin{enumerate}
\item First item
\item Second item
\item Third item
\item Fourth item
\end{enumerate}
\end{multicols}

\medskip
\begin{multicols}{2}
\begin{enumerate}
\item First item
\item Second item
\item Third item
\item Fourth item
\end{enumerate}
\end{multicols}
\end{document
}

The paralist package may be an alternative.

Best regards
Thorsten¹
LaTeX Community Moderator

¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

localghost
Site Moderator

Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: Align columns in tables when using enumerate

Thanks very much Thorsten. That's strange. The reason I posed this question was that multicol gave me exactly the same problem I asked about when I tried to use it with the exam package. I tried to do the following:

Code: Select all  •  Open in writeLaTeX
\question A latex program represents
\begin{multicols}{2}
\begin{choices}
\choice the preferences of a consumer.
\CorrectChoice the preferences of a computer.
\columnbreak
\choice the preferences of a publisher
\choice the preferences of the writer.
\end{choices}
\end{multicols
}

Please do not mind the stupid text in this code. Hence, I tried to use the tabular environment, thinking that would give me more control over the column alignment. Especially if I want to include small figures in two columns (where I have read that multicol runs into problems). Your suggestion works very well for the example given in the above post. Is it possible to do what I need in the tabular environment also?

Thanks very much.
curiouslearn

Posts: 105
Joined: Fri Nov 30th, 2007

Re: Align columns in tables when using enumerate

Is column alignment in tables really difficult? I want the columns to start at the same height in a tabular environment. Would appreciate any help.

Thanks.
curiouslearn

Posts: 105
Joined: Fri Nov 30th, 2007