[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] shorter syntax for both latex and html export of a figure
From: |
Charles C. Berry |
Subject: |
Re: [O] shorter syntax for both latex and html export of a figure |
Date: |
Mon, 7 Mar 2016 08:34:36 -0800 |
User-agent: |
Alpine 2.20 (OSX 67 2015-01-07) |
On Mon, 7 Mar 2016, Alan Schmitt wrote:
Hello,
I'm trying to adapt the example that allows to export a figure both to
tikz and to png so that I don't have to manually add all the header
lines.
Maybe this gets you a step closer
#+begin_src emacs-lisp :results silent
(defmacro by-backend (&rest body)
`(case (org-bound-and-true-p org-export-current-backend)
,@body))
(org-babel-do-load-languages
'org-babel-load-languages
'((latex . t)))
(defalias 'org-babel-execute:tikz 'org-babel-execute:latex)
(defalias 'org-babel-expand-body:tikz 'org-babel-expand-body:latex)
(add-to-list 'org-src-lang-modes '("tikz" . latex))
(defvar org-babel-default-header-args:tikz
'((:imagemagick . "yes")
(:iminoptions . "-density 600")
(:imoutoptions . "-geometry 800")
(:results . "file raw")
(:fit . "yes")
(:headers . "(\\usepackage{tikz})")
(:exports . "results")))
#+end_src
When I run your tikz src block interactively I get two files created. Not
sure why and I haven't time to edebug step thru the code. But maybe you
can handle that bit.
HTH,
Chuck