[XeTeX] xelatex does not find pdf graphics ?

Jonathan Kew jonathan_kew at sil.org
Wed Sep 22 11:51:40 CEST 2004


On 22 Sep 2004, at 12:12 am, Bruno Voisin wrote:

> Le 21 sept. 04, à 23:58, Jonathan Kew a écrit :
>
>> On 21 Sep 2004, at 9:17 pm, Michael Gedalin wrote:
>>
>>> I tried to include a pdf graphics using
>>> \usepackage[xetex]{graphicx}
>>> ...
>>> \includegraphics{filename.pdf}
>>>
>>> The file resided in the same directory where all my style files are. 
>>> Usual latex/pdftex found the file without problem.
>>
>> XeTeX doesn't use search paths to look for graphics files; it simply 
>> looks for the name as given, relative to the current directory. So 
>> unless the graphicx package has some way of prefixing other paths to 
>> the name, it wouldn't be found.
>
> In my case \graphicspath, which is the way the graphicx package sets 
> these prefixes, works in XeLaTeX. For example I'm using currently:
>
> 	\usepackage[xetex]{graphicx}
> 	\graphicspath{{Figures/PDF-alt/}{Figures/JPG/}}
>

OK, there are two things going on here. \graphicspath is a LaTeX 
graphics package thing, implemented in TeX macros, and should work (as 
it apparently does). But pdfTeX also uses the kpathsearch library to 
locate graphics files, as can be seen with a test such as

	% pdftex -kpathsea-debug=1
	This is pdfTeX......
	**\relax
	*\pdfximage{hello.jpg}

which generates reams of trace output showing the paths where 
"hello.jpg" is sought.

Interestingly, it also shows that pdfTeX tries adding a .tex extension 
to the image filename given; I'm not sure that's appropriate!

Currently, XeTeX doesn't use kpathsearch for graphics, but I should 
probably change that.

JK



More information about the XeTeX mailing list