From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: shorter syntax for both latex and html export of a figure Date: Mon, 7 Mar 2016 08:34:36 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acy7L-000275-37 for emacs-orgmode@gnu.org; Mon, 07 Mar 2016 11:34:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acy7G-0003lg-2n for emacs-orgmode@gnu.org; Mon, 07 Mar 2016 11:34:47 -0500 Received: from iport-acv4-out.ucsd.edu ([132.239.0.7]:29298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acy7F-0003lS-Qj for emacs-orgmode@gnu.org; Mon, 07 Mar 2016 11:34:42 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode 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