0

I followed the same procedure as in the answer to this question to download and install latex-vim. But when I compile a tex file, I get the following error message:

|| I can't find file `Rapport'. Rapport  sur la structure des groupes des units.tex
|| Emergency stop. Rapport  sur la structure des groupes des units.tex
||  ==> Fatal error occurred, no output PDF file produced!

It seems that I cannot compile files with spaces in the name, but, using other applications like sublime text, it all works quite fine.

I am using a mac el capitan, and both the vim in terminal and the mac vim fail to compile correctly the tex files, while other functionalities such as folding and indenting are all good and fine.

I am new to the world of vim, so thanks sincerely in advance for any help and reference, in advance.

  • To open a file with space you can escape space, like ` vim file\ 2.tex` for file 2.tex – SibiCoder Aug 10 '16 at 13:06
  • I can open the file normally, but cannot compile the file. I think I might need to change some vim script, but I don't know where the problem is. – awllower Aug 10 '16 at 13:10
  • 4
    It sounds like you need to open an issue with vim-latex so that it handles files with spaces in the path properly. – jamessan Aug 10 '16 at 13:42
  • @jamessan Thanks for the suggestion. I shall do so later. :) – awllower Aug 11 '16 at 3:37
1

Until an official fix is available, you can do the following: Edit the ftplugin/latex-suite/compiler.vim and change the lines

let mainfname = expand('%:p:t')

and

let mainfname = Tex_GetMainFileName(':p:t')

to

let mainfname = fnameescape(expand('%:p:t'))

and

let mainfname = fnameescape(Tex_GetMainFileName(':p:t'))

repectively.

This seems to fix the problem.

  • Now I receive this message Error detected while processing function Tex_RunLaTeX[53]..Tex_SetupErrorWindow[ 16]..Tex_UpdatePreviewWindow[1]..Tex_PositionPreviewWindow: line 65: E172: Only one file name allowed: bot pedit +0 But it seems that the file is processed. Is this the normal behavior? Also, thanks for this suggestion! – awllower Aug 10 '16 at 16:37
  • @awllower if you search for bot pedit +0 in the same file as pefore, and then change this line to exec 'bot pedit +0'.fnameescape(a:filename), this should resolve your problem – Ingo Aug 10 '16 at 17:05
  • This solves the problem! Thanks for getting me out of this mess! ;D – awllower Aug 11 '16 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.