I am soooo lost! have no idea why I keep getting this error. I have tried almost every combination of subfigure, float, centering but I keep getting "Not in outer par mode" error
\begin{figure}[htp]
% \centering
\noindent\makebox[\textwidth]{
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{img/preproc_1.png}
\caption{Raw Image}
\label{fig:preproc_1}
\end{subfigure}%
~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.
%(or a blank line to force the subfigure onto a new line)
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{img/preproc_2.png}
\caption{Gaussian Smoothing}
\label{fig:preproc_2}
\end{subfigure}
~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.
%(or a blank line to force the subfigure onto a new line)
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{img/preproc_3.png}
\caption{Eigenvalues}
\label{fig:preproc_3}
\end{subfigure}
\caption{Visualization of the preprocessing procedure} \label{fig:preprocessing}
\end{figure}
Best Answer
Your code nearly works, but there's no need for the following line
I've put it together as a complete MWE below- remove the
demo
option fromgraphicx
when you want the images back in.