From 1d9c381c309a3a72b5d9feb3db28cdaed920c16d Mon Sep 17 00:00:00 2001 From: Andreas Leha Date: Wed, 17 Jul 2013 16:45:32 +0200 Subject: [PATCH] add *.tikz files as possible result files for latex blocks * lisp/ob-latex.el (org-babel-execute:latex) add a tizk option that copies the body of the block into a tikz file --- lisp/ob-latex.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ob-latex.el b/lisp/ob-latex.el index f916eb0..f9216e1 100644 --- a/lisp/ob-latex.el +++ b/lisp/ob-latex.el @@ -95,7 +95,11 @@ This function is called by `org-babel-execute-src-block'." ((and (string-match "\\.png$" out-file) (not imagemagick)) (org-create-formula-image body out-file org-format-latex-options in-buffer)) - ((or (string-match "\\.pdf$" out-file) imagemagick) + ((string-match "\\.tikz$" out-file) + (when (file-exists-p out-file) (delete-file out-file)) + (with-temp-file out-file + (insert body))) + ((or (string-match "\\.pdf$" out-file) imagemagick) (with-temp-file tex-file (require 'ox-latex) (insert -- 1.7.10.4