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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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.
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.
\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}
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.
\documentclass{article}
\begin{document}
This is a paragraph which is indented like it is the default for most document
classes. This is a paragraph which is indented like it is the default for most
document classes. This is a paragraph which is indented like it is the default
for most document classes.
This is a paragraph which is indented like it is the default for most document
classes. This is a paragraph which is indented like it is the default for most
document classes. This is a paragraph which is indented like it is the default
for most document classes.
\section{A section title}
This is a paragraph which is not indented like because it follows a section
title. This is normal for most document classes but may change if one uses
specific language settings.
This is a paragraph which is indented like it is the default for most document
classes. This is a paragraph which is indented like it is the default for most
document classes. This is a paragraph which is indented like it is the default
for most document classes.
\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p