[Tex/LaTex] Side-by-side images in LaTeX

floatrowfloatsgraphicstexmaker

I need to put 2 figures side by side in LaTeX where the first figure needs to be given a caption and the second must not be given a caption.
I have tried the following:

\usepackage{floatrow}

\begin{figure}[!h]
\begin{floatrow}
\ffigbox{\includegraphics[scale = 0.8]{Figure3}}{\caption{PTST based on total duration}\label{case1}}
\ffigbox{\includegraphics[scale = 0.8]{app1}}{\caption{A zoom}\label{zoom}}
\end{floatrow}
\end{figure}

but I am getting the error do not use float package with float row since I also have \usepackage{float} for other images (I need this).

Best Answer

You can use the subcaption package.

Try something like this.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{subcaption}


\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.49\textwidth}
\centering
\includegraphics[width = \textwidth]{tikzexample2.png}
\caption{Left figure}
\label{fig:left}
\end{subfigure}
\begin{subfigure}{0.49\textwidth}
\centering
\includegraphics[width = \textwidth]{tikzexample2.png}
\caption{Right figure}
\label{fig:right}
\end{subfigure}
\caption{Combined figure}
\label{fig:combined}
\end{figure}
\end{document}

It yields the following output.

output example