When I was using \begin{figure}....\end{figure}
, I was able to fix the figure in the location using the [H]
, [h]
, or [h!]
options, but that doesn't work when I use SCfigure
. How do I fix a SCfigure
in place?
\documentclass[12 pt , twoside, a4paper] {article}
\usepackage[pdftex]{graphicx}
\usepackage{sidecap}
\begin{document}
\begin{SCfigure}
\includegraphics[scale=0.5]{EffectiveArea}
\caption{height of cylinder=v$\Delta$t \newline
volume of cylinder=$\pi (2r)^2(v\Delta t)$ \newline
number of collision per second=$\frac{N}{V_{molecule}}V_{cylinder}
\newline \quad \quad \quad \quad =\frac{N}{V_{molecule}}\pi (2r)^2(v\Delta t)$}
\end{SCfigure}
\end{document}
And the error is: ! LaTeX Error: \caption outside float
.
Best Answer
If you still want to use the old package
sidecap
, remember that the floating specifier is the second optional parameter ofSCfigure
, so you have to use it as, for example,if you want the
h
specifier.Also
sidecap
seems not to be compatible withfloat
, so theH
specifier cannot be used.MWE:
Output:
Otherwise you can switch to the
floatrow
package as mentioned in Bernard's comment and, issuing a command likeyou can obtain the same (probably better) result using the
figure
environment.MWE:
Output: