[NTG-pdftex] SyncTeX, file names with spaces and other funny characters

LAURENS Jérôme jlaurens at users.sourceforge.net
Thu Sep 18 11:07:22 CEST 2008


Hi,

there is actually a bug when SyncTeX has to manage spaces in file names.
This bug only appears in pdfTeX, but not in XeTeX.
Here it is:

xetex --synctex=1 "my file"

creates a file named <my file.synctex.gz>, whereas

pdftex --synctex=1 "my file"

creates a file named <"my file".synctex.gz>. Note that the 2 quote  
chars are considered by pdftex part of the name.

This difference is due to some "normalize_quotes" function being used  
differently in XeTeX and pdfTeX.
As usual, it is really difficult to understand how TeX handles things  
internally.
This is why I submit you my simple fix before texlive is updated, you  
may have a better approach.
The fix is simply to rely on the output_file_name (instead of the  
jobname), remove the terminating path extension and append to one  
required by SyncTeX.
It works for the very simple tests I could think of.

Do you agree?

BTW, it is natural to ask whether different but similar problems may  
occur.
Assuming the funny file named <tes"t.tex> exists

xetex tes\"t.tex

works properly whereas

pdftex tes\"t.tex

breaks in the normalize_quotes  function with the message: !  
Unbalanced quotes in argument tes"t.tex

Are there reasons for such a discrimination?


More information about the ntg-pdftex mailing list