From 86ff6659904c83fe1f6059175946cf4b1833aac5 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 23 Sep 2018 20:47:51 -0400 Subject: [PATCH] Add dot2tex org config --- .emacs.d/init.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 707313b..57363bb 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -200,7 +200,25 @@ '((emacs-lisp . t) (dot . t) (python . t))) + (add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)) + (add-to-list 'org-src-lang-modes '("dot2tex" . graphviz-dot)) + + (defvar org-babel-default-header-args:dot2tex + '((:results . "latex") (:exports . "results")) + "Default arguments to use when evaluating a dot2tex source block.") + (defun org-babel-execute:dot2tex (body params) + "Execute a block of Dot code via dot2tex with org-babel. + This function is called by `org-babel-execute-src-block'." + (let* ((cmdline (concat (cdr (assoc :cmdline params)) + " --figonly")) + (cmd (or (cdr (assq :cmd params)) "dot2tex"))) + (org-babel-eval (concat cmd " " cmdline) + (org-babel-expand-body:dot body params)))) + (defun org-babel-prep-session:dot2tex (session params) + "Return an error because dot2tex does not support sessions." + (error "dot2tex does not support sessions")) + (defun org-insert-homework-header () "" (interactive)