Generalinserting JPEG image in MIKTEX

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
rajaijah
Posts: 5
Joined: Wed Mar 26, 2008 10:55 pm

inserting JPEG image in MIKTEX

Post by rajaijah »

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?
Attachments
figure template.rar
(253.51 KiB) Downloaded 810 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

inserting JPEG image in MIKTEX

Post by localghost »

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¹
rajaijah
Posts: 5
Joined: Wed Mar 26, 2008 10:55 pm

inserting JPEG image in MIKTEX

Post by rajaijah »

localghost 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¹
I tried avoiding the blank spaces in the file path. i just changed the path from
\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.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: inserting JPEG image in MIKTEX

Post by localghost »

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.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

inserting JPEG image in MIKTEX

Post by Stefan Kottwitz »

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
rajaijah
Posts: 5
Joined: Wed Mar 26, 2008 10:55 pm

inserting JPEG image in MIKTEX

Post by rajaijah »

Stefan_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
stefan

the pdf file abt graphics solved my problem. I needed to include
\graphicspath
and specify the location in preamble
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

inserting JPEG image in MIKTEX

Post by localghost »

rajaijah wrote:the pdf file abt graphics solved my problem. I needed to include
\graphicspath
and specify the location in preamble
Why this command should not be used can be read in l2tabu.
Post Reply