TransWikia.com

I can't write on file 'Filename.pdf'

TeX - LaTeX Asked by Jesper Lundin on April 22, 2021

Im new to latex and sometimes I get this error message:

line 5: ! I can't write on file 'MasterThesis.pdf'. Please type another file name for output! Emergency stop.<to be reaad again>... ...end{document}
Line 1: !==> Fatal error occured, no output PDF file produced!

Today when I got this message nothing seems to work to fix it. I have tried the following:

  • Installed a new editor which gives the same error (TeStudio and TexMaker)
  • Deleted all files except the tex file
  • Close all programs and processes in task manager that seems to be PDF-related
  • Restart the editor (TexMaker)
  • Reboot the computer
  • I got several GB left on the disk drive
  • Searched through the internet to find a solution
  • Rename the tex file to only letters (no spaces, dots, symbols, etc)
  • Change the name of the folder that contains the file

Last thing I did was to remove everything in the tex file (with backup of course) except for the following:

documentclass[12pt, a4paper]{article}

begin{document}
    Hello
end{document}

But I still get the same error.

If I create a new empty file it manage to compile. Then I paste my work into it and the error occures. So I press ctrl+z a couple of times to undo until I reach the document that works but then the error is still there
Im using Windows 8 and TexMaker.

Im working on my master thesis and it’s very frustrating when I can’t continue my work. Could someone please help me with this?

4 Answers

I found the problem thanks to https://www.overleaf.com. I created an account an pasted my code and it resulted with an error in a tikz figure, I forgot to put an semicolon, " ; ", in the end of a line which caused the program to not compile which also resulted in errors in other tex files that were not related to the one with the error. Many thanks to a friend on facebook who responded to my post on facebook about this problem.

Correct answer by Jesper Lundin on April 22, 2021

I had the same problem. If you use Adobe Acrobat reader X, go to the Preferences of Acrobat Reader. In the menu Security (Enhanced) deselect Protection and Protection Enhanced OR add the Folder Path of your pdf folder build with latex.
That's work with me !

Answered by de Nunwan on April 22, 2021

I know this is not the answer to your question, but i sometimes also get that error.

If you work with a cloud drive such as Google drive or Dropbox you often run into problems because the cloud started syncing before writing to all the files is done.

The bigger your tex file, the longer it takes to compile, the bigger your chances to encounter this type of error

A solution (If that is the problem) would be to stop the syncing with the cloud for the period of compiling.

Answered by Elad Den on April 22, 2021

The most common reason for the error "can't write to filename.pdf, save it to different name' that I observed during my works is because I've kept open the PDF file generated by quickbuilding the LateX file.

I mean if the pdf file was kept open, that was generated in the same director (same folder) as the latex file, the nLateX shows error. Try closing that pdf file and building your LateX file. It works!

Answered by Bhanu Chander on April 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP