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 the following code and inputted a graphic at some point. When I compile the code, there is a huge white space after the graphic and before the text after the graphic. How do I reduce this white space?

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[right=3cm, left=3cm,bottom=3cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{..}

\begin{document}
\begin{center}
\includegraphics{..}
\end{center}
text..
share|improve this question
    
When you say 'after' the graphic, do you mean to the left/right or top/bottom? –  Nathanael Farley Jan 3 '13 at 17:46
    
I mean at the bottom of the graphic. –  CAF Jan 3 '13 at 17:49
    
The space is not coming from the graphics but by your use of \begin{center}...\end{center}. If you replace this with {\centering \includegraphics{...}} you should get less space around your image. –  ArTourter Jan 3 '13 at 17:49
    
@ArTourter I tried that but now the image is somehow right aligned and there is still a huge gap EDIT: I fixed the right alignment and it it now centered but by using \centering instead there is still this huge gap?. –  CAF Jan 3 '13 at 17:55
1  
Yes, sorry, the white space is part of the graphic. It is fixed now. –  CAF Jan 3 '13 at 18:11
show 2 more comments

1 Answer

up vote 0 down vote accepted

If you use \centering instead of the center environment, there is no white space. Your example would then become

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[right=3cm, left=3cm,bottom=3cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{..}

\begin{document}
{\centering 
\includegraphics{..}
}

text..

Note the curly braces to enclose the \centering to make sure it does not affect the rest of the document.

share|improve this answer
    
I have tried this but there is still the white space? –  CAF Jan 3 '13 at 18:02
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.