I am trying to compile a document with two subfigures, one above the other in the centre of the page. However, the first image is offset to the left by a noticeable amount. Why is this? What should I do to correct this? An example is as follows:
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{figureexample}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\maketitle
\begin{figure}[h]
\centering
\captionsetup{justification=centering}
\subfloat[caption a ]{%
\includegraphics[scale=1]{universe.jpg}%
\label{slopeideal}
}
\newline
\subfloat[caption b]{%
\includegraphics[scale=1]{universe.jpg}%
\label{slopereal}
}
\caption{caption main}
\end{figure}
\end{document}
Thanks in advance for your help.
\newlinewith an empty line. – leandriis Mar 11 '20 at 19:53\newlineis a very rarely used command. If you're used to it, then change your habits. – egreg Mar 11 '20 at 20:32