2

From time to time I am having trouble using auctex properly. That means, after typing-in C-c C-f C-e I receive the following error message:

Symbol’s function definition is void: texmathp

Sometimes I am also unable to type in a minus symbol -, same error message.

I have installed auctex-12.1.1 via elpa (on a Windows machine, for more information see below).

I used to have something like

(require 'tex-site)
(require 'tex-mik)

in my init.el (see below).

The strange thing is, everything works without (require 'tex-mik) but then I am unable to use C-c C-f C-e (includes an \emph{}) or C-c C-e, which I really depend on.

Any ideas what is going on?

My emacs version

In GNU Emacs 25.3.1 (x86_64-w64-mingw32)
 of 2017-09-12 built on KAEL
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --prefix=/tmp/emacs --without-imagemagick --without-dbus
 --with-modules 'CFLAGS=-O2 -g0''

My init.el (hopefully a MWE)

(require 'package)

(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")
                         ("melpa" . "http://melpa.org/packages/")
             ("org" . "http://orgmode.org/elpa/")
             ("elpy" . "https://jorgenschaefer.github.io/packages/")
             ))

(setq package-check-signature nil)



(add-to-list 'load-path "~/.emacs.d/site-lisp/")  

(let ((default-directory "~/.emacs.d/site-lisp/"))
  (normal-top-level-add-subdirs-to-load-path))   

(package-initialize)

(require 'tex-site)
(require 'tex-mik)
  • Can you please remove (require 'tex-site) (require 'tex-mik) from your init file, restart Emacs and then remove and re-install AUCTeX from ELPA? – Arash Esbati May 23 '18 at 20:00
  • Thanks, @ArashEsbati ! Id did that, however, as I mentioned in my question, then essential AUCTeX features (e.g., C-c C-e) no longer work. During the installation process, I also got the following error: autoload-generate-file-autoloads: tex-jp.el:0:0: error: scan-error: (Unbalanced parentheses 24404 44141) – Bernd Weiss May 24 '18 at 6:12
0

Okay, I think that I found the error:

  1. Searching for the autoload-generate-file-autoloads:... error (see my comment under my question) lead to another question on https://emacs.stackexchange.com/a/18467/168 that provided a solution on how to properly set the encoding system ("How to permanently choose a encoding system in emacs for opening and saving?").

  2. So, in my init.el, I removed all utf8-related lines and added just one line

(set-language-environment "UTF-8")

  1. Then, I removed AUCTeX again, reinstalled it again, and now, everything works like a charm.

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.