I am making the transition to Emacs from TexStudio because I can see that it's gonna really speed up things even though it's going to be a tough learning curve.

So far all my initialisation code works if it's in the site-start.el file. However when I put the same code in my HOME directory it throws the error:

File error: Cannot open load file, no such file or directory, auctex.el.

I guess that means it is reading my init file but looking for the AUCTeX package in the wrong place. How do I fix this?

Here are the relevant lines from my init file.

;AucTex and Preview-Latex
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
  • How did you install AUCTeX? – giordano Mar 16 '15 at 14:39
  • Your .emacs file should be in your "home" directly..? – jon Mar 16 '15 at 14:39
  • @giordano - I installed it from within emacs using M-x package-install – bluprince13 Mar 16 '15 at 14:57
  • Actually, I just realised as soon as I set HOME directory, none of the code in my site-start.el file is executed either. – bluprince13 Mar 16 '15 at 14:59
  • If you install AUCTeX with GNU Elpa you must not load it manually – giordano Mar 16 '15 at 15:05

You installed AUCTeX using the GNU Elpa repository, i.e. with M-x package-install RET auctex RET, in this case you must not load it "manually" in your init file, the package manager does it for you. This is clearly explained also in the AUCTeX manual: http://www.gnu.org/software/auctex/manual/auctex.html#Installation

  • Ah you are right. I just removed the lines from site-start.el and it works fine. But then I defined a HOME variable to point towards something specific (so that I can have my own .emacs file and customize it) and then Auctex wouldn't load automatically when I open a .tex file. – bluprince13 Mar 16 '15 at 16:47
  • Where did you define that variable? Inside or outside Emacs? If you want to load Emacs with a different init file than the standard ones, see stackoverflow.com/q/17146844/2442087 instead of fiddling with environment variables. And that's not the point of the question anyway. – giordano Mar 16 '15 at 17:08
  • I defined it outside Emacs in System Properties - Advanced - Environment variables. And yes I know, I didn't realize it was the HOME variable causing the problem until I saw your answer. – bluprince13 Mar 16 '15 at 17:16
  • 1
    Well, unless you have a very good reason to do that, you should not change the value of HOME, other applications use that variable. If you want to really move your home directory, that would not be effective anyway. So, never change the value of HOME. – giordano Mar 16 '15 at 17:18
  • Right, okay I'll just put everything in the site-start.el file then. – bluprince13 Mar 16 '15 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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