GeneralInserting PNG graphics

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

Inserting PNG graphics

Post by tripwire45 »

On the document I've been working on for most of last week, I've been using PS graphics, just because they're easy to include and I needed something to fill that space, while I was solving other issues. Unfortunately, they look like heck, and I'd rather use PNG formatted graphics.

As usual, my Googling hasn't always been successful (not that I'll stop looking for the answer) and I can't figure out how to get the document to compile. I've been reading the following tutorial without success:

http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics

It seems to indicate that this should be a relatively simple task, but I'm not getting it. I'm creating the document in Kile, if that makes a difference. According to the tutorial, the PNG format is supported if the document is compiled using PDFLaTeX. In Kile, I have done this by selecting Build -> Compile -> PDFLaTeX. The result is a bunch of errors stating that the names of the graphics are not found.

The names are the same as the PS formatted graphics. I moved the .tex file to a folder containing the PNG files to test the process, so the "path" should be correct. I have \usepackage{color,graphicx} in the preamble. What am I missing.

Thanks.

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Inserting PNG graphics

Post by Stefan Kottwitz »

Hi,

could you please post your .log file? It could be easier to find the problem by reading that.

Stefan
User avatar
tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

Re: Inserting PNG graphics

Post by tripwire45 »

Oh duh. Got is sorted. Actually, I made two mistakes.

The first is that I didn't realize that I would need to include the PNG extension and the second was that I didn't realize it was case-sensitive. The graphics were saved as "PNG" while I was using "png" in the actual document.

Ok, now I can generate a PDF with the PNG graphics imported. Is there a way to get this doc from PDF to other formats such as HTML? Seems I read something about that, but I got hung up on this last issue that I didn't focus on those details.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Inserting PNG graphics

Post by Stefan Kottwitz »

Hi,

from tex to html might be easier than from tex over pdf to html.
Here you can find a list to tools for conversion of tex to html. I did not need it until now, so I cannot recommend one of them.

Stefan
Post Reply