Struggling to Include a .jpg Picture in my Report

In summary: However, if you use backslashes, it appears as though latex is trying to interpret the backslashes as commands (e.g. \includegraphics{C:/Users/Raj/Desktop/weldfig/file.png}). So, if you are having trouble locating the file, it may be helpful to use just the name of the file.
  • #1
rama1001
132
1

Homework Statement


I want to include a .jpg picture in my report and got struck here form two days. I tried in the following way and i included all headers like graphicxs so on.

Homework Equations



\par
\begin{figure}[h]
\centering
\includegraphics[width=13cm,height=7cm]{C:\Users\Raj\Desktop\weldfig\Generalseamweldingprinciple.jpg}
\caption{Generalseamweldingprinciple}
\label{fig1.1:General spot welding principle}
\end{figure}

The Attempt at a Solution



It always displaying a blank box with name in middle as "C:.jpg"

BTW, i am doing Latex->PDF convesrtion.

Thank you.
 
Physics news on Phys.org
  • #2
What are you using for compiling? You should probably use pdflatex.
 
  • #3
No,

i am using TeXniCcenter. I has been irritating all the day.
 
  • #4
I've never used that, but there is probably some kind of preferences window. Check from there what program you are using for compiling the .tex-file. There may even be a pdflatex-option there. Try that instead if you can find it. You can also try changing the file type to png.
 
  • #5
If that's the error message you are getting, my guess is that it is having trouble locating the file (because you are using backslashes to indicate the file name, but in latex backslashes are reserved for commands). Try moving it to the same directory as the .tex file, and just putting the name of the file only, inside the braces. Or, try using forward slashes in the file location.
 
  • #6
For the record, does it work to give the entire path to the file at all (with correct slashes etc.), or does the file have to be in the same folder as the .tex-file? Or does one, in the case where the file is not in the same folder, have to add the path to the folder where it is located via \addgraphicspath{..}?
 
  • #7
kloptok said:
For the record, does it work to give the entire path to the file at all (with correct slashes etc.), or does the file have to be in the same folder as the .tex-file? Or does one, in the case where the file is not in the same folder, have to add the path to the folder where it is located via \addgraphicspath{..}?

I had used \includegraphics with a file in a subdirectory, i.e. by using \includegraphics{subdir/file.png}, prior to answering the question. I just now tried using an absolute directory, and I can confirm it does work if you use forward slashes.
 

Related to Struggling to Include a .jpg Picture in my Report

What is a .jpg picture?

A .jpg (or JPEG) is a type of image file format that is commonly used to store and display photographs and other digital images. It is a compressed file format that allows for high quality images with relatively small file sizes.

Why am I struggling to include a .jpg picture in my report?

There could be a few reasons why you are having trouble including a .jpg picture in your report. It could be due to compatibility issues with the software or program you are using, or there may be an issue with the file itself. It is also possible that there are formatting or size restrictions for images in your report that you need to follow.

How can I include a .jpg picture in my report?

The process for including a .jpg picture in your report may vary depending on the software or program you are using. Generally, you can insert the image by selecting the "Insert" or "Image" option in the toolbar and then selecting the .jpg file from your computer. You may also need to adjust the image size or formatting to fit your report's requirements.

Do I need to cite a .jpg picture in my report?

If the .jpg picture is not your own original creation, it is important to cite the source of the image in your report. This includes providing the creator's name, title of the image, date, and any other relevant information. Plagiarism is a serious offense, so it is important to properly cite all sources used in your report.

Are there any alternatives to using a .jpg picture in my report?

Yes, there are many other image file formats that you can use in your report, such as .png, .gif, or .bmp. These formats may have different features and capabilities, so it is important to choose the best one for your specific needs. Additionally, you can also create your own original images or use graphs and charts to represent data in your report instead of using a picture.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
Back
Top