[Tex/LaTex] Insert a picture in Texmaker

graphics

I am trying to insert a picture using the command \includegraphics and it does not appear anything in the document. The image I am trying to insert is in JPG format and it is inside the same folder of the TEX document. When I am trying to insert it I have this error.

enter image description here

What am I doing wrong?
Thanks for your attention.

Best Answer

As far as I understand, you have missed a few lines while defining the figure. I would normally do it as follows:

\documentclass[a4paper,11pt]{elsarticle} % article for Elsevier
\usepackage{graphicx} % need this package

\begin{document}
\begin{figure}[htbp] % htbp stand for "here", "top", "bottom", "page"
\includegraphics[scale=1]{yourfigure.jpg} 
\end{figure}
\end{document}

Try using these lines and also by including the graphics package \usepackage{graphicx} after the \documentclass command and you should be fine. Also make sure you are using pdflatex and that name of the figure is exactly matched. I hope this helps.

Thank you, Harsha.

Related Question