Featured Book

LaTeX Beginners Guide

Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 17 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

How do I add a jpeg picture to Latex

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

Re: How do I add a jpeg picture to Latex

Postby akira32 on Thu Jun 19th, 2008

Stefan_K wrote:
akira32 wrote:I add the jpeg file successfuly with the build option of "LaTex=>PS=>PDF".


That's not the right profile. Do really you have not LaTeX=>PDF od didn't you try that?
With LaTeX=>PDF (that's pdflatex) you will get color and you won't need a bounding box.

Stefan


If I use the LaTex=>PDF option with the line " \includegraphics{test.jpg} ", then it appears the error as below:
LaTex Error: Cannot determine size of graphic in test.jpg (no BoundingBox).

If I use the LaTex=>PDF option with the line " \includegraphics[width=\textwidth , bb= 20 20 575 575]{test.jpg} ", then the picture do not show in the pdf.

If I use the LaTex=>PS=>PDF option with the line " \includegraphics{test.jpg} ", then it appears the error as below:
LaTex Error: Cannot determine size of graphic in test.jpg (no BoundingBox).

But I use the LaTex=>PS=>PDF option with the line " \includegraphics[width=\textwidth , bb= 20 20 575 575]{test.jpg} " , then I can see the gray-level color jpg in the pdf. The jpg file is colorful originally.

My LaTex project(template created by my classmate) is created by using the eps files at many places. But I hope I can use the jpg file in LaTex. I think that do I shall create a new project to restart. If I do that, it will spent much time, I just have a week to write my paper.

Thank you!
akira32
 
Posts: 45
Joined: Tue Nov 13th, 2007

Re: How do I add a jpeg picture to Latex

Postby Stefan_K on Thu Jun 19th, 2008

Check your output profile, in the menu click Build->Define output profiles, choose LaTeX=>PDF, it should look like this: link
(the marked -shell-escape is not needed!) I cannot make a screenshot myself because I don't have Windows installed.

Important is, that the path to the LateX compiler shows pdflatex, not latex.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6515
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: How do I add a jpeg picture to Latex

Postby stinger on Fri Sep 5th, 2008

Hello, I'm new here and had a problem similar to the original poster, and didn't want to start a new thread.

I have included the "graphicx" package and am trying to include a .jpg picture (actually, 2 jpgs side by side) into my document.

this is my code:
Code: Select all  •  Open in writeLaTeX
\begin{figure}[htbp]
\centering
  \begin{minipage}[t]{3 in}
   \includegraphics[width=0.9\textwidth]{./figures/test1.jpg}
    \caption{Test 1}
    \label{fig:test1}
\end{minipage}
\hspace{.3in}
\begin{minipage}[t]{3 in}
  \includegraphics[width=0.9\textwidth]{./figures/test2.jpg}
  \caption{Test 2}
  \label{fig:test2}
\end{minipage}
\end{figure
}


this is the error message:
Cannot determine size of graphic (no BoundingBox)


To compile, I was told to do this:
Click "LaTex" - wait until it finishes.
Click "LaTex" again and wait until completion.
Click "DVI --> PS"
Click "PS --> PDF"


I'm new to LaTex so I'm pretty much just following the directions I've been given
Any help would be greatly appreciated.

Thanks, Tony
stinger
 
Posts: 1
Joined: Fri Sep 5th, 2008

Re: How do I add a jpeg picture to Latex

Postby localghost on Fri Sep 5th, 2008

Unfortunately, you have been given the wrong advices. latex only accepts graphics files in EPS format. To include your your JPG (or PNG or PDF) graphics files, you have to compile with pdflatex (LaTeX -> PDF). This only would require the first two steps of the procedure and you will get directly PDF output without any detour. But this will only work when not using special packages working with Postscript code like PSTricks. For more basic information you can take a look at our "LaTeX Resources for Beginners" (first sticky topic in this subforum).


Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 17 guests