I am trying to insert images in jpeg format and I am able to get the images in the document but cannot place them right. The image is placed at the center of the document and cropped on the right side.
Here is my latex file commands
\documentclass{article}
\usepackage[pdftex]{graphicx}
\begin{document}
My Dog Krishna
\begin{figure}
\begin{center}
\includegraphics[scale=0.40]{C:/Documents and Settings/KRISHNA/My Documents/My Pictures/DSCN3118.JPG}
\end{center}
\end{figure}
\end{document}
when i do this I get only part of the figure. As you can see I have decreased the scale of the image to 40% to fit the page.
I have attached the zipped version of the pdf generated using MikteX (The pdf itself was larger than 256kb so cant attach it as it is)
Also the document shows the location of the image. how do i get rid of that.
what am I doing wrong?
General ⇒ inserting JPEG image in MIKTEX
inserting JPEG image in MIKTEX
- Attachments
-
- figure template.rar
- (253.51 KiB) Downloaded 812 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
inserting JPEG image in MIKTEX
Avoid blank spaces in both the name and the path of file. You can omit the pdftex driver option for the graphicx package (not related to the problem).
Best regards
Thorsten¹
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
inserting JPEG image in MIKTEX
I tried avoiding the blank spaces in the file path. i just changed the path fromlocalghost wrote:Avoid blank spaces in both the name and the path of file. You can omit the pdftex driver option for the graphicx package (not related to the problem).
Best regards
Thorsten¹
\includegraphics[scale=0.5]{C:/Documents and Settings/KRISHNA/My Documents/My Pictures/krishna/Krishna.JPG}
to
\includegraphics[scale=0.5]{C:/DocumentsandSettings/KRISHNA/MyDocuments/MyPictures/krishna/Krishna.JPG}
and now latex is not recognizing the location of the file. Is there a way to do it.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: inserting JPEG image in MIKTEX
With "avoid blank spaces" I didn't mean "delete blank spaces" in the name and the path of a file. You have to choose a path the doesn't contain any blank spaces. Just deleting them in the argument makes no sense. The best is to put the graphics files in a subdirectory of your source files.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
inserting JPEG image in MIKTEX
Hi rajaijah,
I just want to annotate you may use \centering inside the figure environment instead of \begin{center} ... \end{center}. The latter may cause unwanted vertical space before and after.
Btw. you can read in the graphicx manual about inclusion of images.
Stefan
I just want to annotate you may use \centering inside the figure environment instead of \begin{center} ... \end{center}. The latter may cause unwanted vertical space before and after.
Btw. you can read in the graphicx manual about inclusion of images.
Stefan
inserting JPEG image in MIKTEX
stefanStefan_K wrote:Hi rajaijah,
I just want to annotate you may use \centering inside the figure environment instead of \begin{center} ... \end{center}. The latter may cause unwanted vertical space before and after.
Btw. you can read in the graphicx manual about inclusion of images.
Stefan
the pdf file abt graphics solved my problem. I needed to include
\graphicspath
and specify the location in preamble
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
inserting JPEG image in MIKTEX
Why this command should not be used can be read in l2tabu.rajaijah wrote:the pdf file abt graphics solved my problem. I needed to include
\graphicspath
and specify the location in preamble
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10