Skip to content

Instantly share code, notes, and snippets.

@AyeGill
Last active December 21, 2015 11:38
Show Gist options
  • Select an option

  • Save AyeGill/6299951 to your computer and use it in GitHub Desktop.

Select an option

Save AyeGill/6299951 to your computer and use it in GitHub Desktop.
A emacs lisp command that uses pdflatex to compile a pdf version of the active buffer, then view it with evince.
(defun view-latex ()
(interactive)
(if (buffer-modified-p) (save-buffer))
(shell-command (concat "pdflatex " buffer-file-name " >> /dev/null"))
(shell-command (concat "evince " (substring buffer-file-name 0
(- (length buffer-file-name) 4)) ".pdf >> /dev/null")))
;Obviously, replace "pdflatex" and "evince" with your own latex and pdf viewer systems, respectively.
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment