From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Ochs Subject: Re: Embedding diagrams in Org Date: Wed, 18 Feb 2015 13:51:30 -0200 Message-ID: References: <87bnkr8kkg.fsf@wmi.amu.edu.pl> <87d2579uah.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO6uS-0002ci-VK for emacs-orgmode@gnu.org; Wed, 18 Feb 2015 10:51:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO6uR-0005El-P7 for emacs-orgmode@gnu.org; Wed, 18 Feb 2015 10:51:32 -0500 Received: from mail-qa0-x22e.google.com ([2607:f8b0:400d:c00::22e]:57515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO6uR-0005Cm-Lq for emacs-orgmode@gnu.org; Wed, 18 Feb 2015 10:51:31 -0500 Received: by mail-qa0-f46.google.com with SMTP id n4so1351164qaq.5 for ; Wed, 18 Feb 2015 07:51:30 -0800 (PST) In-Reply-To: <87d2579uah.fsf@ucl.ac.uk> 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: Org-Mode mailing list , Eric S Fraga On Wed, Feb 18, 2015 at 12:19 PM, Eric S Fraga wrote: > On Wednesday, 18 Feb 2015 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? > > Support for tikz is there implicitly in that there is support for > LaTeX. I use tikz all the time. > > Simple example attached. > > I do believe others have used asymptote in the past. > > HTH, > eric > -- > : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-843-ga5f1a3.dirty Hi Eric, I tested your example - with `C-c C-e l o' to export to LaTeX and open the PDF file -, and the ellipse in the middle of the sentence appeared, but the block #+begin_src latex :results latex raw :exports results \begin{tikzpicture} \node[red!50!black] (a) {A}; \node (b) [right of=a] {B}; \draw[->] (a) -- (b); \end{tikzpicture} #+end_src did not make its way to the t.tex file... I asked for help in the #org-mode channel at freenode, as I am an Org newbie, and found a fix. Your example is one of the best one I've seen so far of diagrams- in-Org-for-newbies, but it seems to be at least one micro-bug from perfect, as it supposes that the person trying it has already enabled latex support in babel! Here is an idea to make your example more newbie-friendly: add the comments below to it. # Note that you may have to add latex support to babel # to make the tikzpicture block work... # see: (info "(org)Languages") # try: (org-babel-do-load-languages 'org-babel-load-languages '((latex . t))) # # To disable to question "Evaluate this latex code block on your system?", # see: (info "(org)Code evaluation security") # try: (setq org-confirm-babel-evaluate nil) Cheers =), Eduardo Ochs eduardoochs@gmail.com http://angg.twu.net/ http://angg.twu.net/eev-intros/find-eval-intro.html