#!/bin/bash
#
# this is horrible... quotes all around :-(
#
# but creating a temporary file like in
#
# cat > /tmp/export.$$ <<EOF
# (progn
#   (require 'ox-beamer)
#   (add-to-list 'org-beamer-environments-extra '("picblock"  "P" "\\begin{picblock}%o{%h}"      "\\end{picblock}"))
#   (org-beamer-export-to-latex)
#   )
# EOF
# /usr/bin/emacs $1 --batch --eval="(load-file \"/tmp/export.$$\")"
# rm /tmp/export.$$
#
# is horrible too :-(
#

/usr/bin/emacs $1 --batch --eval="\
(progn \
  (require 'ox-beamer) \
  (add-to-list 'org-beamer-environments-extra '(\"picblock\"  \"P\" \"\\\\begin{picblock}%o{%h}\"      \"\\\\end{picblock}\")) \
  (setq org-confirm-babel-evaluate nil) \
  (org-beamer-export-to-latex) \
  )"
