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)