From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Embedding diagrams in Org Date: Sat, 21 Mar 2015 12:23:14 +0100 Message-ID: <87egoioaql.fsf@wmi.amu.edu.pl> References: <87bnkr8kkg.fsf@wmi.amu.edu.pl> <87d2579uah.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZHV0-0000vI-Ao for emacs-orgmode@gnu.org; Sat, 21 Mar 2015 07:23:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZHUx-000333-0k for emacs-orgmode@gnu.org; Sat, 21 Mar 2015 07:23:26 -0400 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:58428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZHUw-00032v-QS for emacs-orgmode@gnu.org; Sat, 21 Mar 2015 07:23:22 -0400 Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 6FB595AE84 for ; Sat, 21 Mar 2015 12:23:20 +0100 (CET) Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8fhgKg4WxhrE for ; Sat, 21 Mar 2015 12:23:20 +0100 (CET) Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id EF6125AE83 for ; Sat, 21 Mar 2015 12:23:19 +0100 (CET) In-reply-to: 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 On 2015-02-18, at 20:37, Andreas Leha wrote: > I also use tikz in my org files. I just include a slightly more > involved version of Eric's example to show some of the beauty of org. OK, so I'm trying to understand it. (One of the reasons is that it doesn't work for me; somehow I couldn't get the svg export for inclusion in HTML. OTOH, conversion using pdf2svg does work for me (in LaTeX files), so I want to learn how to utilize it for Org-mode.) > This includes a caption for the diagram, and different output formats > for different export routes. > > Best, > Andreas > > --8<---------------cut here---------------start------------->8--- > #+LATEX_HEADER: \usepackage{tikz} > > * tikz example > > #+name: tikz_example > #+header: :packages '(("" "tikz")) What does the above line do exactly? > #+header: :file (by-backend (latex "example_diagram.tikz") (html "example_diagram.svg") (t "example_diagram.png")) The manual says that after :file I can have a string or a list of two strings. Does the above mean that it is in fact macroexpanded? Do I get it correctly that the (t "example_diagram.png") refers to manual evaluation and not the evaluation during the export? > #+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 800 > #+header: :results file raw > #+header: :fit yes > #+begin_src latex > \begin{tikzpicture} > \node[red!50!black] (a) {A}; > \node (b) [right of=a] {B}; > \draw[->] (a) -- (b); > \end{tikzpicture} > #+end_src And, last but not least: how exactly the magic of tikz -> svg is supposed to work here? Do I get it correctly that in you example, Imagemagick handles both png and svg? What if I want to use pdf2svg instead? > #+caption: A tikz example diagram with a caption > #+results: tikz_example > [[file:example_diagram.png]] > --8<---------------cut here---------------end--------------->8--- TIA, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University