From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey Horn Subject: [babel] Including TikZ diagrams as figures in export Date: Sun, 20 Feb 2011 18:03:53 -0500 Message-ID: <18FA37FD52964B6B892AAD0C99965D83@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=41705 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrIJq-0003vn-S1 for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 18:03:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrIJp-0005HT-Tq for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 18:03:58 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:40858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrIJp-0005HN-OJ for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 18:03:57 -0500 Received: by vxc38 with SMTP id 38so419484vxc.0 for ; Sun, 20 Feb 2011 15:03:56 -0800 (PST) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode ml Hey orgsters, I'm having a hard time fitting TikZ into my workflow. I spent a little time learning TikZ recently and have all the diagrams working in a tex file. Now, I'd like to integrate them into an org document. I'd like: 1) To use babel to handle the TikZ source 2) To wrap the resulting drawing in a figure environment for automatic numbering and centering 3) To be able to refer to the figure elsewhere in the document 4) (optional) To be able to seamlessly export to both LaTeX and HTML I don't really care about 4 right now, but the others are frustrating me a bit. I expected this would do what I wanted: #+caption: This is a figure. #+label: fig:ref #+begin_src latex <> #+end_src No dice. I get all sorts of unresolved references, no figures, no centering. I'm guess the exporter doesn't know how to integrate TikZ graphics with the #+caption and #+label options. I could create a separate file for holding my diagrams and use babel to spit them out as files, or just use LaTeX and forget about org, but I'd rather not. So I googled around, thought I had an answer, then tried this: #+source: a-name #+begin_src latex <> #+end_src #+caption: This is a figure. #+label: fig:ref #+begin_src emacs-lisp :var path=a-name :results latex (format "input{%s}" path) #+end_src I'm not getting what I expect. What do I need to do differently? And somewhat unrelated, is ":results" now deprecated in favor of ":exports"? What about ":file"? I'm sufficiently new to babel that these all seem like they could be taken care of with a single header argument with many options... Thanks for the help! -- Jeffrey Horn http://www.failuretorefrain.com/jeff/ Sent with Sparrow