Skip to content

Instantly share code, notes, and snippets.

@gtuckerkellogg
Last active November 15, 2016 22:33
Show Gist options
  • Save gtuckerkellogg/41a924445a814f2d49dd to your computer and use it in GitHub Desktop.
Save gtuckerkellogg/41a924445a814f2d49dd to your computer and use it in GitHub Desktop.
Org mode caption export filter
(defun my-org-beamer-caption (contents backend info)
"Org export filter to allow use of #+CAPTION: keywords in
beamer org export, by removing floats using the \\captionof*
macro. Requires use of the caption package "
(when (eq backend 'beamer)
(replace-regexp-in-string
"\\\\caption\{" "\\\\captionof*{figure}{"
(replace-regexp-in-string
"\\\\end\{figure\}" "%"
(replace-regexp-in-string "\\\\begin\{figure\}" "%" contents)))))
(add-to-list 'org-export-filter-final-output-functions 'my-org-beamer-caption)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment