[XeTeX] Cannot load dislocated image file

Jonathan Kew jonathan_kew at sil.org
Sat Mar 15 13:29:32 CET 2008


On 15 Mar 2008, at 12:20 pm, Sven Siegmund wrote:

> Hello,
>
> I am trying to load an image file in my document like this
>
> ----
> \begin{figure}[htp]
> \centering
> \XeTeXpicfile "/img/maerklin-schienentypen-h0.jpg"
> \caption{Gleistypen}
> \label{fig:gleistypen}
> \end{figure}
> -----
>
> The problem seems to be the location of the image file. It is not in
> the folder of the TeX-Document.:
>
> My TeX-Document is in d:\Sven\Märklin\geometrie\geometrie.tex and the
> image file is d:\Sven\Märklin\geometrie\img\maerklin-schienentypen- 
> h0.jpg
>
> When I move the image file to "D:\Sven\Märklin\geometrie" and write
> \XeTeXpicfile "maerklin-schienentypen-h0.jpg", it loads ok.
>
> What am I doing wrong when loading the file from another location?

I'd guess that you should use

   "img/maerklin-schienentypen-h0.jpg"

or possibly

   "./img/maerklin-schienentypen-h0.jpg"

to specify an image file with a relative path. The leading slash in  
your example would mean the path starts at the root of the drive.

As you're using xelatex, I'd generally recommend using  
\includegraphics (with the graphicx package) rather than direct XeTeX  
primitives, btw. But the issue of relative vs absolute paths would be  
the same.

JK



More information about the XeTeX mailing list