I was trying to include multiple plots with the following in Texshop in my mac:
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{l1.jpg}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{l1.jpg}
\caption{$y=3sinx$}
\label{fig:three sin x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{l1.jpg}
\caption{$y=5/x$}
\label{fig:five over x}
\end{subfigure}
\caption{Three simple graphs}
\label{fig:three graphs}
\end{figure}
It didn't work and the console said:
Latex Error:
Environment subfigure undefined.
Type H<return> for immediate help.
...
l.368 \begin{subfigure}[b]{0.3\textwidth}
? H
Your command was ignored.
Type I <command> <return> to replace it with another command, or <return> to continue without it.
?
It says my command was ignored. why?
I check, the latex file and the files are correctly named and in the correct location.
Aucun commentaire:
Enregistrer un commentaire