Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add a jpg image in Latex

I want to insert a .jpg image(that is in my current folder, where the .tex file is) after a paragraph. How can I do it in Latex? What should I include / what commands should I use?

like image 738
qwerty Avatar asked Jun 28 '10 16:06

qwerty


People also ask

How do I insert a JPEG into overleaf?

In the top left corner of the editor click on the upload icon, then you can either drag and drop the files or click Select files(s) to browse in your local directories. After the uploading process is complete, you can use these images in your document.

How do you put an image in a path in LaTeX?

Latex can not manage images by itself, so we need to use the graphicx package. To use it, we include the following line in the preamble: \usepackage{graphicx} . The command \graphicspath{ {./images/} } tells LaTeX that the images are kept in a folder named images under the directory of the main document.

How do you insert a picture into LaTeX texmaker?

To insert a picture in your document, just use the "\includegraphics" command in the "LaTeX" menu. Then, click on the "browser" button in the dialog to select the graphic file. Note : if you click on the "+" button, a "figure" LaTeX environment will be added automatically.


2 Answers

You need to use a graphics library. Put this in your preamble:

\usepackage{graphicx} 

You can then add images like this:

\begin{figure}[ht!] \centering \includegraphics[width=90mm]{fixed_dome1.jpg} \caption{A simple caption \label{overflow}} \end{figure} 

This is the basic template I use in my documents. The position and size should be tweaked for your needs. Refer to the guide below for more information on what parameters to use in \figure and \includegraphics. You can then refer to the image in your text using the label you gave in the figure:

And here we see figure \ref{overflow}. 

Read this guide here for a more detailed instruction: http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions

like image 166
Jonno_FTW Avatar answered Sep 29 '22 15:09

Jonno_FTW


if you add a jpg,png,pdf picture, you should use pdflatex to compile it.

like image 24
威武君 Avatar answered Sep 29 '22 16:09

威武君