[XeTeX] Handling of parentheses in graphical file names

Jonathan Kew jonathan_kew at sil.org
Tue May 23 10:43:39 CEST 2006


On 23 May 2006, at 9:27 am, Bruno Voisin wrote:

> Attempting to apply LaTeX's \includegraphics to JPEG files with  
> names like (iii)403.jpg, through \includegraphics{(iii)403}, I am  
> indeed getting the graphics included, but prefixed with the text  
> "403.pdf 403.png 403.jpg" in XeLaTeX. I am not seeing this in  
> pdfLaTeX. Is this a normal issue? Should I have used a special way  
> of specifying the parentheses in the file name?

I think XeTeX is getting confused because one of the forms of  
"quoting" it accepts for filenames, in addition to 'single' and  
"double" quote marks, is (parentheses) around the name. This was  
added at the request of the ConTeXt people (primarily for font names,  
IIRC, but font names and filenames are parsed by the same code). But  
it means that the initial ( in your figure names makes XeTeX think  
you're using a quoted name, and the ) then ends that name.

(Given this, I'm a bit surprised the figures show up at all....  
haven't traced exactly what happens.)

You get text such as "403.pdf 403.png 403.jpg", btw, because  
\includegraphics tries to load the figure with several different  
extensions; apparently its order of preference is PDF, PNG, JPG.

The appropriate fix is probably a modification in xetex.def to ensure  
that it properly quotes the name; you can safely use parentheses as  
part of a filename if the whole name is quoted with "..." or '...'.

HTH,

JK



More information about the XeTeX mailing list