How can I recover my .tex file after a computer crash?

  • Thread starter Thread starter JonnyG
  • Start date Start date
  • Tags Tags
    File Recover
Click For Summary

Discussion Overview

The discussion revolves around recovering a .tex file after a computer crash, focusing on potential methods for file recovery and the implications of file backups. Participants explore various technical aspects related to file types and recovery options.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports that their .tex file appears blank despite the operating system indicating it contains 19 kb of data.
  • Another participant suggests checking the file size and mentions that a .tex file is just a text file with a different extension.
  • There is mention of associated files like .bak, .aux, and .txt, with one participant noting that the .bak file might be a backup.
  • A suggestion is made to open the .tex file in a different text editor, such as Notepad++, to see if it reveals any hidden content.
  • One participant questions the possibility of recovering the file through a system restore.
  • Another participant advises against deleting any files and suggests searching for temporary files created recently.
  • One participant reflects on the experience, noting they learned the importance of backing up their work and ultimately decided to retype their content since they had the .pdf version saved.

Areas of Agreement / Disagreement

Participants express various methods for attempting to recover the file, but there is no consensus on a definitive solution. The discussion remains unresolved regarding the effectiveness of the proposed recovery methods.

Contextual Notes

Participants mention the presence of multiple file types associated with the .tex file, but the implications of these files and their potential for recovery remain unclear. There is also uncertainty about the contents of the original .tex file and the effectiveness of different text editors.

Who May Find This Useful

This discussion may be useful for individuals experiencing similar issues with file recovery, particularly those using LaTeX editors and seeking advice on backup strategies.

JonnyG
Messages
233
Reaction score
45
I was doing some work using Texmaker and my all of a sudden my keyboard stopped working and my mouse stopped working. But I know that I had just saved the file, so I restarted my computer. But now when I open up the .tex file to continue my work it is completely blank. It says that I have about 20000 characters typed, but when I try to compile it into a .pdf it says that there is nothing to compile. Is there any way that I can reverse this? Luckily I have a .pdf of my work already saved, so I haven't lost all of my work, but it will be a pain to retype all of it again. Is there perhaps a way to start a new .tex file and when I compile that into a .pdf, have it combine with the other .pdf to make one file?
 
Computer science news on Phys.org
What is the size of the tex file reported by the OS?

Isn't tex file just a text file, just with another extension?
 
The size is 19 kb. Larger than a blank file. As to your other question, I have no idea. I do not know much about this stuff. But there are other files associated with .tex file, there is a .bak file and a .aux file. There is also a .txt file, but that just seems to be an error log from the compiler (if that makes sense).
 
Try to open the file just with a notepad.
 
JonnyG said:
there is a .bak file
That is not a standard LaTeX file, so it is probably a backup. Copy it to another name with an extension .tex and see what it looks like in Texmaker.
 
When I open it up with a notepad, it is just blank. When I copy the .bak file to another name and change the extension to .tex it opens up to a blank file. But when I open up my original .tex file in Texworks, another LaTex program, it opens up two windows. The window for the source code is blank, but the window which shows the output has my work.
 
Is it possible to recover the file by doing a system restore?
 
It's a large text file with blank characters?
Try a fancier editor (like Notepad++) that might be able tell you more about what is in your file.
Could notepad be choking on a weird character, fooling itself into thinking the file is done and showing you nothing more?

Whatever you do, don't delete anything or empty the trash.

You might try to search your entire computer (with Explorer or something fancier)
for files created within (say) the last 24 hours with size less than 100k.

If you know where temporary files are stored by the software,
you might be able to limit your search to those places.
(Note that those places may be buried in folders that are hidden by default.)

[In the future... it might be a good idea to periodically back up your work.
In my setup, I have a script that adds a timestamp to the filename of a file I select, which I periodically invoke.
It's too complicated to replicate my setup...
but you might be able to find something (or write your own)
with help from https://www.google.com/search?q=attach+timestamp+to+filename
https://www.google.com/search?q=attach+timestamp+to+filename+windows ]
 
Last edited:
Thanks for all of the replies. There wasn't THAT much work done yet and I have the .pdf, so I just retyped everything. I learned a valuable lesson about backing up my work though. This could have been a lot worse.
 
  • Like
Likes   Reactions: DrClaude
  • #10
robphy said:
Try a fancier editor (like Notepad++)

Just installed it, nice editor. Thank you Robphy.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
Replies
15
Views
11K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 151 ·
6
Replies
151
Views
15K
  • · Replies 13 ·
Replies
13
Views
1K
Replies
12
Views
3K