# Can't Find what's causing the error in this code, trying to insert a figure

\documentclass[12pt]{article}

\usepackage{cite}

\usepackage[UKenglish]{babel}
\usepackage{fixltx2e}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage{chngcntr}
\counterwithin{figure}{section}

\usepackage[labelfont=bf]{caption}
\captionsetup{font=small}

\usepackage[font=small]{subcaption}

\usepackage{float}

\usepackage{titling}
\setlength{\droptitle}{-2cm}
\predate{}
\date{}
\postdate{}
\begin{document}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{example-image}
\caption{Theoretical model of erbium excitation by sensitization through
organic ligand, occuring as follows:
\begin{enumerate}
\item Organic ligand (singlet) groundstate, 'S$_{0}$', is excited to the 1st
singlet excited state, 'S$_{1}$' by the absorbtion of a photon.
\item In some cases the ligand de-excites, emitting a photon, flourescing,
in some cases energy transfers from the 1st singlet excited state to the
erbium, subsaquently:
\begin{enumerate}
\item The erbium de-excites, by non-radiative transition, to a lower excited
(4f orbital) state.
\item By induced electric dipole transition, the erbium de-excites, emitting
the desired 1.5$\mu$m wavelength emission.
\end{enumerate}
\item In other cases the organic ligand transitions from 1st excited singlet
state to 1st excited triplet state, 'T$_{1}$', by some inter-system-crossing
mechanism (ISC) where a photon may be emitted, (with a long decay time)
phosphorescing, or the energy transfers from the 1st excited triplet state
to the erbium.
\item The erbium de-excites, by non-radiative transition, to a lower excited
(4f orbital) state.
\item By induced electric dipole transition, the erbium de-excites, emitting
the desired 1.5$\mu$m wavelength emission.
\end{enumerate}}

\label{fig:1.2}
\end{figure}

\end{document}


\caption isn't really intended for such long texts but if you suppress the check for it being one line (nooneline option) and provide a shorter caption for the list of figures, then it works

Note however with the sample image that I used, it's too large for the page

latex warns

 Overfull \vbox (79.45732pt too high) has occurred while \output is active


You could reduce the text or use a smaller font. or scale the image more to make more room or ....

\documentclass[12pt]{article}

\usepackage{cite}

\usepackage[UKenglish]{babel}
%\usepackage{fixltx2e}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage{chngcntr}
\counterwithin{figure}{section}

\usepackage[labelfont=bf,nooneline]{caption}
\captionsetup{font=small}

\usepackage[font=small]{subcaption}

\usepackage{float}

\usepackage{titling}
\setlength{\droptitle}{-2cm}
\predate{}
\date{}
\postdate{}
\begin{document}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{example-image}
\caption[short caption for the list of figures]{Theoretical model of erbium excitation by sensitization through
organic ligand, occuring as follows:
\begin{enumerate}
\item Organic ligand (singlet) groundstate, 'S$_{0}$', is excited to the 1st
singlet excited state, 'S$_{1}$' by the absorbtion of a photon.
\item In some cases the ligand de-excites, emitting a photon, flourescing,
in some cases energy transfers from the 1st singlet excited state to the
erbium, subsaquently:
\begin{enumerate}
\item The erbium de-excites, by non-radiative transition, to a lower excited
(4f orbital) state.
\item By induced electric dipole transition, the erbium de-excites, emitting
the desired 1.5$\mu$m wavelength emission.
\end{enumerate}
\item In other cases the organic ligand transitions from 1st excited singlet
state to 1st excited triplet state, 'T$_{1}$', by some inter-system-crossing
mechanism (ISC) where a photon may be emitted, (with a long decay time)
phosphorescing, or the energy transfers from the 1st excited triplet state
to the erbium.
\item The erbium de-excites, by non-radiative transition, to a lower excited
(4f orbital) state.
\item By induced electric dipole transition, the erbium de-excites, emitting
the desired 1.5$\mu$m wavelength emission.
\end{enumerate}}

\label{fig:1.2}
\end{figure}

\end{document}