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 withTex
, and all of them I've declared ininitl.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 itemTeX
, and there is no "Customize AUCTeX" submenu: - There is no key
C-c ~
which is supposed to turn on math mode. There is no variableLaTeX-math-abbrev-prefix
and no functionLaTeX-math-mode
, although I've added line(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
to myinit.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?
auctex
package installed? Are you running Emacs from an Ubuntu package or installed manually? What is the value of the variableTeX-lisp-directory
? If you runemacs -q
thenM-x package-initialize
, what is the value of the variableTeX-lisp-directory
?require 'latex
orrequire 'tex
instead ofauctex
.'latex
worked. If I would do it myself, where should I look for this name?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 featurelatex
. latex.el requires tex.el which in turn requires tex-site.el etc. So the featurelatex
is the right "entry point". Thankfully most Elisp libraries consist of a single file.(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