1

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.

UNAnon
  • 13

1 Answers1

1

To remove the alignment issue, simply replace \newline with an empty line.

leandriis
  • 62,593