[XeTeX] xelatex does not find pdf graphics ?

Bruno Voisin bvoisin at mac.com
Wed Sep 22 01:12:21 CEST 2004


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/}}

> From your report, I'm guessing that pdfTeX uses a kpathsearch function 
> to locate graphics files, similarly to how .tex input files, .sty 
> files, etc., are located. I should probably consider adding similar 
> path-searching to the \XeTeXpicfile and \XeTeXpdffile commands. How do 
> others feel about this....any comments?

I think that's a useful functionality. For example, my department has a 
letterhead format (a Word template) for which I created plain TeX and 
LaTeX lookalikes, defined by files legiletter.tex and legiletter.cls, 
both inputting a file legi150.jpg. On my PowerBook these all reside in 
~/texmf/tex/generic/legihead/.

I just checked that in XeTeX this does not work, in that I need to put 
a copy of the logo along with each letter using this class 
legiletter.cls.

In the meantime, regarding this problem as well as that of the original 
poster, could a temporary (dirty) fix be to write a file graphics.cfg 
making known to XeTeX some of the most obvious directories for storing 
graphics?

BTW (this one is for Ross more than Jonathan), I think (not sure) that 
the graphics package does not recognize automatically that it is used 
with XeLaTeX, contrary to what is the case for TeX or pdfTeX: it seems 
that with XeLaTeX you need to write explicitly 
\usepackage[xetex]{graphics} whereas for LaTeX or pdfLaTeX you just 
need to write \usepackage{graphics} instead of 
\usepackage[dvips]{graphics} or \usepackage[pdftex]{graphics} 
explicitly. This makes writing classes or packages that can be used 
indifferently with LaTeX, pdfLaTeX or XeLaTeX more difficult. Is it 
possible (technically or time-wise) that this functionality be added to 
some future release of the graphics package for XeTeX?

BTW2 (for Ross or Jonathan?), I just comme across an error "Error 
creating cg colorspace from csync profile" which I think arises at the 
time xvd2pdf is working:

(./legiletter.cls
Document Class: legiletter 2002/02/15 v5.0 LEGI letter class
(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/letter.cls
Document Class: letter 1999/04/29 v1.2z Standard LaTeX document class
(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/size12.clo))
(/usr/local/teTeX/share/texmf.tetex/tex/latex/base/ifthen.sty)
(/usr/local/teTeX/share/texmf.local/tex/xetex/graphics.sty
(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/trig.sty)
(/usr/local/teTeX/share/texmf.tetex/tex/latex/config/graphics.cfg)
(/usr/local/teTeX/share/texmf.local/tex/xetex/xetex.def
...supports rotation and scaling
)) (/usr/local/teTeX/share/texmf.local/tex/xetex/color.sty
(/usr/local/teTeX/share/texmf.tetex/tex/latex/config/color.cfg)
(/usr/local/teTeX/share/texmf.tetex/tex/latex/graphics/dvipsnam.def))
<use  "legi150.jpg">)
(/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/pifont.sty
(/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/upzd.fd)
(/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/upsy.fd))
(./letsampl-latex.aux) [1] (./letsampl-latex.aux [2])Error creating cg 
colorspace from csync profile )
Output written on letsampl-latex.pdf (2 pages).
Transcript written on letsampl-latex.log.

Unfortunately I don't have time to investigate this or provide a 
reduction or reproducible example. In that document colors are defined 
like this:

\definecolor{darkblue}{cmyk}{1.,.43,0.,.18}
\definecolor{lightblue}{cmyk}{1.,.09,0.,0.}

and used like that (sorry for the LaTeX atrocity!):

   \renewcommand*{\@oddfoot}{%
     \makebox[\textwidth]{\parbox[t]{\footwidth}{\addfont
       \vspace{19.5pt}\sbox{\strutbox}{\rule[-3pt]{0pt}{10pt}}
       
\begin{tabular*}{\footwidth}{@{}l@{}c@{}l@{\extracolsep{\fill}}r@{}}
         \multicolumn{3}{@{}l}{\ifthenelse{\boolean{legipaper}}{}{%
             \color{darkblue}\bbaddfont LEGI}} &
           \baddfont\fromname \\

Is it linked to color.cfg and dvipsnam.def being apparently read by 
default?

HTH nonetheless,

Bruno



More information about the XeTeX mailing list