Graphics, Figures & TablesItemize inside a table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pignatelli
Posts: 4
Joined: Thu May 28, 2009 5:34 pm

Itemize inside a table

Post by pignatelli »

Hi there,

I'm trying to make a table 2x2 like this:

Code: Select all

\begin{tabular}{cc}
\insertMiniGraphic{graph1.jpg} & \insertMiniGraphic{graph2.jpg} \\
\insertMiniGraphic{graph1.jpg} & 
\begin{itemize}
\item Final Acceleration 0.0 $m/s^2$
\item Final Velocity 0.0 $m/s$
\item Final Position 102 $m$
\end{itemize}
\end{tabular}
To resume the results of an experiment.

The images works properly, but the itemize doesn't work at all.

Do you know why, it works ok outside the tabular enviroment but inside a cell it's not functional.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Re: Itemize inside a table

Post by fatra2 »

Hi there,

The results you obtain are normal. Since the option {cc} allows a one line table content, you cannot itemize a list.

You could try to solve this issue, by adding {p{width}p{width}}, the width being in cm. This option puts you into paragraph mode inside the cell.

Cheers
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Re: Itemize inside a table

Post by localghost »

Please use the search function. There already exist suitable solutions to this issue.


Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
pignatelli
Posts: 4
Joined: Thu May 28, 2009 5:34 pm

Itemize inside a table

Post by pignatelli »

First of all, thank u for the answers,

I've tried the solutions but it's still not working because the images:

So if you write:

\begin{tabular}{|p{210pt}|p{210pt}|}
\hline
\begin{itemize}
\item item1
\item item2
\end{itemize} &
\includegraphics[width=200pt] {\imgDir phase0acc.jpg}\\
\hline
\end{tabular}

What you get looks like that:
Image

So it seems like the cell is expanded as if keep the space for an image or something like that, and that's not what I need to do.

Somebody knows?
pignatelli
Posts: 4
Joined: Thu May 28, 2009 5:34 pm

Re: Itemize inside a table

Post by pignatelli »

Solved!

I'll post the solution just in case of any further need.

Here is my guidance (spanish): http://plagatux.es/2008/04/alineacion-v ... las-latex/

The thing is to use m{value} instead of p{value}. It's mandatory to use the package array (usepackage{array} ).

Thank u very much.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Itemize inside a table

Post by localghost »

In this case you can use the array package and replace the p{...} columns by m{...} columns.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{array,enumitem}
\usepackage[demo]{graphicx}

\parindent0em

\begin{document}
  \begin{tabular}{|m{210pt}|m{210pt}|} \hline
    \begin{itemize}
      \item item1
      \item item2
      \end{itemize} &
    \includegraphics[\linewidth]{\imgDir phase0acc.jpg} \\\hline
  \end{tabular}
\end{document}
You may customize the list environment with enumitem.

Edit: Solution posted while preparing this reply.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply