emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: Org-Mode mailing list <emacs-orgmode@gnu.org>,
	Eric S Fraga <e.fraga@ucl.ac.uk>
Subject: Re: Embedding diagrams in Org
Date: Wed, 18 Feb 2015 13:51:30 -0200	[thread overview]
Message-ID: <CADs++6idHnjKVCoJtaUJo_5Tj8qS7HdA9czb7Jy1kR_76hWLeA@mail.gmail.com> (raw)
In-Reply-To: <87d2579uah.fsf@ucl.ac.uk>

On Wed, Feb 18, 2015 at 12:19 PM, Eric S Fraga <e.fraga@ucl.ac.uk> 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

  reply	other threads:[~2015-02-18 15:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 12:34 Embedding diagrams in Org Marcin Borkowski
2015-02-18 14:19 ` Eric S Fraga
2015-02-18 15:51   ` Eduardo Ochs [this message]
2015-02-18 19:01     ` Eric S Fraga
2015-02-19  8:45       ` Sebastien Vauban
2015-02-18 19:37   ` Andreas Leha
2015-02-19  8:49     ` Sebastien Vauban
2015-02-21 11:06       ` Andreas Leha
2015-02-19 14:10     ` Eric S Fraga
2015-03-21 11:23     ` Marcin Borkowski
2015-03-21 21:41       ` Andreas Leha
2015-02-24  0:01   ` Marcin Borkowski
2015-02-24  8:04     ` Eric S Fraga
2015-02-24 17:00       ` Charles C. Berry
2015-03-05  8:51         ` Sebastien Vauban
2015-03-04 19:19 ` Marcin Borkowski
2015-03-04 19:37   ` Rasmus
2015-03-04 21:22   ` Andreas Leha
2015-03-05  8:12     ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADs++6idHnjKVCoJtaUJo_5Tj8qS7HdA9czb7Jy1kR_76hWLeA@mail.gmail.com \
    --to=eduardoochs@gmail.com \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).