some enhancement
This commit is contained in:
parent
16a2d8d290
commit
8cdf1ea3c0
@ -93,7 +93,7 @@
|
||||
"\" cd " dir ";"
|
||||
cmd "\"")))
|
||||
|
||||
(defun tikz-script (fmt tikz-libs body)
|
||||
(defun tikz-script (fmt tikz-libs gd-libs body)
|
||||
(setq tikz-prologues
|
||||
(concat "\\documentclass{article}\n"
|
||||
"\\usepackage{tikz}\n"
|
||||
@ -103,6 +103,11 @@
|
||||
tikz-libs
|
||||
"}\n")
|
||||
"")
|
||||
(if gd-libs
|
||||
(concat "\\usegdlibrary{"
|
||||
gd-libs
|
||||
"}\n")
|
||||
"")
|
||||
"\\begin{document}\n"
|
||||
"\\begin{tikzpicture}"))
|
||||
|
||||
@ -133,14 +138,22 @@ This function is called by `org-babel-execute-src-block'."
|
||||
"pdf"))
|
||||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(in-file (org-babel-temp-file "tikz-"))
|
||||
(latex-engine
|
||||
(let ((engine (tikz-get-value-by-name 'latex-engine
|
||||
(org-babel--get-vars params))))
|
||||
(if engine
|
||||
engine
|
||||
org-tikz-program)))
|
||||
(cmd
|
||||
(concat (concat org-tikz-program " -shell-escape ")
|
||||
(org-babel-process-file-name in-file)
|
||||
(concat (concat latex-engine " -shell-escape ")
|
||||
(org-babel-process-file-name (concat in-file ".tex"))
|
||||
)))
|
||||
(with-temp-file (concat in-file ".tex")
|
||||
(insert (tikz-script format
|
||||
(tikz-get-value-by-name 'tikz-libs
|
||||
(org-babel--get-vars params))
|
||||
(tikz-get-value-by-name 'gd-libs
|
||||
(org-babel--get-vars params))
|
||||
(org-babel-expand-body:generic
|
||||
body params
|
||||
(org-babel-variable-assignments:tikz params)))))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user