I am trying to put two figures side by side and keep getting these two errors:
Missing number treated as zero.
Illegal unit of measure.
The only way I don't get them is if I comment the {0.5\textwidth}
. However if I comment it the figures stay one under the other.
\begin{figure}
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=0.4\linewidth]{Figuras/SICAPI2014.eps}
\caption{SICAPI}
\label{fig.SICAPI}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=0.4\linewidth]{Figuras/painel_sicapi.eps}
\caption{Painel de operação}
\label{fig.painel_sicapi}
\end{subfigure}
\caption{Planta Piloto SICAPI}
\label{fig.sicapi}
\end{figure}
Best Answer
As @Bernard say in his comment, blank lines between sub figures tell to LaTeX: "Put them each in own line". In similar cases I wrote as follows:
I didn't check where arise errors about which you complain. In above example they are not presented. How to use
subfigure
se package documentation or brief description in Wikibooks: LaTeX/Floats, Figures and Captions.