General ⇒ How do I add a jpeg picture to Latex
How do I add a jpeg picture to Latex
What command should I use?
Could somebody tell me the code an detail?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
How do I add a jpeg picture to Latex
you should load the graphicx package and use \includegraphics. Here is a very basic example:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\begin{document}
Here is an example:
\begin{center}
\includegraphics{test.jpg}
\end{center}
\end{document}
Concerning \includegraphics you will find more information in the graphicx documentation.
Stefan
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How do I add a jpeg picture to Latex
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How do I add a jpeg picture to Latex
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{center}
\includegraphics{test.jpg}
\end{center}
\end{document}
The 4 errors are in the jpeg4error.JPG in Attachments.
- Attachments
-
- add test.jpg, it appears 4 errors
- jpeg4errors.JPG (47.39 KiB) Viewed 9287 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
How do I add a jpeg picture to Latex
the example I gave above is a complete compilable document, you should not insert that complete code into your own document. In your document you can insert the picture just by
Code: Select all
\includegraphics{test.jpg}
Code: Select all
\begin{center}
\includegraphics{test.jpg}
\end{center}
Code: Select all
\usepackage{graphicx}
Stefan
Re: How do I add a jpeg picture to Latex
- Attachments
-
- a error in adding jpeg file
- latex_jpg.JPG (13.8 KiB) Viewed 9270 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: How do I add a jpeg picture to Latex
You should compile directly into pdf format, not to dvi, then it will work. If you use TeXnicCenter, choose the output profile LaTeX => PDF. If you use WinEdit then choose the PDFTeXify (or PDFLaTeX) button. Or tell us, which editor you are using.
Stefan
How do I add a jpeg picture to Latex
I forget add the bounding box. But it still cannot show the jpeg file in my Latex.
Becuase my Latex project is created by my classmate.
I am a beginner. Now I try to create a new report project and try to add the jpeg file.
Re: How do I add a jpeg picture to Latex
But the jpeg file becomes a gray-level picture in pdf.
- Attachments
-
- test1-gray-level in pdf
- test1-gray.JPG (1.43 KiB) Viewed 9223 times
-
- tes1.jpg colorful (original)
- test.JPG (1.39 KiB) Viewed 9224 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
How do I add a jpeg picture to Latex
That's not the right profile. Do really you have not LaTeX=>PDF od didn't you try that?akira32 wrote: I add the jpeg file successfuly with the build option of "LaTex=>PS=>PDF".
With LaTeX=>PDF (that's pdflatex) you will get color and you won't need a bounding box.
Stefan