TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to make a table from images of specific size (2cm) in PDF format. But in case of using article document class I got larger images. I tried to use minimal class and got right sizes, but invisible table borders.

There is my code:



\newcommand{\ABTile}{\includegraphics[height=2cm, width=2cm]{./AB.png}}
\newcommand{\AvTile}{\includegraphics[height=2cm, width=2cm]{./Av.png}}

        \ABTile    & \ABTile \\
        \AvTile    & \AvTile \\

Result with article class (pdf)

Result with minimal class (pdf)

Is there any way to make table with right size?

share|improve this question

migrated from stackoverflow.com Jan 24 '12 at 3:08

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Jan 24 '12 at 5:44
It may be that your images have additional whitespace at the top/bottom, causing you to use something like \\[-1.2cm]. – Werner Jan 24 '12 at 5:51
You should add keepaspectratio to your \includegraphics statements - otherwise the graphics will get distored. – Martin Schröder Jan 24 '12 at 11:12
up vote 5 down vote accepted

There is a special column descriptor (@{}) which can be used in the tabular definition. It replaces the spacing with whatever you put inside the curly braces (so leave blank to have no space). Try replacing




That is, wrap the c or p with @{} on either side to make 0 space on both sides.

share|improve this answer
Ok. It solves problem with width. But height is still wrong. – citxx Jan 22 '12 at 23:33
Using \[-1.2cm] before each new row helps. Not good but acceptable solution. Thank you. – citxx Jan 22 '12 at 23:46
@citxx Try putting \renewcommand{\arraystretch}{0.5} before the tabular environment. You can change the number (0.5) to fine tune the spacing. It's a bit more elegant (and simple) of a solution I think... – Magnesium Jan 23 '12 at 6:45

Your Answer


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.