# Longtable and figure caption problems

I am trying to define captions in longtable enviroment. According to Adding a caption to a graphic inside a longtable I should define:

\makeatletter
\def\figcaption{%
\refstepcounter{figure}%
\@dblarg{\@caption{figure}}}
\makeatother


and then use

 \figcaption{my caption}


However defining \figcaption produce the following error in texstudio: "Illegal parameter number in definition of \figcaption." I think there is a conflict with some package... maybe hyperref ? What can I do?

EDIT

Thanks to David Carlisle there was a missing '}' However, corrected the definition, and adding

\figcaption{lol}


after

\includegraphics[keepaspectratio,width=0.1\linewidth]{image}


gives a new errors: You can't use \hrule' here except with leaders. \figcaption{lol} Missing number, treated as zero. \figcaption{lol} Illegal unit of measure (pt inserted). \figcaption{lol} Missing \endgroup inserted. \figcaption{lol} ....

What happened??

• Please provide a full MWE that generates the problem behavior you're looking to fix. Please be sure to state which TeX distribution you use, which packages you load, and a minimal longtable environment that contains a \figcaption statement. – Mico Apr 8 '15 at 2:35
• Your sample definition is missing a closing } it has four { and only three } – David Carlisle Apr 8 '15 at 7:36
• hmm Just saw where you copied that from:-) I fixed it there. – David Carlisle Apr 8 '15 at 7:38

\parbox{5cm}{
`