This question builds off on the question here Subfigures in subfigures in latex enter link description here
However, what I would like to have is an additional level of subcaptions for the individual figures. Say, I would like (i) and (ii) for each of the figures in (a) and (b).
I tried modifying the code as follows:
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{.4\textwidth}
\centering
\includegraphics[width=.4\textwidth]{example-image}
\subcaption{fig. (i)}
\includegraphics[width=.4\textwidth]{example-image}
\subcaption{fig. (ii)}
\caption{My compound subfigure (a)}
\end{subfigure}\quad
\begin{subfigure}[b]{.4\textwidth}
\centering
\includegraphics[width=.4\textwidth]{example-image}
\subcaption{fig. (i)}
\quad
\includegraphics[width=.4\textwidth]{example-image}
\subcaption{fig. (ii)}
\caption{My compound subfigure (b)}
\end{subfigure}
\caption{A caption}
\end{figure}
\end{document}
But this was not correct and gave me the following:
Any suggestions on how I get the second layer of subcaptioning inside the subfigures?
Update: I would like to have (i) and (ii) in each subfigure side-by-side. Also, is it possible to automate the (i) and (ii), etc, this more for general reference for later generations?