Bala's Blog

Batch export Org to Beamer

August 11 2018
88 words, ~1 min. read
emacs,  org-mode,  beamer,  emacs-lisp 

While I am slowly getting accustomed in creating Beamer presentations using Emacs Org-mode, I wanted to automate using batch processing. By using emacs-lisp (a.k.a elisp), found it was very easy.

  emacs \
      -u "$(id -un)"                 \ # get user id
      --batch                         \ # run emacs as "batch"
      --eval '(load user-init-file)' \ # e.g. ~/.emacs.d/init.el
      hello.org                       \ # org file to be converted to beamer
      -f org-beamer-export-to-pdf       # produces hello.pdf

For bulk processing, found emacsclient a better option.

  emacsclient             \
      --suppress-output \
      -e "(progn (find-file \"hello.org\") (org-beamer-export-to-pdf) (kill-buffer) )"