### LaTeX users 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: sefie and 16 guests

### LaTeX Friends

Sponsored by DANTE e.V.: The German speaking TeX Users Group

## Problems with itemize in tabular and footnotes

### LaTeX Forum: General

Add tags LaTeX specific issues not fitting into one of the other forums of this category.
Hi,

I have to quick questions:

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

Code: Select all  •  Open in online LaTeX editor
\begin{table}\begin{tabular}{|l|l|}\hline\multicolumn{2}{c}{\textbf{Alternative Climate-Policy Approaches}}\\\hline\begin{itemize}    \item carbon taxes    \item carbon quotas\end{itemize}&\begin{itemize}    \item subsidies to R\&D in low-carbon technologies    \item public-sector R\&D in low-carbon technologies\end{itemize}\\\hline\end{tabular}\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
avp3000

Posts: 49
Joined: Thu Nov 15th, 2007

Hi,

1. you could use \parbox or minipages or just p-columns:
Code: Select all  •  Open in online LaTeX editor
\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:
Code: Select all  •  Open in online LaTeX editor
Some Text~\footnote{Test}.

Stefan

Stefan Kottwitz

Posts: 7649
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

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

black-wolf

Posts: 7
Joined: Wed Jul 2nd, 2008

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:
Code: Select all  •  Open in online LaTeX editor
\documentclass{article}\begin{document}\begin{tabular}{|p{5cm}|}  \hline  \begin{itemize}    \item First item  \end{itemize} \\ \hline  \begin{enumerate}    \item First item  \end{enumerate} \\ \hline  \begin{description}    \item[Descriptor] First item  \end{description} \\ \hline \end{tabular}\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

gmedina

Posts: 2313
Joined: Wed Jul 11th, 2007
Location: Colombia

Hello everybody,

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

Code: Select all  •  Open in online LaTeX editor
\begin{tabularx}{220mm}{|>{\centering\arraybackslash}X|>{\centering\arraybackslash}X|}    \hline{\center{\textbf{\emph{Rein öffentliches Gut}}}} & {\center{\textbf{\emph{Klubgüter}}}}\\ \begin{small}    \bxi  \item Nationale Verteidigung  \item Nicht überfüllte Straßen und Autobahnen ohne Maut  \item Rundfunk \& TV „over the air“  \item Software ohne Kopierschutz    \exi \end{small}    & \begin{small}    \begin{itemize}    \item Nicht überfüllte Strassen und Autobahnen mit Maut   \item Vorlesung mit freien Plätzen   \item Software mit Kopierschutz   \item Innovationen mit Patentschutz    \end{itemize} \end{small}    \\ \hline\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
avp3000

Posts: 49
Joined: Thu Nov 15th, 2007

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:
Code: Select all  •  Open in online LaTeX editor
\documentclass{article}\begin{document}%Using the standar \itemsep value\begin{tabular}{|p{5cm}|}  \hline  \begin{itemize}    \item First item    \item Second item    \item Third item  \end{itemize} \\ \hline\end{tabular}\vspace{1cm}%Setting \itemsep to 0pt\begin{tabular}{|p{5cm}|}  \hline  \begin{itemize}    \setlength\itemsep{0pt}    \item First item    \item Second item    \item Third item  \end{itemize} \\ \hline\end{tabular}\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,...

gmedina

Posts: 2313
Joined: Wed Jul 11th, 2007
Location: Colombia

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
jpaez

Posts: 1
Joined: Sun Jul 27th, 2008

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

The following code works:
Code: Select all  •  Open in online LaTeX editor
\begin{tabular}{|c|p{5cm}|p{5cm}|}  \hline  blabla & \begin{itemize}     \item First item          \item Second item          \item 3 item  \end{itemize} &\begin{enumerate}\item item 1\item item 2\item item 3 \end{enumerate} \\ \hline other bla bla & \begin{enumerate}     \item First item          \item Second item          \item 3 item  \end{enumerate} & bla bla\\ \hline\end{tabular}

while this does not:
Code: Select all  •  Open in online LaTeX editor
\begin{tabular}{|c|c|p{5cm}|}  \hline  blabla & \begin{itemize}     \item First item          \item Second item          \item 3 item  \end{itemize} &\begin{enumerate}\item item 1\item item 2\item item 3 \end{enumerate} \\ \hline other bla bla & \begin{enumerate}     \item First item          \item Second item          \item 3 item  \end{enumerate} & bla bla\\ \hline\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.
LatexMaster

Posts: 2
Joined: Mon Aug 23rd, 2010

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.

1,1,2,3,5,8,13,21,34,55,89,144,233,...

gmedina

Posts: 2313
Joined: Wed Jul 11th, 2007
Location: Colombia

Oops, sorry I actually oversaw your last sentence.
LatexMaster

Posts: 2
Joined: Mon Aug 23rd, 2010