Kile\includegraphics problems

Information and discussion about Kile, an integrated LaTeX environment for Linux KDE
Post Reply
pcmben
Posts: 4
Joined: Wed Nov 25, 2009 3:55 am

\includegraphics problems

Post by pcmben »

Hello,

I've been using Kile to write up a thesis. I'm running version 1.9.1 at uni on Ubuntu, and everything works fine here.

I then copy the whole directory home, and use Kile 2.0 on Ubuntu. When I try to compile, I get an error saying that the file could not be found for all my image files and the outputted .dvi does not have the images in it.

The exact same code and file directories are used on the two computers, but at home, it just doesn't work.

I have a master .tex file which has the following code:

Code: Select all

\graphicspath{{folder/subfolder_where_the_images_are_stored/}}
Then inside another .tex file when I want to insert a figure, I use:

Code: Select all

\includegraphics{imagename}
This all works fine on version 1.9.1 on one computer, but then on another computer running 2.0, it says it cannot find the file.
My image files are .eps extension, and i've tried changing the filename to be "image.eps", but that hasn't helped.

Anyone have any ideas on what could be the problem?

Thanks,
Ben
Last edited by pcmben on Sat Dec 12, 2009 5:35 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Re: \includegraphics problems

Post by fatra2 »

Hi there,

Did you verify that the "graphicspath" package is installed on the two machines??? Otherwise, it would explain this behaviour.

Cheers
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

\includegraphics problems

Post by localghost »

fatra2 wrote:[…] Did you verify that the "graphicspath" package is installed on the two machines??? Otherwise, it would explain this behaviour. […]
There is no package called »graphicspath«. At least it is not listed on CTAN. In case it exists, please give a link where to find it. I'm also interested in that.
pcmben wrote:[…] When I try to compile, I get an error saying that the file could not be found for all my image files and the outputted .dvi does not have the images in it.

The exact same code and file directories are used on the two computers, but at home, it just doesn't work. […]
The exact error message would help a lot. Make sure that you have exactly the same directory structure on both machines. Especially in case you are giving a relative path. If necessary, prepare a minimal working example (MWE) and post it together with the according log file.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
pcmben
Posts: 4
Joined: Wed Nov 25, 2009 3:55 am

\includegraphics problems

Post by pcmben »

Thanks so much for the replies so far.
I'll have to wait till I get home tonight to get the error message.

In regards to this suggestion:
Make sure that you have exactly the same directory structure on both machines. Especially in case you are giving a relative path.
On one machine, I am connected to a network drive in which I have a personal folder:
/home/ben/network_drive/ben/thesis/
In the folder thesis, I have my main .tex file, with subfolders for different chapters which contain the .tex file for the chapter, and then a subfolder for my imgages, i.e:
/home/ben/network_drive/ben/thesis/main.tex
/home/ben/network_drive/ben/thesis/chapter1/chapter1.tex
/home/ben/network_drive/ben/thesis/chapter1/images/

I copy the directory: /thesis and everything under that, and take it to another machine where the directories are set up as:
/media/mounted_drive/thesis/

The path to the "thesis" folder shouldn't make a difference should it, since the main.tex file and everything else is under the "thesis folder" so all paths start at \thesis? Or am I wrong here?
If necessary, prepare a minimal working example (MWE) and post it together with the according log file.
I'll have a look into doing this when I get home to the problem computer.
Did you verify that the "graphicspath" package is installed on the two machines??? Otherwise, it would explain this behaviour.
I just found something through google (http://www.tex.ac.uk/cgi-bin/texfaq2htm ... aphicspath) that the command "graphicspath" is part of the "graphicx" and "epsfig" packages. I checked and I have the commands:

Code: Select all

\usepackage{graphicx}
\usepackage{epsfig}
I don't get any errors relating the the package "graphicx" not being found, so that would suggest that there is no problem with the package "graphicx"?

Thanks again for the fast responses. I really appreciate the help.

Ben
pcmben
Posts: 4
Joined: Wed Nov 25, 2009 3:55 am

\includegraphics problems

Post by pcmben »

localghost wrote: The exact error message would help a lot
Ok, I've prepared a MWE and run that. The MWE is below with two file, the first is the main file named test.tex:

Code: Select all

\documentclass[a4paper,12pt,fleqn,twoside]{book}
\usepackage{graphicx}
\usepackage{epsfig}

\begin{document}
\chapter{Test1}
\graphicspath{{Test1/images/}}
\input{Test1/Test1}
\end{document}
and the second is the chapter file named Test1.tex:

Code: Select all

\begin{figure}
\includegraphics{testimage}
\end{figure}
Directories are as follows:
/home/test.tex
/home/Test1/Test1.tex
/home/Test1/images/testimage.eps

The output error in the log and messages is:
test.tex => test.dvi (latex)
[LaTeX] finished with exit status 1
./Test1/Test1.tex:2:File `testimage' not found. \includegraphics{testimage}
[LaTeX] 1 error, 0 warnings, 0 badboxes


thanks
Ben
pcmben
Posts: 4
Joined: Wed Nov 25, 2009 3:55 am

\includegraphics problems

Post by pcmben »

Ok, problem solved now!

When I included the directory for graphics in my document using:

Code: Select all

\graphicspath{folder\images}
the folder "images" was actually named "Images". The use of uppercase and lowercase makes a difference on one setup I have, but not on the other. Not sure if it is to do with the different versions of Kile or if it is the Tex distributions I have installed (Texlive on one machine, but not sure what's on the other).

Anyway, the lesson of the story here, make sure the paths are named exactly with all the correct casing!
Post Reply