Is it possible to place 4 images in an 2x2 grid? I don't want to float them, I don't want any captions. Each image should have the same width.


Thanks for all the answers. After trying it out, I realized, that I forgot to ask one point:

Suppose I have a counter like this:


Now I want to add \num before each picture, the enumeration should be displayed above to the left of each image.


This works for me:




    \advance\@tempdima by \ht0
    \advance\@tempdima by -#1\relax


% \setlength{\tabcolsep}{0pt}


    & \num\putindeepbox[7pt]{\includegraphics{whatever.jpg}} \\
    & \num\putindeepbox[7pt]{\includegraphics{whatever.jpg}} \\



(Edited to include pseudo-captions; the macro \putindeepbox takes something and puts it into a box of height equal to 0.7\baselineskip by default (i.e., the height of a \strut) and deep enough to accomodate for the given material. Somehow in tabular \baselineskip gets reset to zero, so I've hardcoded the height manually. Not very elegant, but works - feel free to improve it;). Notice also some dirty tricks with boxes - hopefully someone will find a cleaner way to do it. I hope that this is what you wanted, and that it is not too late... See also comments below to make spacing better.)

The spacing is not perfect; you can manipulate the horizontal spacing with tabcolsep, AFAIK there is no such parameter for vertical spacing in tabular.

  • 2
    You could use \usepackage[demo]{graphics} to avoid needing a 'real' image at all.
    – Joseph Wright
    Dec 7 '11 at 17:26
  • Wow, I didn't know about that functionality, thanks! I'll modify my code above.
    – mbork
    Dec 7 '11 at 17:31
  • 2
    You might also want to change {cc} to {@{..}c@{..}c@{..}} where .. is some space command like \hspace{<length>}, in order to control the exact horizontal distance between the images. A \rule[<length>]{0pt}{0pt} can be used to add a negative space inside the top row to push the bottom row down.
    – Martin Scharrer
    Dec 7 '11 at 18:21
  • 1
    @user4011: I'm sorry, somehow I missed your question... I've edited my answer. @hhh: see e.g. the pgffor package.
    – mbork
    Jan 16 '12 at 23:44
  • 1
    You might want to look at the adjustbox package. Or use \raisebox{-\dimexpr\height+\ht\strutbox\relax}{\includegraphics{...}} instead of that complicated computation. With \usepackage[export]{adjustbox} it becomes \includegraphics[valign=t]{...}
    – egreg
    Jan 17 '12 at 0:19

Here is a ConTeXt solution:

\useMPlibrary [dum]  % for placeholder pictures

\startcombination [2*2]


The result is:result

When captions are not necessary, simply leave the second braces empty. The distance between the images can be set up with the command \setupcombinations, see setupcombinations reference.

  • 2
    I really love the way ConTeXt handles this case
    – MP0
    Jun 13 '12 at 10:18
  • This was exactly what i was looking for. I almost feel guilty that it's so simple. TeX is supposed to make me suffer and make me feel grateful when something comes out how I wanted! Jan 9 '16 at 5:48

Well, if you do not have captions, use just \includegraphics:


For even distribution on either side of the images, use a combination of \hfills:

enter image description here

\usepackage[demo]{graphicx}% http://ctan.org/pkg/graphicx

Here is some text.\strut

\noindent\null\hfill\includegraphics{one} \hfill
\includegraphics{two} \hfill\null

\noindent\null\hfill\includegraphics{three} \hfill
\includegraphics{four} \hfill\null

Here is some more text.

\null is to fool LaTeX in thinking there's something there from which to add the horizontal fill. \strut is used to improve the \baselineskip from the top paragraph, since it has no descenders (p, or q, or the like). You can set the image width, of course, using the width=<len> key-value pair of the \includegraphics command.

The demo option to graphicx is merely for display purposes, allowing to typeset an image as a 150pt x 100pt black rectangle regardless of whether the image exists or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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