3

I'm very new to Emacs. I've installed AUCTeX version 11.89.4 using package manager (list-packages, select auctex, install it). It works, at least it shows compiled pdf result from test .tex file in local buffer after several C-c C-c strokes. Now I want to do some customization -- for example, showing result in external evince program. However, the more tutorials and docs I read, the more it seems to me that my AUCTeX installation is somehow broken:

  • I know that C-h v AUCTeX-version should give me AUCTeX version. However, I don't have such variable -- describe variable gives no match. I have learned that the version is 11.89.4 from the package manager.
  • I don't have variable TeX-view-program-list, which, as I've read, is used for setting view program. In fact, I have only three variables starting with Tex, and all of them I've declared in initl.el myself: TeX-PDF-mode, TeX-auto-save, TeX-pase-self.
  • I don't have menu item LaTeX which is mentioned here. I have only menu item TeX, and there is no "Customize AUCTeX" submenu: enter image description here
  • There is no key C-c ~ which is supposed to turn on math mode. There is no variable LaTeX-math-abbrev-prefix and no function LaTeX-math-mode, although I've added line (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) to my init.el and it had been read without any problems.
  • some other things, but I think this should be enough to show the problem.

My OS is Ubuntu 14.04, GNU Emacs 24.5.1. This is version is still absent from Ubuntu repos, so I have built it from sources and installed via checkinstall.

Additional info: Ubuntu package auctex is not installed -- I just followed manual instructions and it doesn't says anything about system-wide packages. I have no variable TeX-lisp-directory; If I start Emacs without executing init.el (-q), and then run M-x package-initialize, I get the following error: (file-error "Cannot open load file" "no such file or directory" "tex-site"). I don't know what it means right now, but it seems that google has something on this -- I will look into.

There is another point which, as I think, should be made clear. As I have read in EmacsWiki since Emacs 24 package initialization happens after loading init.el. However, I needed package-installed-p function, so I forced loading packages in the beginning of init.el by inserting the following code (taken from wiki):

(setq package-enable-at-startup nil)
(package-initialize)

Update

I didn't noticed earlier, but in fact I get error "no such file or directory" "tex-site" after running package-initialize when calling in from init.el too. It seems to me that the root of my problem is that I forgot to add the line (require 'auctex). After adding it, auctex finally works, I have TeX-lisp-directory and other vars, however, now I see the following warning in Messages:

Warning (initialization): An error occurred while loading `/home/ars/.emacs.d/init.el':

error: Required feature `auctex' was not provided

What's wrong with this way of loading packages? Should I require them explicitly or not?

6
  • 1
    You're running Emacs's built-in TeX mode, not AUCTeX. Is Ubuntu's auctex package installed? Are you running Emacs from an Ubuntu package or installed manually? What is the value of the variable TeX-lisp-directory? If you run emacs -q then M-x package-initialize, what is the value of the variable TeX-lisp-directory? Jun 6, 2016 at 21:32
  • 1
    from memory: it should be require 'latex or require 'tex instead of auctex.
    – mutbuerger
    Jun 7, 2016 at 12:31
  • @mutbuerger thanks, 'latex worked. If I would do it myself, where should I look for this name?
    – ars
    Jun 7, 2016 at 12:55
  • AuCTeX doesn't provide a feature called auctex: (member 'auctex features) is nil. But taking a look at the auctex directory, you'll discover a latex.el ending with (provide 'latex), therefore providing the feature latex. latex.el requires tex.el which in turn requires tex-site.el etc. So the feature latex is the right "entry point". Thankfully most Elisp libraries consist of a single file.
    – mutbuerger
    Jun 7, 2016 at 14:19
  • 1
    @mutbuerger I don't know where you found the suggestion to use (require 'anything) to load AUCTeX: there is not a single line in AUCTeX manual suggesting so. This is not only wrong and useless, but also harmful. I'd like to know who is suggesting this configuration on the Internet
    – giordano
    Jun 7, 2016 at 19:52

1 Answer 1

-2

If packages are initialized in init.el by hand, it is necessary to load every used package explicitly. For auctex, loading the package is covered in the manual. One should also always check *Messages* buffer before posting questions here...

2
  • 3
    -1. This is plainly wrong. You don't need at all to require any package of AUCTeX to make it work. This is wrong, useless and harmful.
    – giordano
    Jun 8, 2016 at 10:23
  • I see, fixed now.
    – ars
    Jun 9, 2016 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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