LaTeX forum ⇒ Graphics, Figures & TablesAlign columns in tables when using enumerate

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

Align columns in tables when using enumerate

Postby curiouslearn » Mon Dec 22, 2008 4:52 pm

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.

  1. \documentclass[12pt]{article}
  2.  
  3.  
  4. \begin{document}
  5.  
  6.  
  7. \begin{enumerate}
  8. \begin{tabular}{*{2}{p{0.5\textwidth}}}
  9. \item First item & \item Third item \\
  10. \item Second item & \item Fourth item
  11. \end{tabular}
  12.  
  13. \end{enumerate}
  14.  
  15. \begin{enumerate}
  16. \begin{tabular}[t]{*{2}{p{0.5\textwidth}}}
  17. \item First item & \item Third item \\
  18. \item Second item & \item Fourth item
  19. \end{tabular}
  20.  
  21. \end{enumerate}
  22.  
  23. \end{document}


Thanks very much.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Mon Dec 22, 2008 5:05 pm

Try another approach with the multicol package.
  1. \documentclass[11pt,a4paper]{article}
  2. \usepackage{multicol}
  3.  
  4. \begin{document}
  5. \begin{multicols}{2}
  6. \begin{enumerate}
  7. \item First item
  8. \item Second item
  9. \item Third item
  10. \item Fourth item
  11. \end{enumerate}
  12. \end{multicols}
  13.  
  14. \medskip
  15. \begin{multicols}{2}
  16. \begin{enumerate}
  17. \item First item
  18. \item Second item
  19. \item Third item
  20. \item Fourth item
  21. \end{enumerate}
  22. \end{multicols}
  23. \end{document}

The paralist package may be an alternative.


Best regards
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


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

Link:
BBcode:
HTML:
Hide post links
Show post links

curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Postby curiouslearn » Mon Dec 22, 2008 5:42 pm

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:

  1. \question A latex program represents
  2. \begin{multicols}{2}
  3. \begin{choices}
  4. \choice the preferences of a consumer.
  5. \CorrectChoice the preferences of a computer.
  6. \columnbreak
  7. \choice the preferences of a publisher
  8. \choice the preferences of the writer.
  9. \end{choices}
  10. \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.

Link:
BBcode:
HTML:
Hide post links
Show post links

curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Postby curiouslearn » Tue Dec 23, 2008 5:25 am

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.

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests