LaTeX forum ⇒ GeneralProblems with itemize in tabular and footnotes

LaTeX specific issues not fitting into one of the other forums of this category.
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Problems with itemize in tabular and footnotes

Postby avp3000 » Sat Jul 12, 2008 9:54 pm

Hi,

I have to quick questions:

1. Here the source code of a table I am trying to create:

  1. \begin{table}
  2. \begin{tabular}{|l|l|}
  3. \hline
  4. \multicolumn{2}{c}{\textbf{Alternative Climate-Policy Approaches}}\\
  5. \hline
  6. \begin{itemize}
  7. \item carbon taxes
  8. \item carbon quotas
  9. \end{itemize}
  10. &
  11. \begin{itemize}
  12. \item subsidies to R\&D in low-carbon technologies
  13. \item public-sector R\&D in low-carbon technologies
  14. \end{itemize}\\
  15.  
  16. \hline
  17. \end{tabular}
  18. \end{table}



As you see, I want to have a heading, than two heading for the two columns and than a bullet list in every column. However, I get the messeage: "! Latex error: Something's wrong--perhaps a missing \item".

Any ideas why this happens?

2. To produce footnotes, I just use the \footnote{} command right after the word(e.g. dog\footnote{a black one}). However, in the compiles version, the footnotes appear, in my opinion, too close to the words with no space between the last letter of the word and the number of the footnote. Why is that?

Thank you very much :-)

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 7803
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Jul 12, 2008 10:19 pm

Hi,

1. you could use \parbox or minipages or just p-columns:
  1. \begin{tabular}{|p{0.4\textwidth}|p{0.4\textwidth}|}

2. In my opinion the spacing is ok (without additional space), test the other case how it would look like with space:
  1. Some Text~\footnote{Test}.

Stefan
Site admin

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

User avatar
black-wolf
Posts: 7
Joined: Wed Jul 02, 2008 10:58 pm

Postby black-wolf » Sat Jul 12, 2008 10:25 pm

Hello,

As far as I know you can't have itemize environment inside a tabular one. :( (If anyone knows how to do it I would appreciate it ;))

You need to number it by hand.

Where's an example

Best regards

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Sun Jul 13, 2008 12:00 am

black-wolf wrote:...As far as I know you can't have itemize environment inside a tabular one...

Of course you can. In the post immediately before yours, Stefan_K explained how it is possible to use the list-like environments inside a tabular:
  1. \documentclass{article}
  2.  
  3. \begin{document}
  4.  
  5. \begin{tabular}{|p{5cm}|}
  6. \hline
  7. \begin{itemize}
  8. \item First item
  9. \end{itemize} \\ \hline
  10. \begin{enumerate}
  11. \item First item
  12. \end{enumerate} \\ \hline
  13. \begin{description}
  14. \item[Descriptor] First item
  15. \end{description} \\ \hline
  16. \end{tabular}
  17.  
  18. \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

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

avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Postby avp3000 » Sun Jul 13, 2008 1:43 am

Hello everybody,

Thanks, Stephan_K, probably the \parbox and minipage are exactly what I need. The funny thing is the following works:

  1. \begin{tabularx}{220mm}{|>{\centering\arraybackslash}X|>{\centering\arraybackslash}X|}
  2. \hline
  3. {\center{\textbf{\emph{Rein öffentliches Gut}}}} & {\center{\textbf{\emph{Klubgüter}}}}\\
  4. \begin{small}
  5. \bxi
  6. \item Nationale Verteidigung
  7. \item Nicht überfüllte Straßen und Autobahnen ohne Maut
  8. \item Rundfunk \& TV „over the air“
  9. \item Software ohne Kopierschutz
  10. \exi
  11. \end{small}
  12. &
  13. \begin{small}
  14. \begin{itemize}
  15. \item Nicht überfüllte Strassen und Autobahnen mit Maut
  16. \item Vorlesung mit freien Plätzen
  17. \item Software mit Kopierschutz
  18. \item Innovationen mit Patentschutz
  19. \end{itemize}
  20.  
  21. \end{small}
  22. \\ \hline
  23.  
  24. \end{tabularx}


bxi and exi are \begin{itemize} with a modified interitem space. However, I just don't understand what's make this example work and the other not. The only difference I see is that there I use \begin{small}.

Gmedina, I thought about the method that you suggest. The problem with it, however, is that this way there is too much space between the single items and I should modify it manually, which, of course, makes the whole thing pointless - if I should do something manually, than better just put $\bullet$ in front of every line. But thanks again all of you for the advices.

Cheers,
Alex

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Sun Jul 13, 2008 2:15 am

avp3000 wrote:...Gmedina, I thought about the method that you suggest. The problem with it, however, is that this way there is too much space between the single items and I should modify it manually, which, of course, makes the whole thing pointless - if I should do something manually, than better just put $\bullet$ in front of every line. But thanks again all of you for the advices.

Cheers,
Alex

Hi avp3000,

You can control this space automatically:
  1. \documentclass{article}
  2.  
  3. \begin{document}
  4.  
  5. %Using the standar \itemsep value
  6. \begin{tabular}{|p{5cm}|}
  7. \hline
  8. \begin{itemize}
  9. \item First item
  10. \item Second item
  11. \item Third item
  12. \end{itemize} \\ \hline
  13. \end{tabular}
  14.  
  15. \vspace{1cm}
  16.  
  17. %Setting \itemsep to 0pt
  18. \begin{tabular}{|p{5cm}|}
  19. \hline
  20. \begin{itemize}
  21. \setlength\itemsep{0pt}
  22. \item First item
  23. \item Second item
  24. \item Third item
  25. \end{itemize} \\ \hline
  26. \end{tabular}
  27.  
  28. \end{document}

You can even use the enumitem package to further easily customise your list-like environments.

avp3000 wrote:...I just don't understand what's make this example work and the other not...

You are using the X specifier provided by tabularx package. Internally, after some calculations, this will be traduced as p{some value}, and as shown before, this allows using list-like environments. In the code in your first post you used the l specifier for the column format and this specifier (as c or r) does not allow the use of those list-like environments.
1,1,2,3,5,8,13,21,34,55,89,144,233,...

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

jpaez
Posts: 1
Joined: Sun Jul 27, 2008 7:57 pm

Postby jpaez » Sun Jul 27, 2008 8:07 pm

To enumerate and to label what your you want in an environment to tabulate, longtable .... it(he,she) looks at this link ... where a new environment of enumeration develops .... I believe that it is for what you look.....
http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2008-02/msg00630.html

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

LatexMaster
Posts: 2
Joined: Mon Aug 23, 2010 12:48 pm

Postby LatexMaster » Mon Aug 23, 2010 12:53 pm

Hi all,
I found out why sometimes it works and sometimes not:

The following code works:
  1. \begin{tabular}{|c|p{5cm}|p{5cm}|}
  2. \hline
  3. blabla & \begin{itemize}
  4. \item First item
  5. \item Second item
  6. \item 3 item
  7. \end{itemize} &
  8. \begin{enumerate}
  9. \item item 1
  10. \item item 2
  11. \item item 3
  12. \end{enumerate} \\ \hline
  13. other bla bla & \begin{enumerate}
  14. \item First item
  15. \item Second item
  16. \item 3 item
  17. \end{enumerate} & bla bla\\ \hline
  18. \end{tabular}


while this does not:
  1. \begin{tabular}{|c|c|p{5cm}|}
  2. \hline
  3. blabla & \begin{itemize}
  4. \item First item
  5. \item Second item
  6. \item 3 item
  7. \end{itemize} &
  8. \begin{enumerate}
  9. \item item 1
  10. \item item 2
  11. \item item 3
  12. \end{enumerate} \\ \hline
  13. other bla bla & \begin{enumerate}
  14. \item First item
  15. \item Second item
  16. \item 3 item
  17. \end{enumerate} & bla bla\\ \hline
  18. \end{tabular}


The only difference is \begin{tabular}{|c|p{5cm}|p{5cm}|} and \begin{tabular}{|c|c|p{5cm}|}. If you put p{..} on the column with the items it works whereas the c option seems to crash. Why? I have no idea :), but this is at least an easy solution.

Jarod.

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Mon Aug 23, 2010 3:55 pm

LatexMaster wrote:Hi all,
I found out why sometimes it works and sometimes not[...]
The only difference is \begin{tabular}{|c|p{5cm}|p{5cm}|} and \begin{tabular}{|c|c|p{5cm}|}. If you put p{..} on the column with the items it works whereas the c option seems to crash. Why? I have no idea :), but this is at least an easy solution.


Did you even bother to read the answer I gave two replies before your post?
1,1,2,3,5,8,13,21,34,55,89,144,233,...

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

LatexMaster
Posts: 2
Joined: Mon Aug 23, 2010 12:48 pm

Postby LatexMaster » Mon Aug 23, 2010 5:35 pm

gmedina wrote:Did you even bother to read the answer I gave two replies before your post?


Oops, sorry I actually oversaw your last sentence.

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


Return to “General”

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests