From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Horn Subject: Re: [babel] Including TikZ diagrams as figures in export Date: Mon, 21 Feb 2011 14:29:06 -0500 Message-ID: References: <18FA37FD52964B6B892AAD0C99965D83@gmail.com> <4D61C642.8060205@ccbr.umn.edu> <4D62965A.7020401@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=39418 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrbRs-0002Rs-GB for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 14:29:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrbRr-0006P0-8Y for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 14:29:32 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:49487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrbRr-0006Ol-42 for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 14:29:31 -0500 Received: by fxm5 with SMTP id 5so1700349fxm.0 for ; Mon, 21 Feb 2011 11:29:30 -0800 (PST) In-Reply-To: <4D62965A.7020401@med.uni-goettingen.de> 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: Andreas Leha Cc: emacs-orgmode@gnu.org Andreas, Thanks for the example. I particularly like the use of the noweb to make the blocks work together. I'll adopt this technique until the exporter is modified (no rush, Eric!). This is a great workable solution. Jeff On Mon, Feb 21, 2011 at 11:44 AM, Andreas Leha wrote: > Hi Jeffrey, > > the attached sample file works for me. > > The html is only sub-optimal, though, as it just includes a link to a > pdf file. > > Cheers, > Andreas > > > > Am 21.02.2011 02:56, schrieb Erik Iverson: >> Jeffrey, >> >>> Now, I'd like to integrate them into an org document. I'd like: >>> 1) To use babel to handle the TikZ source >> >> This is possible. >> >>> 2) To wrap the resulting drawing in a figure environment for >>> automatic numbering and centering >> >> See >> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html >> and search for "tikz" for an example. =A0I think you do need to use the >> :file argument >> for this to have org-mode take care of it automatically. >> >> Alternatively, you could just include *all* the latex you want, includin= g >> constructing your own figure environment and caption and refs, in the >> latex >> code block. >> >>> 3) To be able to refer to the figure elsewhere in the document >> >> Should be possible with either approach above. >> >>> 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 >> :file >> source block argument. =A0I think I can help if that's indeed what you >> want. >> >>> 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... >> >> Not deprecated at all according to my understanding: >> >> :results determines how the results are collected from a process. So, >> in R, we >> might want the standard output ':results output' or we might just want >> the last >> value returned by the code block, ':results value'. =A0This determines >> what is >> inserted into the org-mode buffer or the export stream when the code >> block >> is evaluated. >> >> :exports determines if the code and/or the results will be inserted upon >> exporting. *If* the results are inserted, then :results will determine >> how. >> >> :file is useful for code blocks that generate graphical output, such >> as tikz. >> This will divert the output into the named file, and exporting will >> insert >> that file. =A0In the org-mode buffer, a link will be inserted. If a png >> file is >> generated, it can even be displayed inline in the org-mode buffer if >> you turn >> on that functionality. >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > --=20 Jeffrey Horn http://www.failuretorefrain.com/jeff/