Generaltable and itemize

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
astrid
Posts: 4
Joined: Tue Nov 10, 2009 12:58 am

table and itemize

Post by astrid »

Hello,
I have an alignment problem when using a too long sentence (as itemize) in a table. I have attached my code and would be very thankful if anyone could help me. The code shows my table two times ..the second table shows the problem ....
Cheers!!




\documentclass[final,5p,times,twocolumn,authoryear]{elsarticle}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{color}
\usepackage{longtable}
\usepackage{hyperref}
\usepackage{stfloats}
\newenvironment{zenumerate}{\newcounter{zitem}\setcounter{zitem}{0}}
{}
\newcommand\zitem{\refstepcounter{zitem}\thezitem. }

\usepackage{natbib}

\journal{Coastal and Marine Management}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\onecolumn
\begin{longtable}{p{0.4\textwidth}p{0.6\textwidth}}
\hline \hline\\
\begin{enumerate}[A.]
\item The sun is
\begin{enumerate}[1.]
\item The ocean is
\item Snow is?
\end{enumerate}
\item Coffee is

\end{enumerate} &
\begin{enumerate}[ ]
\item yellow
\begin{enumerate}[ ]
\item blue
\item white
\end{enumerate}
\item yammie
\end{enumerate}
\end{longtable}
%%%%%%%%%%%%%%%%%%%%%%%%
\begin{longtable}{p{0.4\textwidth}p{0.6\textwidth}}
\hline \hline\\
\begin{enumerate}[A.]
\item The sun is?
\begin{enumerate}[1.]
\item The ocean is
\item Snow is?
\end{enumerate}
\item Coffee is

\end{enumerate} &
\begin{enumerate}[ ]
\item yellow
\begin{enumerate}[ ]
\item blue
\item white! And when too many people walk on it, or cars drive over and over its really baehhhhhhh
\end{enumerate}
\item yammie
\end{enumerate}
\end{longtable}



\end{document}

Recommended reading 2024:

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

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

yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: table and itemize

Post by yotama9 »

what is the problem? is it running away from the paper? is the text aligned differently?
astrid
Posts: 4
Joined: Tue Nov 10, 2009 12:58 am

Re: table and itemize

Post by astrid »

Hey, thanks a lot for posting. The alignment is wrong. In my table if a sentence on the right column is too long, then it continues into the next line, which makes sense. But on the left side of the column there is already the next item instead of a empty line.
So it says in the table
left side: right side:
Snow is? white
Coffee is? yammie

now lets say there is a long answer:
Snow is ? white! And when too many people walk on it, or cars drive over and its
Coffee is ? really baehhhhhhh
yammie

I tried with "&" and all sort off other stuff..but I'm running out of ideas....thanks!
astrid
Posts: 4
Joined: Tue Nov 10, 2009 12:58 am

Re: table and itemize

Post by astrid »

sorry...the text in my example shifted a bit. yammie does appear on the right side of the column were it should be, just not with coffee.

Hope this makes sense...
Thanks in advance!
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: table and itemize

Post by yotama9 »

I am still not sure what you mean. Does this do any good?
http://en.wikibooks.org/wiki/LaTeX/Tabl ... _in_tables
astrid
Posts: 4
Joined: Tue Nov 10, 2009 12:58 am

Re: table and itemize

Post by astrid »

Hey, thanks a lot. I saw this page already and tried it with including an & to separate the lines, but it doesn't work as soon as I use the /item in a longtable I get an error message.

I love Latex, but this is so frustrating....
Thanks so much for your help though ;)
Post Reply