From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] Including TikZ diagrams as figures in export Date: Mon, 21 Feb 2011 09:57:51 -0700 Message-ID: <87pqql5mss.fsf@gmail.com> References: <18FA37FD52964B6B892AAD0C99965D83@gmail.com> <4D61C642.8060205@ccbr.umn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=47167 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrZPF-0006l3-7n for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 12:18:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrZOu-0004zI-O0 for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 12:18:22 -0500 Received: from mail-yi0-f41.google.com ([209.85.218.41]:49617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrZOu-0004zB-LO for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 12:18:20 -0500 Received: by yib2 with SMTP id 2so973002yib.0 for ; Mon, 21 Feb 2011 09:18:19 -0800 (PST) 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: Jeff Horn Cc: Org-mode ml Jeff Horn writes: > On Sun, Feb 20, 2011 at 8:56 PM, Erik Iverson wrote: >> See http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html >> and search for "tikz" for an example. =C2=A0I think you do need to use t= he :file >> argument >> for this to have org-mode take care of it automatically. > > Thanks for the link. I was glad to find out I could include a TikZ > library in the code block instead of the LaTeX header! > >> Alternatively, you could just include *all* the latex you want, including >> constructing your own figure environment and caption and refs, in the la= tex >> code block. > > This is the workaround I've used thus far. I don't like it very much, > since it is fragile w.r.t. HTML export. > I agree this is not ideal. The solution here is for the Org-mode exporter to recognize blocks as figure-wrapable items. This would solve the above, as well as make it possible to reference exported source code, verbatim environments, quotes, etc... I haven't looked at the org exporter to see how large of a change this would be, however I'll put this on my growing TODO list. > >>> 4) (optional) To be able to seamlessly export to both LaTeX and HTML >> >> So should the HTML exporter generate a PNG file then, as opposed to PDF? >> This is possible, but requires some 'conditional' elisp code in your :fi= le >> source block argument. =C2=A0I think I can help if that's indeed what yo= u want. > > This would be handy information to have, but definitely not a top > priority ATM. (That is, if you're busy, feel free to put this on low > priority!) > >>> And somewhat unrelated, is ":results" now deprecated in favor of >>> ":exports"? What about ":file"? I'm sufficiently new to babel that thes= e all >>> seem like they could be taken care of with a single header argument with >>> many options... >> >> Not deprecated at all according to my understanding: >> :results is not deprecated, the Org manual maintains an up-to-date list of code block header arguments. http://orgmode.org/manual/Working-With-Source-Code.html Cheers -- Eric