I have below code available in LaTeX, I want to add caption in \begin{forest}
please suggest how to do the same.
\documentclass[review]{elsarticle}
\usepackage[edges]{forest}
\begin{document}
\begin{figure}
\begin{forest}
for tree={
align=center,
parent anchor=south,
child anchor=north,
font=\sffamily,
edge={thick, -{Stealth[]}},
l sep+=10pt,
edge path={
\noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) -- +(0,-5pt) -| (.child anchor)\forestoption{edge label};
},
if level=0{
inner xsep=0pt,
tikz={\draw [thick] (.south east) -- (.south west);}
}{}
}
% Some test here
\end{forest}
\caption{Tree}
\end{figure}
\end{document}
This code gives error as below:
Extra }, or forgotten \endgroup. \end{forest}