Org Export with Burnish
Nov 29, 2026 15:19
I’ve long been a fan of Charles Choi’s Casual Suite. He recently announced a new package called Burnish that I’m finding to be quite useful as well. Burnish automates exporting an Org file and viewing the result. I’ve been achieving this with some functions and shell scripts that I cobbled together, but Burnish is much more elegant.
I have moved from years of using LaTeX to Typst and make my lecture slides with a Typst slide package called Mosaic. The Typst package for Emacs doesn’t quite work the way I like, so I have custom exporters for both Typst and Mosaic. So, I needed to tweak a few things to make Burnish work for me, but that was incredibly easy to do.
I started with installing Burnish and customizing burnish-export-functions to include my custom exporters:
(use-package burnish
:custom
(burnish-export-functions '((html . burnish-export-html)
(md . burnish-export-md)
(odt . burnish-export-odt)
(info . burnish-export-info)
(latex-pdf . burnish-export-latex-pdf)
(typst-pdf . burnish-export-typst-pdf)
(mosaic-pdf . burnish-export-mosaic-pdf ))))
Creating my two Burnish export functions just required looking at burnish.el and modifying one of the included export functions.
(defun burnish-export-typst-pdf ()
"Export Org file to Typst PDF and view."
(let ((basename (file-name-sans-extension (buffer-file-name))))
(org-rlr-typst-export-to-pdf)
(rlr/browse-url-macos-background (file-name-with-extension basename "pdf"))))
(defun burnish-export-mosaic-pdf ()
"Export Org file to Typst Mosaic PDF and view."
(let ((basename (file-name-sans-extension (buffer-file-name))))
(org-rlr-mosaic-export-to-pdf)
(rlr/browse-url-macos-background (file-name-with-extension basename "pdf"))))
I want to keep the PDF viewer in the background and not have to switch back to Emacs. I do this with this small function:
(defun rlr/browse-url-macos-background (url &optional _new-window)
"Open URL in the default macOS browser in the background."
(interactive (browse-url-interactive-arg "URL: "))
(start-process (concat "open " url) nil "open" "-g" url))
I could make browse-url always open in the background by setting browse-url-browser-function to my background open function, but I’m not sure that I want that by default.
Once installed, it works very simply. M-x burnish-select-backend allows you to choose your exporter from an interactive list. It then puts that as a local variable at the end of the file. After loading those variables with M-x revert-buffer, M-x burnish will export the file and open the result. M-x burnish-mode runs burnish on every save, effectively making Burnish function like a watch command.
This process was easy enough to automate even further with one function:
(defun rlr/burnish-start ()
(interactive)
(call-interactively #'burnish-select-backend)
(revert-buffer t t)
(burnish-mode)))
I still have to start burnish-mode whenever I revisit a file. I guess I could go one step further and add a hook to start burnish mode for every org file. There doesn’t seem to be any problems with burnish mode on files that don’t contain the local variables.
It’s simple, functional, and elegant. I was happy to buy Charles a coffee, and even threw in another two that were long overdue for all the benefits I get from Casual.