## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ unwanted margin after a figure Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Maxim22
Posts: 3
Joined: Sat Jan 05, 2013 4:26 pm

### unwanted margin after a figure

Hi, I'm new to latex. I have the following problem:
After I have inputted a figure, I get a weird margin space on the next line. I'm just using this standard figure code so I don't think the problem lies there.
\begin{figure}[H]\centering\includegraphics[width=0.8\textwidth]{image}\caption{Image}\label{fig:image}\end{figure}

Maybe the problem lies in my header since I just copied that from a Latex template.. can anyone help me with this?

Tags:

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
Hi Maxim,

welcome to the board!

Maxim22 wrote:Maybe the problem lies in my header since I just copied that from a Latex template..

So why don't you post the header? Yes, the figure code is pretty common and should not cause that problem. But I also think the header doesn't either. Could it be that the image itself has a margin?

Perhaps post a minimal working example and attach the image to a post. So we can really test the issue. Otherwise it's quite theoretical.

Stefan

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Hi Maxim22,

Welcome to the LaTeX community!

Unfortunately this piece of code won't tell us why that's happening to you. To be honest I'm not sure I even completely understood what you mean. Can you extend the code to a complete but minimal example (= minimal working example) that reproduces the behaviour so that we can compile and see for ourselves? Probably we will then be able to figure out what the problem is.

Regards

PS: Stefan was a minute faster
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Maxim22
Posts: 3
Joined: Sat Jan 05, 2013 4:26 pm
\documentclass[12pt]{article}\usepackage[dutch]{babel}\usepackage{amsmath}    % need for subequations\usepackage{graphicx}   % need for figures\usepackage{verbatim}   % useful for program listings\usepackage{color}      % use if color is used in text\usepackage{subfigure}  % use for side-by-side figures\usepackage{hyperref}   % use for hypertext links, including those to external documents and URLs\hypersetup{pdfborder={0 0 0}}\usepackage{float}  % don't need the following. simply use defaults\setlength{\baselineskip}{16.0pt}    % 16 pt usual spacing between lines \setlength{\parskip}{3pt plus 2pt}\setlength{\parindent}{20pt}\setlength{\oddsidemargin}{0.5cm}\setlength{\evensidemargin}{0.5cm}\setlength{\marginparsep}{0.75cm}\setlength{\marginparwidth}{2.5cm}\setlength{\marginparpush}{1.0cm}\setlength{\textwidth}{150mm} \begin{document} \begin{figure}[H]\centering\includegraphics[width=0.8\textwidth]{senior}\caption{Image}\label{fig:image}\end{figure} text texttexttexttexttexttexttexttext text text text text text v v v v v vtexttexttexttexttexttexttexttexttext \end{document}

here you go

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
Do you mean by margin after the figure the white space below the figure, or the paragraph indentation?

figure.png (4.47 KiB) Viewed 6732 times

The first one is pretty normal, the latter is also normal, since a new paragraph starts. It's width is caused by:

\setlength{\parindent}{20pt}

You could set it to 0pt if you don't want paragraph indentation.

However it seems to me that the whole LaTeX template is old, outdated or just bad, as I can see in the preamble code. Perhaps have a look a latex-templates.com for a newer one.

Stefan

Maxim22
Posts: 3
Joined: Sat Jan 05, 2013 4:26 pm
thank you, it was the paragraph indentation. I find it weird because it was the only place where I had the problem, not with the other paragraphs...

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Maxim22 wrote:I find it weird because it was the only place where I had the problem, not with the other paragraphs...

I'm quite surprised by that since it really is the default behaviour! See the following example:

\documentclass{article} \begin{document} This is a paragraph which is indented like it is the default for most documentclasses. This is a paragraph which is indented like it is the default for mostdocument classes. This is a paragraph which is indented like it is the defaultfor most document classes. This is a paragraph which is indented like it is the default for most documentclasses. This is a paragraph which is indented like it is the default for mostdocument classes. This is a paragraph which is indented like it is the defaultfor most document classes. \section{A section title}This is a paragraph which is not indented like because it follows a sectiontitle. This is normal for most document classes but may change if one usesspecific language settings. This is a paragraph which is indented like it is the default for most documentclasses. This is a paragraph which is indented like it is the default for mostdocument classes. This is a paragraph which is indented like it is the defaultfor most document classes.\end{document}

paragraphs.png (57.04 KiB) Viewed 6729 times

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim