pdflatex - how to have latexmk work with emacs and okular -
i started using emacs don't know if doing correctly. c-c c-c
prompt says command [pdflatex]:
type in latexmk
. expecting? giving following error:
latexmk: initialization file '/home/dustin/.latexmkrc' gave error: substitution pattern not terminated @ (eval 10) line 1, <gen0> chunk 1. latexmk: stopping because of problem rc file
here .latexmk
file:
$pdflatex = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1' -pdf %s;
and here .emacs
file:
(add-to-list 'load-path "~/.emacs.d/plugins") (setq py-install-directory "~/.emacs.d/plugins") (require 'python-mode) ;; ========== prevent emacs making backup files ========== (setq make-backup-files nil) ;; ========== enable line numbering ========== (line-number-mode 1) ;; ========== set fill column ========== (setq default-fill-column 80) ;; ===== turn on auto fill mode automatically in modes ===== ;; auto-fill-mode the automatic wrapping of lines , insertion of ;; newlines when cursor goes on column limit. ;; should turn on auto-fill-mode default in major ;; modes. other way turn on fill specific modes ;; via hooks. (setq auto-fill-mode 1) ;; ========= set colours ========== ;; set cursor , mouse-pointer colours (set-cursor-color "white") (set-mouse-color "goldenrod") ;; set region background colour (set-face-background 'region "blue") ;; set emacs background colour (set-background-color "black") (defun run-latexmk () (interactive) (let ((tex-save-query nil) (tex-process-asynchronous nil) (master-file (tex-master-file))) (tex-save-document "") (tex-run-tex "latexmk" (tex-command-expand "latexmk -pdflatex='pdflatex -file-line-error -synctex=1'\ -pdf %s" 'tex-master-file) master-file) (if (plist-get tex-error-report-switches (intern master-file)) (tex-next-error t) (progn (demolish-tex-help) (minibuffer-message "latexmk: done.")))))
the error due .latexmkrc file. rather providing command-line option -pdf
can use equivalent configuration option $pdf_mode = 1;
. also, appending source file, %s
, configuration file seem confuse latexmk. thus, try use:
$pdf_mode = 1; $pdflatex = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1';
if want bind latexmk key in emacs , make show errors if there might interested in answers this question.
Comments
Post a Comment