this is a part of my init file
(use-package tex-site :ensure auctex :mode ("\\.tex\\'" . latex-mode) :bind (:map LaTeX-mode-map ("<f5> <f5>" . TeX-command-save-buffer-and-run-all))) :init (defun TeX-command-save-buffer-and-run-all () "Save the buffer and run TeX-command-run-all" (interactive) (let (TeX-save-query) (TeX-save-document (TeX-master-file))) (TeX-command-run-all nil))
None binding is done in latex-mode, but if I evaluate this after a tex file has been opened,it works fine.
I tried (find-file "mwe.tex) in my init file, and the bindings works. I suppose there is a smarter way to make this init file work like I want it to
latex
instead oftex-site
? – Omar Jun 7 at 12:56tex-site.el
does not defineLaTeX-mode-map
.LaTeX-mode-map
is defined inlatex.el
andtex-site.el
does not loadlatex.el
. From that point of view Omar's suggestion to replacetex-site
withlatex
appears to be right. – Tobias Jun 8 at 0:37foo.tex
with(require 'latex)
. That is the thing that might be relevant for your problem. – Tobias Jun 8 at 0:41