# How to make a tight grid of many images?

What is the best way in LaTeX to typeset a grid of images with no space between the images and labels along the outer edges such as in the image below? A table? subfigures? anything else?

• A table, look at this answer for ideas: tex.stackexchange.com/a/528136/9632. Is your picture of equal widths and heights, or do you need to scale them into a table grid? – Sveinung Apr 23 '20 at 13:12
• Thanks! All single images are of the same size if this is what you mean. Ideally, the whole grid should scale to text width automatically. – baneli Apr 23 '20 at 13:17

## 1 Answer

This is six pictures. You set \tabcolsep to 0 and back up each row a little bit to remove space between rows and columns:

\documentclass{article}
\usepackage{graphicx}
\usepackage{array}

\setlength{\tabcolsep}{0pt}

\begin{document}
\begin{table}
\centering
\caption{Picture grid.\label{tab:picturegrid}}
\begin{tabular}{ccc}
\includegraphics[width=0.3\linewidth]{homer-simpson.png}
& \includegraphics[width=0.3\linewidth]{homer-simpson.png}
& \includegraphics[width=0.3\linewidth]{homer-simpson.png}\\[-4pt]
\includegraphics[width=0.3\linewidth]{homer-simpson.png}
& \includegraphics[width=0.3\linewidth]{homer-simpson.png}
& \includegraphics[width=0.3\linewidth]{homer-simpson.png}\\[-4pt]
\end{tabular}%
\end{table}
\end{document}