8

I tried to compile a file, and LaTeX didn't like something (I have no idea what). Now, when I try to compile, I am told that "The process cannot access the file because it is being used by another process." So apparently, TeX is still trying to compile the file or something. As best as I can tell, the problem is that a synctex.gz file is still (busy). How do I kill this process?

  • Could you tell a little bit more what operating system you use etc? Most generic method is a reboot of your computer ;) but if it is not a process but a locked file instead that might not solve your problem entirely. – hugovdberg Mar 29 '14 at 1:04
  • 1
    In windows, hit CTL-ALT-DEL, and start the task manager. Kill the process named pdflatex.exe. Then close the task manager. – Steven B. Segletes Mar 29 '14 at 1:04
  • In WinEdt, under Windows, just click on the "x" button at the upper right corner of WinEdt console. There's also a keyboard shortcut, but I can't rember it at the moment. – Bernard Mar 29 '14 at 1:26
  • Another unclear version of this question: tex.stackexchange.com/questions/136226/… – alfC Mar 29 '14 at 2:02
7

Steven B. Segletes posted a partly correct response.

You need to kill pdflatex, but then you should also delete the file "xxx.synctex.gz(busy)".

However, be aware that this just helps remove the file "xxx.synctex.gz(busy)". In my experience, this error occurs because of an error in your tex code, so if you successfully remove the file, and then try compiling again, you will probably have to go through the process all over again.

A lot of confusion comes from the fact that, after you kill pdflatex from the Task Manager, your file browser might still say "xxx.synctex.gz(busy)". In fact the file is no longer busy, and you should be free to delete it.

Here is why:

The synctex.gz file is a reverse lookup file, which enables you to click on a place in the pdf, and then have your .tex editor move your cursor to the place in the .tex file which generated that point in the pdf.

While pdflatex is generating this file, it literally gives the file the name "xxx.synctex.gz(busy)", and then actually locks it to prevent you from accessing it. Therefore your file browser will show you "xxx.synctex.gz(busy)", regardless of whether or not the file is actually locked.

When pdflatex is finished, it renames the file from "xxx.synctex.gz(busy)" to "xxx.synctex.gz".

  • "In my experience, this error occurs because of an error in your tex code... ". This solved my problem. Thanks @user124998. – usmanayubsh Jan 31 '16 at 21:39
7

I experienced the same problem but figured out that it was simply a conflict with Google Drive, trying to sync the file before texmaker managed to finish compiling.

So if you have continuous backups with Google Drive, Dropbox or similar, try to close them and compile again.

  • Same here. May happen when your aux file folder is within one of Google Drive's synced folders on your disk. Sometimes it helps to enter the Google Drive client's context menu, look at the list of unsyncable files, and retry a sync without having to close/reopen the Google Drive client (not always, though). – bers Jun 24 '16 at 13:25
5

If you are running Linux, you can run $ lsof synctex.gz to find which process has the file open, and then kill it.

1

I had the same problem and I found a solution. In my case, the error was generated by the bad file name: I was calling my .tex file "résumé de thèse". This caused the loop/crash in synctex.gz, which remained "busy" (résumé de thèse.synctex.gz(busy) appeared as extension). So I saved the .tex file with another name without special characters (e.g., I called it "summary of thesis") and then I compiled the new file. The new synctex so generated is no more "busy" and I gained the function "Go to the source" from the .pdf file. I hope this could help you, bye!

0

I encountered the same problem in Windows 7 running pdfLaTeX with TeXworks (MiKTeX 2.9). The lingering "xxx.synctex.gz(busy)" started when I lost connection to the remote server where my .tex file directories were supposedly synced to be "Always available offline".

Upon restoring the connection to the remote server, or copying the whole directory back to a local drive, I was able to run pdfLaTeX again and it compiled completely, automatically renaming the synctex.gz file properly and removing the (busy) version.

0

The same thing happened to me. It was a conflict with the google drive. I closed the google drive and I was able to delete the file and everything worked,

0

I had the same issue running it on my Mac and not having google drive involved. Actually I got an error message that indicated that there was an error in the code. I could not for the life of me find it though. Finally I made a copy of the file and ran that. It ran fine! Then I noticed the synctex file in my work folder. I simply renamed the file (it was something like main_work.tex to just mainwork.tex and then it ran! So my advice is check the file name first and try changing it.

protected by Community Apr 12 '18 at 7:51

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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