[XeTeX] XeTeX/MiKTeXbug: \graphicspath does not work as intended

Vladimir Lomov lomov.vl at gmail.com
Sun Dec 27 07:27:59 CET 2009


On Sat, Dec 26, 2009 at 11:56:52 +0100, Ulrike Fischer wrote:
> Am Sat, 26 Dec 2009 09:46:13 +0600 schrieb Igor Kotelnikov:

UL => Ulrike Fischer
IK => Igor Kotelnikov

IK>> LaTeX Warning: File `eps/P(B).pdf' not found on input line 7.. 

UF> Well what shows again how necessary an exact problem description and
UF> a minimal example are.

UF> The problem are the braces and it has nothing to do with graphics.
UF> You get different result from \IfFileExists with pdflatex + xelatex:

UF> \documentclass{article}
UF> \begin{document}
UF> \IfFileExists{P(B).pdf}{YES}{NO}

UF> \IfFileExists{"P(B).pdf"}{YES}{NO}
UF> \end{document}

UF> (P(B).pdf was in the current folder for the tests.) 

UF> Quoting the file name enables xelatex to find the file, but I don't
UF> know if it is possible to change \IfFileExists for xelatex without
UF> breaking something else. I would suggest that you change your
UF> filenames to "safe" names. Dots, braces, spaces etc may work but
UF> they are quite often the source of troubles (and they often make
UF> documents non-portable).  

On Sat, Dec 26, 2009 at 11:20:52 +0100, Peter Dyballa wrote:

PD => Peter Dyballa
VL => Vladimir Lomov

IK>>> LaTeX Warning: File `eps/P(B).pdf' not found on input line 7..

VL>> xelatex fails find 'P(B).pdf' for me too.


PD> Yes, "(" and ")" in file names will evoke problems in handling these  
PD> characters. It's likely that the file name parsing mechanism in LaTeX  
PD> also has problems with parentheses, although MS Losedos has not... (it  
PD> "just" forbids the use of any of these: < > : " / \ | ? *, while Mac  
PD> OS X does not allow : because of backward compatibility with Classic  
PD> Mac OS 8-9 and Mac OS X and any other UNIX do not allow / because it's  
PD> the path separator; every character can be handled by "escaping" it in  
PD> shell, but in LaTeX it must first be "escaped" from LaTeX and then in  
PD> a form that it is also "escaped" from the shell used to find the file  
PD> in the given path ??? this can become a bit complicated...)

Well I may be confuse the situation more :)

I tried to investigate the situation with '()' handling
in latex engines in TL2009 (Linux x86_64 system).

Test documents:
1.
  parenthesis.tex
  parenthesis-quoted.tex
  parenthesis-subdir.tex
  parenthesis-subdir-quoted.tex
2.
  xelatex-graphics-path.tex
  xelatex-graphics-path-quoted.tex

Files which were used for testing:
1.
  file(A).tex
  file().tex
  file(A.tex
  fileA).tex
2.
  P(B).pdf
  P(B).eps


Results:
*******

Text files:
-----------
 * parenthesis.tex:
   - {pdf,lua,}latex work fine with all files,
   - xelatex work only with 'fileA).tex' for the rest it swallows
     the first '('.
   - dvips and dvipdfm could produce ps and pdf correspondingly.
 * parenthesis-quoted.tex:
   all engines work fine.
 * parenthesis-subdir.tex:
   The same as for 'parenthesis.tex' above.
 * parenthesis-subdir-quoted.tex:
   The same as for 'parenthesis-quoted.tex' above.

Conclusion: there is some problem with how xetex program treat parenthesis
            which leads to 'swallowing' the first '('.
Workaround: quote names or not use '(' in filenames :).


Graphics:
---------
  * xelatex-graphics-path.tex:
    - {pdf,lua,}latex work fine.
    - dvips works fine,
    - dvipdfm fails: 'unexpected token' (predictable: conversion
      from eps to pdf is done by means of shell script).
    - xelatex fails (file not found).
  * xelatex-graphics-path-quoted.tex:
    - pdflatex: works fine,
    - lualatex: 
----------------------------------------- LOG -----------------------------------
! Package pdftex.def Error: File `test/"P(B)".pdf' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8 \includegraphics[width=4cm]{"P(B)"}

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2009/08/28 v1.8 graphics configuration of TeX Live
  pdftex.def    2009/08/25 v0.04m Graphics/color for pdfTeX
pdftexcmds.sty    2009/12/12 v0.7 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2007/09/09 v1.2 Providing info/warning/message (HO)
ifluatex.sty    2009/04/17 v1.2 Provides the ifluatex switch (HO)
 ltxcmds.sty    2009/12/12 v1.1 LaTeX kernel commands for general use (HO)
luatex-loader.sty    2009/12/02 v0.3 Lua module loader (HO)
supp-pdf.mkii
 ***********
----------------------------------------- /LOG -----------------------------------
    - latex: runs fine,
      - dvips: runs with warning
----------------------------------------- LOG -----------------------------------
dvips: Unknown keyword (P(B)".eps") in \special will be ignored
dvips: Could not find figure file test/; continuing.
Note that an absolute path or a relative path with .. are denied in -R2 mode.
----------------------------------------- /LOG -----------------------------------
        but PS document doesn't have image.
      - dvipdfm: runs with warning
----------------------------------------- LOG -----------------------------------
** WARNING ** Unrecognized dimension/transformation key: P
** WARNING ** Interpreting special command PSfile (ps:) failed.
** WARNING ** >> at page="1" position="(148.712, 604.807)" (in PDF)
** WARNING ** >> xxx "PSfile="test/"P(B)".eps" llx=246 lly=370 urx=348 ury=471 rwi..."
** WARNING ** >> Reading special command stopped around >>(B)".eps" llx=246 lly=370 urx=348 ury=471 rwi=1133 <<
----------------------------------------- /LOG -----------------------------------
        as in case of dvips PDF document doesn't have image.
    - xelatex:
----------------------------------------- LOG -----------------------------------
! Unable to load picture or PDF file 'test/PB.pdf'.
<to be read again> 
                   }
l.8 \includegraphics[width=4cm]{"P(B)"}
                                       

! Package graphics Error: Division by 0.

See the graphics package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.8 \includegraphics[width=4cm]{"P(B)"}
                                       
<use  "test/"P(B)".pdf" >
! Unable to load picture or PDF file 'test/PB.pdf'.
<to be read again> 
                   \GXT at clipend 
l.8 \includegraphics[width=4cm]{"P(B)"}
                                       
[1] (./xelatex-graphics-path-quoted.aux)

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2009/08/28 v1.8 graphics configuration of TeX Live
   xetex.def    2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)

test/"P(B)".pdf
 ***********
----------------------------------------- /LOG -----------------------------------
      Note that parentheses and quotes are swallowed.


Conclusion: DON'T use quotes when graphics files are included into document.

Workaround: don't use parenthesis(es) in filenames even if they are okey in
            (pdf)latex.



-- 
Sharks are as tough as those football fans who take their shirts off
during games in Chicago in January, only more intelligent.
		-- Dave Barry, "Sex and the Single Amoeba: What Every
		   Teen Should Know"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parentheses-issues.tar.gz
Type: application/octet-stream
Size: 2399 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20091227/b8bf67cf/attachment.obj>


More information about the XeTeX mailing list