[Tex/LaTex] LyX: “Directory path to the document cannot contain spaces” when exporting to PDF

errorslyxpdftexwindows

For several years I've been able to export to PDF using pdflatex regardless of whether or not there was spaces in the directory path or filename.

On Windows 10 Home (Version 1607) I installed LyX 2.2.0 (2016 October 10), and when I try exporting with pdflatex I get the error "Directory path to the document cannot contain spaces".

This seems to be a very common error that is never properly addressed:

  1. Latex Community: Blank Space(s) in Directory Path – Suggested solution was to de-select 'updates on the fly' in MikTeX but as others said in their replies, it doesn't work for everyone.
  2. LyX Users: Directory path to the document cannot contain spaces – Suggested solution here was just to remove the spaces in the directory path, which is not actually a solution.
  3. Linux Questions: lyx help… directory path to the document cannot contain spaces – Suggested solution was to put the whole file path in quotes, but this seems to only be possible using command line LyX in Linux, it is not a solution for Windows.

What is a solution that works for LyX 2.2.0 in Windows 10 ?

Best Answer

In my case the issue got fixed after I launched MikTek Update (Admin) one time and updated all pending packages. Then reconfigured Lyx and the error was gone...

Related Question