From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Iverson Subject: Re: TikZ to separate file (babel?) possible? Date: Fri, 22 Oct 2010 15:35:53 -0500 Message-ID: <4CC1F5A9.6060501@ccbr.umn.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=41826 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9OLI-0003Hx-Qt for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 16:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9OLH-0003se-Cz for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 16:36:00 -0400 Received: from walleye.ccbr.umn.edu ([128.101.116.11]:3972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9OLH-0003sY-0F for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 16:35:59 -0400 In-Reply-To: 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: John Hendy Cc: emacs-orgmode John, Does http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.php#sec-4_2 help? There is a tikz example there. The :file argument may be all you're missing, and putting your code in a latex source block. Here is what I do when I have an R code block that generates LaTeX code. Hopefully this can be adapted to your case. #+srcname: R-latex #+begin_src R :results silent :exports code lf <- function() { "\\LaTeX" } lf() #+end_src #+begin_src latex :noweb yes :file (if (and (boundp 'htmlp) htmlp) "latex-logo-html.png" "latex-logo.png") :buffer (if (and (boundp 'htmlp) htmlp) "no" t) <>~is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. <>~is the de facto standard for the communication and publication of scientific documents. <>~is available as free software. #+end_src That messy :file and :buffer arguments needs some explanation. They are there so that when I eval the code block *in* an org-mode buffer, with C-c C-c, that an image will be generated to be inserted into the buffer. However, this uses my background color in emacs, which I don't actually want when exported to HTML, that's what the :buffer argument controls. Essentially, it's just what arguments get passed to dvipng (if I recall correctly). On Latex export, the actual latex code should be included in the document, so I think all of my use cases are covered. The only issue is that org-mode doesn't display PDFs generated from a :file argument in buffer, but you might not care about that. If you're an R user, you might also check out the tikzDevice package: http://r-forge.r-project.org/projects/tikzdevice/ HTH, --Erik John Hendy wrote: > Hi, > > > I've recently gotten into TikZ and love it. It is simply fantastic for > creating neat diagrams and other thingies. > > One question... I created an org file with a flow chart in it and simply > put my TikZ code in between #+begin_latex and #+end_latex. This is fine > when the picture is in a document, but what if I want just a > .png/jpg/eps/pdf output? Is it possible to use babel or something else > so that I can simply generate a picture vs. needing it to be "in" the > PDF output? > > I can ask the PGF list as well, but this one is far more active and I > know some use TikZ here. I ask because sometimes in my notes I'd like to > have the code present but also be able to reuse my work elsewhere, like > when I have to present using powerpoint. It'd be nice to just grab the > picture (like what I do with gnuplot output) rather than generating a > pdf just for the TikZ pic, screenshot or gimp it down to size, and then > be able to use it. > > Does that make sense? It seems like babel would be perfect for this. It > already allows all the typical handles -- file output, what to export, etc. > > Or does this already exist and I'm ignorant? > > > Thoughts? > John > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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