Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to recover a .tex file?

  1. May 29, 2016 #1
    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?
     
  2. jcsd
  3. May 29, 2016 #2

    Borek

    User Avatar

    Staff: Mentor

    What is the size of the tex file reported by the OS?

    Isn't tex file just a text file, just with another extension?
     
  4. May 29, 2016 #3
    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).
     
  5. May 29, 2016 #4

    Borek

    User Avatar

    Staff: Mentor

    Try to open the file just with a notepad.
     
  6. May 29, 2016 #5

    DrClaude

    User Avatar

    Staff: Mentor

    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.
     
  7. May 29, 2016 #6
    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.
     
  8. May 29, 2016 #7
    Is it possible to recover the file by doing a system restore?
     
  9. May 29, 2016 #8

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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: May 29, 2016
  10. May 29, 2016 #9
    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.
     
  11. Jun 9, 2016 #10

    Imager

    User Avatar
    Gold Member

    Just installed it, nice editor. Thank you Robphy.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: How to recover a .tex file?
  1. Recovering File (Replies: 2)

Loading...