This forum has been archived. All content is frozen. Please use KDE Discuss instead.
The Discussions and Opinions forum is a place for open discussion regarding everything related to KDE, within the boundaries of KDE Code of Conduct. If you have a question or need a solution for a KDE problem, please post in the apppropriate forum instead.

[KILE] File not found "<filename>" \includegraphics

Tags: None
(comma "," separated)
Frustrated
Registered Member
Posts
13
Karma
0
Hello there,

Can someone help me fix this issue? How am I supposed to get KILE to find this file? Does it have to be saved in the same folder as the .tex document I am working from?
claus_chr
Registered Member
Posts
40
Karma
1
OS
You should set a graphics path in the preamble of the document. Assuming your have a subdirectory "pics" in the directory holding your current .tex file, you place the following lines in the preamble of the document:

Code: Select all
\usepackage{graphicx}
...
\graphicspath{{pics/}}


(I'm assuming you are using LaTeX.) Note the double curley braces. It should also work with absolute paths (although I haven't tested that).
Frustrated
Registered Member
Posts
13
Karma
0
I'm afraid that doing that has now given me 66 errors. Beneath my use packages (of which graphicx is included), I have

"\graphicspath{C:\Users\James_2\My Documents\Chemistry\Dissertation}"

The image is called fig4co2flux.png. In the figure where I want the image to appear, I have

\begin{figure}
\includegraphics{fig4co2flux}
\caption{global outgassing, absorption and net flux of the world’s oceans in
gigatons of carbon per year (Gt-C y$^{-1}$)m, as presented by Tsai and Liu.}
\end{figure}

As soon as I remove the "includegraphics" part, I get 0 errors. I cannot see where I am going wrong.
User avatar
yurchor
Registered Member
Posts
64
Karma
1
OS
Frustrated wrote:I'm afraid that doing that has now given me 66 errors. Beneath my use packages (of which graphicx is included), I have

"\graphicspath{C:\Users\James_2\My Documents\Chemistry\Dissertation}"

The image is called fig4co2flux.png. In the figure where I want the image to appear, I have

\begin{figure}
\includegraphics{fig4co2flux}
\caption{global outgassing, absorption and net flux of the world’s oceans in
gigatons of carbon per year (Gt-C y$^{-1}$)m, as presented by Tsai and Liu.}
\end{figure}

As soon as I remove the "includegraphics" part, I get 0 errors. I cannot see where I am going wrong.

The path should be relative. It is enough to use
Code: Select all
\graphicspath{{figures/}}
and put all the figures into
C:\Users\James_2\My Documents\Chemistry\Dissertation\figures
claus_chr
Registered Member
Posts
40
Karma
1
OS

Sun Feb 17, 2013 1:43 pm
I think there are two things wrong with your \graphicspath command:

1. You should use double curley braces!

2. I don't think TeX understands Windows' non-standard path separators - use proper slashes like in URL's.

Also, as noted before, relative paths are much easier. Only use absolute paths if you have to.
Frustrated
Registered Member
Posts
13
Karma
0
Thanks for the input. I'm in the lab at the moment and don't have access to KILE/my dissertation .tex, but I shall attempt your suggestions when I get home and let you know how they have turned out.
Frustrated
Registered Member
Posts
13
Karma
0
Alas, this does not work either. I've tried the \graphicspath with {{ }} and typing \includegraphics{chlorophyll} and I've also tried it without grpahicspath and just putting in \includegraphics{chemistry/dissertation/chlorophyll} for example. Neither work. Someone in my lab showed me the latter today as well. I'm just not sure what is going wrong.
User avatar
yurchor
Registered Member
Posts
64
Karma
1
OS
Frustrated wrote:Alas, this does not work either. I've tried the \graphicspath with {{ }} and typing \includegraphics{chlorophyll} and I've also tried it without grpahicspath and just putting in \includegraphics{chemistry/dissertation/chlorophyll} for example. Neither work. Someone in my lab showed me the latter today as well. I'm just not sure what is going wrong.

1. If you are using figures in your main tex file directory, do not use any \graphicspath (comment it or remove it).

2. If you are using \graphicspath, do not use path parts in figures names.
User avatar
yurchor
Registered Member
Posts
64
Karma
1
OS
Testcase:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

%opening
\title{}
\author{}

\graphicspath{{pics/}}
\begin{document}

\maketitle

\begin{abstract}

\end{abstract}

\section{}

\begin{figure}
\includegraphics{test.png}
\caption{global outgassing, absorption and net flux of the world’s oceans in
gigatons of carbon per year (Gt-C y$^{-1}$)m, as presented by Tsai and Liu.}
\end{figure}

\end{document}

Add some dummy file "test.png" into
pics
subdirectory of your tests directory and try to compile.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell