 	     'org-latex-filter-fancyvrb)
 
 
-;; Add the environment "onlyenv" to display something only on certain slides
-(add-to-list 'org-beamer-environments-extra
-             '("onlyenv" "O" "\\begin{onlyenv}%a" "\\end{onlyenv}"))
-
 ;; Use utf8x for LaTeX export to access more unicode characters
 (setq org-latex-inputenc-alist '(("utf8" . "utf8x")))
 
 ;; Export all org files
-(org-beamer-export-to-pdf-directory ".")
+(org-latex-export-to-pdf-directory ".")

;; Author: Sam Sinayoko
;; Email: s.sinayoko@soton.ac.uk
;; Date: 05/10/2014

(require 'ox-beamer)
(require 'ox-latex)

;; Define an interactive function for easy testing
(defun org-beamer-export-to-pdf-directory (dirname)
  "Export all org files in directory `dirname' to pdf"
  (interactive "DExport org files to pdf in directory:")
  (save-excursion

      (dolist (org-file (directory-files dirname nil "\.org$"))
	(message "*** Exporting file %s ***" org-file)
	(find-file org-file)
	(org-latex-export-to-pdf)
	(kill-buffer)))))


