Graphics, Figures & TablesAlign columns in tables when using enumerate

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Align columns in tables when using enumerate

Post by curiouslearn »

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

\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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Align columns in tables when using enumerate

Post by localghost »

Try another approach with the multicol package.

Code: Select all

\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¹
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Align columns in tables when using enumerate

Post by curiouslearn »

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

\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 30, 2007 11:32 pm

Re: Align columns in tables when using enumerate

Post by curiouslearn »

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.
Post Reply