Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have this kind of table:

\begin{tabular}{p{0.5\textwidth}|p{0.5\textwidth}}
caption1 & caption2 \\
\includegraphics[params]{path11} \includegraphics[params]{path12} ... \includegraphics[params]{path1N} & \includegraphics[params]{path21} \includegraphics[params]{path22} ... \includegraphics[params]{path2N} \\ 
\end{tabular}

I want images to be like array, but they should consider column width and make new row of images automatically if there is no room. all images should be placed equally with margins so they don't touch each other.

share|improve this question
3  
Welcome to TeX.sx! Part of your question seems to be missing. Could you complete it? Also, please provide a complete minimal example document, instead of just a snippet, and tell us what you've tried so far. –  Jake Aug 21 '12 at 14:24

1 Answer 1

up vote 1 down vote accepted

You need to place the images into a \multicolumn{2}{c}{...} macro and then you can add \hfill between them to get some margin between them. You need to set params to width=<some length> with a length small enough.

Here an example with three images:

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\begin{tabular}{p{0.49\textwidth}|p{0.49\textwidth}}
    caption1 & caption2 \\
    \multicolumn{2}{c}{%
    \includegraphics[width=.3\textwidth]{example-image-a} \hfill
    \includegraphics[width=.3\textwidth]{example-image-b} \hfill
    \includegraphics[width=.3\textwidth]{example-image-c}
    }
\end{tabular}

\end{document}

If you need to vertical align the images see How to make a table with centered images? or How to align picture top left in a table?.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.