I am currently writing my thesis in LaTeX. Today, all of a sudden, LaTeX started crashing. All the figures which contain a subfigure (NOTE: I am using the subcaption package) started receiving the following error:
Illegal unit of measure (pt inserted). \begin{subfigure}[b]{0.4\textwidth}
Also receiving other errors such as:
Missing number, treated as zero. \begin{subfigure}[b]{0.4\textwidth}
and
\begin{figure} on input line 170 ended by \end{subfigure}. \end{subfigure}
Below is an example of the code I'm using to generate subfigures.
\begin{figure}[htbp!] % h t b p ! H for positioning of floats
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{CRMBuffetPSD5deg00eta0600}
\caption{$\alpha$ = 5.0 \dg}
\label{subfig:CRMBuffetPSD5deg00}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{CRMBuffetPSD6deg00eta0600}
\caption{$\alpha$ = 6.0 \dg}
\label{subfig:CRMBuffetPSD6deg00}
\end{subfigure}
\begin{center}
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{CRMBuffetPSD6deg50eta0600}
\caption{$\alpha$ = 6.5 \dg}
\label{subfig:CRMBuffetPSD6deg50}
\end{subfigure}
\end{center}
\caption{Surface $C_{P}$ response at $\eta$ = 0.6, and various incidences}
\label{fig:CRMBuffetUnsteadyPSD}
\end{figure}
The code worked fine for a significant period of time, today whilst writing I started getting this error. Closing and reopening LaTeX does not fix the issue.
I looked online already and it seems that the only solution found so far was to use the subcaption environment which I already do. Any other tips that could help me start troubleshooting this?
Thanks.
EDIT: I am using the Cambridge PhD thesis template. EDIT: Error disappears when not using the thesis template anymore. This is undesirable though