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