LaTeX forum ⇒ GeneralHow do I add a jpeg picture to Latex

LaTeX specific issues not fitting into one of the other forums of this category.
akira32
Posts: 45
Joined: Tue Nov 13, 2007 10:32 am

Re: How do I add a jpeg picture to Latex

Postby akira32 » Thu Jun 19, 2008 2:26 pm

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!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Jun 19, 2008 2:39 pm

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
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

stinger
Posts: 1
Joined: Fri Sep 05, 2008 5:05 pm

Postby stinger » Fri Sep 05, 2008 5:22 pm

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:
  1. \begin{figure}[htbp]
  2. \centering
  3. \begin{minipage}[t]{3 in}
  4. \includegraphics[width=0.9\textwidth]{./figures/test1.jpg}
  5. \caption{Test 1}
  6. \label{fig:test1}
  7. \end{minipage}
  8. \hspace{.3in}
  9. \begin{minipage}[t]{3 in}
  10. \includegraphics[width=0.9\textwidth]{./figures/test2.jpg}
  11. \caption{Test 2}
  12. \label{fig:test2}
  13. \end{minipage}
  14. \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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Sep 05, 2008 6:10 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 7 guests