From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Embedding diagrams in Org Date: Wed, 04 Mar 2015 21:22:46 +0000 Message-ID: References: <87bnkr8kkg.fsf@wmi.amu.edu.pl> <874mq0d0zg.fsf@amu.edu.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTGl4-0005UD-LH for emacs-orgmode@gnu.org; Wed, 04 Mar 2015 16:23:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTGl1-0005Ec-9g for emacs-orgmode@gnu.org; Wed, 04 Mar 2015 16:23:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:49511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTGl1-0005EU-32 for emacs-orgmode@gnu.org; Wed, 04 Mar 2015 16:23:07 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YTGkj-0008LG-8H for emacs-orgmode@gnu.org; Wed, 04 Mar 2015 22:22:49 +0100 Received: from cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net ([81.102.136.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Mar 2015 22:22:49 +0100 Received: from andreas.leha by cpc33-cmbg15-2-0-cust4.5-4.cable.virginm.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Mar 2015 22:22:49 +0100 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: emacs-orgmode@gnu.org Marcin Borkowski writes: > e > On 2015-02-18, at 13:34, Marcin Borkowski wrote: > >> Hello all, >> >> I need to embed some diagrams (graphs of functions, for instance, or >> trees) in an Org file. Any suggestions on how to do it? In case of >> ditaa, I can use a source block and the "results" line, and see the >> image with C-c C-x C-v. Can I do a similar thing with Asymptote? How >> hard/time-consuming would it be to add support e.g. for tikz or other >> such tools? >> >> Best, > > While the answers I got were helpful, and thank you all for them, my > curiosity jumped two levels up when I saw the code for > org-latex--inline-image in ox-latex today. It seems that there are > special provisions for tikz pictures. However, the code does seem to be > a bit weird: for instance, the tikz code seems to be wrapped in the > tikzpicture environment depending on whether any /options/ are given or > not, which seems an odd choice to me. > > Did anyone use the ability to inline tikz pictures (i.e., pictures in > a file with =tikz= or =pgf= extension)? If so, could you share some > examples, or at least success stories? > The example I posted earlier in this thread [1] uses the *.tikz version for latex export. I do not know, whether that helps, but I think the behaviour of the tikz graphics has been decided in this thread [2]. The wrapping in tikzpicture if options are present is quite sensible, as these options have to be presented somewhere. Note, that it is fine to nest tikzpicture environments. So, the *.tikz file is basically expected to bring its own tikzpicture environment. If there are options given in the org file, this is just wrapped into another tikzpicture environment. (If I understand the reasoning correctly, that is...) Regards, Andreas > Also, org-latex--inline-image seems to provide for including svg images, > but I could not find a \usepackage{svg}, nor a provision for enabling > shell-escape (like in the case of minted). Again: any success stories > or is there a bug? > [1] http://permalink.gmane.org/gmane.emacs.orgmode/95197 [2] http://thread.gmane.org/gmane.emacs.orgmode/66900