I try to insert the caption on side of a figure (such as the following fig), but I couldn't set it. How to set it? I have also seen: link and link.
\documentclass[review]{elsarticle}
\graphicspath{ {./figures/} }
\usepackage{hyperref}
\usepackage{float}
\usepackage{verbatim} %comments
\usepackage{apalike}
\restylefloat{figure}
\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage{lipsum,capt-of,graphicx}
\usepackage{geometry}% Just for this example
%\usepackage[authoryear,longnamesfirst]{natbib}
%\usepackage[authoryear]{natbib}
%\usepackage[numbers]{natbib}
\usepackage{natbib}
\let\printorcid\relax
\usepackage[wby]{callouts}
%\usepackage{cite}
\usepackage{ragged2e}
\usepackage{setspace}
%\usepackage{caption}
%\usepackage[font={footnotesize},labelfont=bf]{caption}
\usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false, font={footnotesize}]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period, justification=justified, singlelinecheck=off}
\captionsetup[table]{labelsep=newline,font=footnotesize, justification=justified, singlelinecheck=off}%,skip=0pt,belowskip=0pt}
%\setlength\abovecaptionskip{-5pt}
%\setlength{\heavyrulewidth}{3\lightrulewidth}
\usepackage{subcaption}
\usepackage{setspace}
%\renewcommand{\baselinestretch}{1.8}
%%%Author definitions
%%%
%\usepackage[flushleft]{threeparttable}
%\renewcommand\TPTtagStyle{\textit}
\usepackage{etoolbox}
\AtBeginEnvironment{table}{\sffamily}
\usepackage{booktabs,siunitx, multirow}
\sisetup{table-format=1.4, tight-spacing=true, separate-uncertainty}
\sisetup{
output-exponent-marker = \text{e},
exponent-product={},
retain-explicit-plus,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-align-text-pre = false,
table-align-text-post = false,
round-mode=places,
round-precision=2,
table-space-text-pre = (,
table-space-text-post = ),
}
\usepackage{amsmath}
\usepackage{adjustbox}
%\usepackage{floatrow}
%\floatsetup[table]{style=Plaintop}
%\setlength{\mathindent}{0pt}
%\makeatletter
%@dblfpsep=20pt
%\makeatother
\usepackage{array, cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\begin{document}
\begin{figure}[htb]
\centering
\begin{tabular}{cc}
\includegraphics[width=.4\textwidth]{example-image-a}
&
\includegraphics[width=.4\textwidth]{example-image-a}\
\includegraphics[width=.4\textwidth]{example-image-a}
&
\includegraphics[width=.4\textwidth]{example-image-a}\
\includegraphics[width=.4\textwidth]{example-image-a}
&\multicolumn{1}{b{.4\linewidth}}{\caption{Caption text coming here at the last position}}
\end{tabular}
\end{figure}
\end{document}
Also, I have checked the following code, but an error has occurred:
\begin{figure}
{\includegraphics[width=.48\textwidth,height=5cm]{example-image-a}}
{\includegraphics[width=.48\textwidth,height=5cm]{example-image-a}}\\
{\includegraphics[width=.48\textwidth,height=5cm]{example-image-a}}
{\includegraphics[width=.48\textwidth,height=5cm]{example-image-a}}\\
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,bottom},capbesidewidth=5.57cm}}]{figure}
{\caption{Caption text}\label{fig:test}}
{\includegraphics[width=.48\textwidth,height=5cm]{example-image-a}}
\end{figure}
Error:
! Package floatrow Error: Do not use float package with floatrow.
(floatrow) The latter will be skipped.
The problem is because of \usepackage{float} and \usepackage{floatrow}. While, I need to both of them: \usepackage{float} for caption of Tables and \usepackage{floatrow} for caption of figures. But, They are not compatible. How to solve it?


