[tex-live] [XeTeX] Problem with XeTeX's (and perhaps other binaries -- not investigated) handling of --output-directory

John Collins jcc8 at psu.edu
Mon Jan 16 00:26:41 CET 2017

On 1/15/17 2:30 PM, Zdenek Wagner wrote:
> No, ./ is not a path specification, the normalization rules will remove
> it, ./foo.tex is the same as foo.tex. If you want to specify the path,
> ../Welcome/foo.tex will help because such a file is not below
> dynamic-content.

Normalization rules such as this normally appear to be an excellent 
idea, and may not even deserve documentation.  But I wonder whether the 
present case indicates that the behavior should be changed.  At least 
the normalization should be done after finding the files rather than before.

Of course, without good reasons to the contrary, having an input source 
file in the output directory seems not a good idea.  It's even less of a 
good idea when there is a file of the same name in the current directory 
and one knows that the output directory is necessarily ahead of the 
current directory in the search path.  But such unusual situations do 
happen occasionally.

Here are my reasons against normalizing the given filename in the way it 
is currently done:

1. It violates natural (or naive) user expectations that ./test.tex and 
./test refer to a file specifically in the current directory.

2. It violates natural user expectations that ./test and ./test.tex 
should refer to the same test.tex file (if it exists).

3. It gives different behavior between the tex programs and kpsewhich. 
Suppose I define TEXINPUTS to put the output (or some other) directory 
ahead of the current directory and have a file test.tex in both.  Then
running both "kpsewhich ./test" and "kpsewhich ./test.tex" return 
./test.tex.  In contrast "pdflatex ./test" and "pdflatex ./test.tex" 
have different behavior.

4. When the file in the current directory is used, the log file reports 
it as ./test.tex, which reinforces the user's naive expectation that 
using ./test.tex on the command line should specifically select the file 
in the current directory.

5. When the file test.tex exists only somewhere else in the kpsearch 
path, it won't be found by "pdflatex ./test.tex", unlike the case when 
the file is in the output directory.

John Collins

More information about the tex-live mailing list