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.

Using includegraphics seems to set default margins that gives a nice spacing between text and image. But I'd like to layout the text as close as possible to the image. How do I control the margins of an image?

Change from:

|     #TEXT######################### |
| ################################## |
| ################################## |
| ################################## |
| ################################## |
| #######################            |
|                                    | % <-- margin from image is a bit tall
|           *************            |
|           *************            |
|           *************            |
|           **IMAGE.JPG**            |
|           *************            |
|           *************            |
|           *************            |
|           *************            |
|                                    | % <-- margin from image is a bit tall
|     #TEXT######################### |
| ################################## |
| ################################## |
| ################################## |
| ################################## |
| #################                  |

To:

|     #TEXT######################### |
| ################################## |
| ################################## |
| ################################## |
| ################################## |
| #######################            | % <-- as close as possible
|           *************            |
|           *************            |
|           *************            |
|           **IMAGE.JPG**            |
|           *************            |
|           *************            |
|           *************            |
|           *************            |
|     #TEXT######################### | % <-- as close as possible
| ################################## |
| ################################## |
| ################################## |
| ################################## |
| #################                  |
share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

No, \includegraphics does not add any margins by itself. You seem to use it either inside a figure or center environment which both add margins.

The distance between floats like figure and table is defined by the lengths \textfloatsep and for figure* in twocolumn documents by \dbltextfloatsep. You can set these to zero to remove all separation.

Should you use the center environment instead, replace it with \centerline{\includegraphics[..]{..}}.

You can also add and remove some vertical space before and after the \includegraphics using \vspace{<length>} where the length can be positive or negative.

share|improve this answer
    
Yes, I was using the center environment. Now using centerline, problem solved, thanks! –  Level1Coder Aug 2 '11 at 11:58
add comment

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.