Graphics, Figures & TablesError: File not found!

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Christopher
Posts: 7
Joined: Sat Oct 04, 2008 4:02 pm

Error: File not found!

Post by Christopher »

Hi all,

I have a greenhorn problem here. I just cannot manage to include a figure in my tex document.

Code: Select all

\begin{figure}[htp]
\centering
\includegraphics{C:/Latex/Report/name.png/}
\caption{bla bla bla}\label{fig:name}
\end{figure}


the packages i use:

Code: Select all

\documentclass[a4paper,11pt]{report}
\usepackage{}
\usepackage{latexsym}
\usepackage{pdflscape}
\usepackage{examplep}
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage[latin1]{inputenc}
\usepackage{memhfixc}
I also tried different formats: pdf, ps, tif...nothing works

The directory C:/Latex/Report/ is also the location of the .tex file!

Thanks in advance!
Christopher

Recommended reading 2024:

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

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

Keta
Posts: 63
Joined: Tue Nov 25, 2008 1:00 pm

Error: File not found!

Post by Keta »

Hi Christopher,

If you omit the final slash, it will probably work. I just tried and the / gives indeed error. Besides, if the file is in the same directory as the latex file, you don't need to declare all the path, with \includegraphics{name.png} should suffice. In case the file is in a subdirectory of your file's directory, e.g. a "images" subdirectory containing all your graphic files, you can declare the relative path, i.e. \includegraphics{images/name.png}. Also, make sure you are using pdflatex instead of plain latex when using png, jpg and pdf images; latex only accepts eps format.

By the way, why are you using the memhfixc package? It is intended to be used with memoir document class and old versions of hyperref, and you don't even have hyperref loaded.

Hope this helped. Cheers,

Keta
Christopher
Posts: 7
Joined: Sat Oct 04, 2008 4:02 pm

Re: Error: File not found!

Post by Christopher »

Hi Keta,

thank you very much for the answer. It solved the problem. I am including an eps file at the moment, but I'd prefer to include png, pdf, ...

Can you specify in more detail what you meant, when you wrote about pdflatex in stead of plain latex?
This is not a package, right?

Thanks in advance,
Christopher
Keta
Posts: 63
Joined: Tue Nov 25, 2008 1:00 pm

Re: Error: File not found!

Post by Keta »

When you compile a document, you will normally use either LaTeX or pdfLaTeX. If you're using an editor you select which one are using with the appropriate button, e.g. if using TeXnicCenter selecting "LaTeX => DVI" in the output profile will compile with LaTeX, whereas selecting "LaTeX => PDF" will do it with pdfLaTeX. If compiling from console, you select which one to use writing "latex file.tex" or "pdflatex file.tex".

The first engine produces a DVI file, the second directly outputs a PDF. Actually, on modern distributions, they both use pdfTeX as the underlying engine, but they work different, so you have to take care with, for example, what kind of graphics you are including.

Some people here might give better explanation about how these two work. Regards,

Keta
Arezou
Posts: 2
Joined: Sun Jun 30, 2013 11:45 pm

Re: Error: File not found!

Post by Arezou »

Hi, I had the same problem.
remove the previous version of Texmaker and become sure that you install the portable version of Texmaker 4.0.2 for Windows. Just that worked for me.
elcio
Posts: 1
Joined: Wed Jun 25, 2014 5:00 pm

Re: Error: File not found!

Post by elcio »

I have a problem that I can't fix: the file's name always appears at the lower left corner of the image. I tried everything but nothing works. The file at the same directory or the file in a subdirectory doesn't matter, the name appears the same way. May someone help me? Thank you!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Error: File not found!

Post by Johannes_B »

It would be better to start a new thread and not hijack another one.

Just a shot into the blue, did you explicitely give the file ending? Don't!


If that did not help, please try to prepare a minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply