I'm adding captions for pictures but it shows this error :
\caption outside float. }
My code is like this
\begin{center}
\href{http://m.technologijos.lt/cat/7994/article/S-18917}{
\includegraphics[scale=1]{2}\\
\caption{Pav. 2}
}
\end{center}
What is wrong here and what i should fix ?
Best Answer
You have two issues with your code:
\href
can not be nested\caption
figure
\caption{...}
cannot be used. Instead of it you can use\captionof{figure}{...}
. For this you need to use packagecaption
orcapt-of
.Correct code for both cases: