Subject: Re: bug#25276: 11.89.8; xetex engine not work when master filename contains space

From: Mosè Giordano <[email-masked]>
Date: Mon, 26 Dec 2016 17:25:39 +0100

Hi Qiang,

2016-12-26 16:34 GMT+01:00 Qiang Yin <[email-masked]>:
> Hi,
> I prefer xetex as my default tex engine. But this will cause a AucTeX
> bug when the master filename contains a space.
>
> The following is a minimal example. It contains only one master file "foo
> bar.tex". Notice the filename contains a space. And the content of "foo
> bar.tex" is just the following:
>
> \documentclass{article}
> \begin{document}
> Hello world
> \end{document}
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% TeX-engine: xetex
> %%% End:
>
> Now if press C-c C-c to compile this file. AucTeX will return the
> following error message:
>
> Running `LaTeX' on `foo bar' with ``xelatex  -file-line-error  --synctex=1
> -interaction=nonstopmode "\input" ^"\^"foo bar.tex\^"^"''
> This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/W32TeX)
> (preloaded format=xelatex)
>  restricted \write18 enabled.
> entering extended mode
> LaTeX2e <2016/03/31> patch level 3
> Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
> ! I can't find file `'"foo bar.tex"''.
> <*> \input '"foo bar.tex"'
>
> (Press Enter to retry, or Control-Z to exit)
> Please type another input file name
> ! Emergency stop.
> <*> \input '"foo bar.tex"'

I cannot reproduce this on GNU/Linux:

--8<---------------cut here---------------start------------->8---
Running `LaTeX' on `foo bar' with ``xelatex  -file-line-error
--synctex=1 -interaction=nonstopmode "\input" \"foo\ bar.tex\"''
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016)
(preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(./foo bar.tex (/opt/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/opt/texlive/2016/texmf-dist/tex/latex/base/size10.clo))
No file "foo bar".aux.
[1] (./foo bar.aux) )
Output written on foo bar.pdf (1 page).
SyncTeX written on foo bar.synctex.gz.
Transcript written on foo bar.log.

TeX Output finished at Mon Dec 26 17:11:20
--8<---------------cut here---------------end--------------->8---

I see that you're running Emacs on Windows, maybe there is something
special to be taken care of on that system.  I find it strange that
you experience this problem only with one engine: I didn't check it,
but I thought that the expansion of file name doesn't depend on the
selected engine.

I'll try to have a look, but not using Windows, it's difficult for me.
If someone else comes up with a solution, please chime in.

Bye,
Mosè