The C-c C-c bind runs TeX-command-master. It always asks me "is this what you want to do?" and I'm always hitting return to do it. I'd like a version of this command which just does it without asking.
Asked
Active
Viewed 1,570 times
10
4 Answers
2
This does C-c C-c return, and then return again if we are still in the minibuffer.
It is not extensively tested. A more proper solution would not use keyboard macros, but this works fine.
Standard elisp disclaimer: You may want to change the binding, or make it into a named function instead of a lambda.
(add-hook
'LaTeX-mode-hook
(define-key LaTeX-mode-map
(kbd "<f7>")
(lambda (&optional arg) "Keyboard macro." (interactive "p")
(progn
(kmacro-exec-ring-item (quote ([3 3 return] 0 "%d")) arg)
(and
(derived-mode-p 'minibuffer-inactive-mode)
(kmacro-exec-ring-item (quote ([return] 0 "%d")) arg))))))
Ian Kelling
- 221
1
Set the TeX command you want, mine is XeLaTex. Then you don't need to hit return.
(setq TeX-command-force "XeLaTeX")
Torbjørn T.
- 206,688
user2643268
- 21
-
I think the OP wants the command to still make the appropriate choice (LaTeX, Biber, View,...), not just run one fixed command. – Andrew Swann Nov 19 '13 at 14:30
1
Put his in your .emacs or init.el, you can get all info from the comment
;; compile documents to PDF by default
(setq TeX-PDF-mode t)
;; C-c C-c without prompt, use LaTex by default
(setq TeX-command-force "LaTex")
;; Use C-c C-c to compile the tex file into pdf file automatically using LaTex,
;; and C-c C-v to view it using okular
;; NOTE: C-c C-a to combine C-c C-c and C-c C-v"
(setq TeX-view-program-list
'(("PDF Viewer" "okular -p %(outpage) %o")))
If you use evince, change the "PDF Viewer..." line into
'(("PDF viewer" "evince --page-index=%(outpage) %o")))
CodyChan
- 111
TeXorLaTeXicon in the tool bar to by-pass theC-cC-caccess to these specific commands. BesidesC-cC-chas automatic completion which is useful as you only need to type the first or first view later of the command you need from the command menu. – Nov 16 '13 at 10:05LaTeXbut alsoBibtex,Biber, cleaning, ... This is why pressing Return is important (it shows that you selected one choice). – ppr Nov 16 '13 at 15:15@and the intended recipient). In my comment abovefirst view latermeantfirst few letters(took me 5 minutes to figure it out), sorry about this discomforting sample of the functioning of my brain ... – Nov 17 '13 at 09:44