Discussion:
[AUCTeX] simplifying keyboard shortcuts
Jonas Frey
2017-04-24 00:09:47 UTC
Permalink
Hi all,

I would like to configure auctex in a way that when I press f5, it
(1) compiles, and
(2) upon successful compilation calls forward-pdf, and upon unsuccessful
compilation splits the emacs window and shows the first error

Does anbody have something to paste in .emacs to make that work?

With the standard auctex shortcuts I first have to press "C-c C-c Enter" to
compile, and when it fails it tells me to press some other shortcut to see
errors. if it's successful I have to press "C-c C-c Enter" again to
launch/focus the viewer.

Thanks a lot,

Jonas
Mosè Giordano
2017-04-24 09:39:48 UTC
Permalink
Hi Jonas,
Post by Jonas Frey
Hi all,
I would like to configure auctex in a way that when I press f5, it
(1) compiles, and
(2) upon successful compilation calls forward-pdf, and upon unsuccessful
compilation splits the emacs window and shows the first error
Does anbody have something to paste in .emacs to make that work?
AUCTeX already has you covered. If you have a recent version (>=
11.88, but I strongly recommend always using the latest ELPA version)
you can use C-c C-a to compile the document (it'll run all the needed
command to completely build it) and automatically open the viewer. In
addition, if you set `TeX-error-overview-open-after-TeX-run' to t, the
error overview will be presented to you. You can either customize the
variable with

M-x customize-variable RET TeX-error-overview-open-after-TeX-run RET

and toggle to "on", or add the following line to your init file:

(setq TeX-error-overview-open-after-TeX-run t)

C-c C-a is basically meant to replace your C-c C-c workflow, unless
you want to run just once a specific command.

Bye,
Mosè

Loading...