[XeTeX] using xetex in make

Bruno Voisin bvoisin at mac.com
Thu Aug 16 09:20:55 CEST 2007

Le 16 août 07 à 04:35, Mike Maxwell a écrit :

> I have a makefile that is supposed to automate a lot of the process of
> producing a .pdf file (out of a DocBook file, but that's a long story;
> suffice to say that by the time of the problem, the file exists in the
> appropriate format for xetex).  For some reason xetex works fine if I
> run it directly from the command line, but won't work if it's run  
> inside
> of make.
> [...]
> You'll notice that 'ls' finds the file just fine.  (I hit the <Enter>
> key after the first prompt; I'm not sure why it switches from  
> asking for
> 'test.xetex' the first time to asking for 'test' the second time.)
> If I copy the command line from the above and paste it directly in to
> the bash prompt, xetex finds the input file and proceeds to run.
> I suppose xetex could be expecting the file suffix to be .latex  
> or .tex
> instead, but then why would it run OK on the bash prompt, but not  
> inside
> make?  Nope, just tried renaming the source file and changing the  
> recipe
> accordingly.
> [...]

I suppose the problem is, rather, that XeTeX, when operated through  
your make script, does not look for the input file at the appropriate  
location. XeTeX, as other TeX executables, looks first for input  
files in the current directory, then in a succession of directories  
from the various texmf trees, as specified in texmf.cnf. What the  
current directory is is clear when XeTeX is operated from the shell  
prompt. But what is the current directory when XeTeX is operated  
through your make script?

To find out where XeTeX looks for input files and in which order, you  
can use:

kpsewhich --progname=xetex --show-path=tex

As an example on the Mac I get (after some reformatting for clarity):


Hope this helps,

Bruno Voisin

More information about the XeTeX mailing list