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