I use the report class, and the caption package to get the result:

\usepackage[hang,small,bf]{caption}
\setlength{\captionmargin}{20pt}
and I get the error message :
LaTeX Error : Option clash for package option.
The package caption has already been loaded with options:
[hang,small,bf]
There has now been an attempt to load it with options
[options]
Adding the global options:
hang,small,bf,options
to your \documentclass declaration may fix this.
Try typing <return> to proceed.
I put the latex command in the lyx preamble and get that error message. the code works well in TeXmaker, but get the error message in Lyx. the code for compile in TeXmaker :
\documentclass{report}
\usepackage[hang,small,bf]{caption}`
\setlength{\captionmargin}{20pt}`
\begin{document}
\begin{figure}
\caption{hbcshjjjjjjjjjjjjbndhjfgcbdrhhhhhhhhhhhf jhcjdfbchdg jkhcdbfjdb jhdfcbdfgdh hgfhjcbhd jdfhdjhdjnj jhfhdjbdhjd jkdfhdvbjh jdfhvjgjfgjg hjdfcdfbhdg}`
\includegraphics[5cm]{pics/logo.png}`
\end{figure}
\end{document}
end the result is below ;
