Whenever I am trying to use the subfigure
or the algorithm2e
package using \usepackage
command, it is showing
LaTeX Error: Can be used only in preamble.
What is the problem and how to get rid of it. If there is any substitute for the two packages without using the above ones, kindly let me know.
Best Answer
If your document looks like
then you get the error
showing that the problem is the
\usepackage
on line 5, which should be in the preamble (that is, before\begin{document}
0 so changing the file toit runs without error.