From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: Block level specification for tex code html export method Date: Thu, 03 Sep 2015 13:42:09 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXSvK-0006lT-2x for emacs-orgmode@gnu.org; Thu, 03 Sep 2015 07:43:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXSvE-0005oU-Vf for emacs-orgmode@gnu.org; Thu, 03 Sep 2015 07:43:22 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:10452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXSvE-0005nn-KO for emacs-orgmode@gnu.org; Thu, 03 Sep 2015 07:43:16 -0400 In-Reply-To: (Andreas Leha's message of "Wed, 12 Aug 2015 09:50:13 +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: Andreas Leha Cc: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Andreas, I=E2=80=99m slowly catching up on the org mailing list, and I found your ex= ample very interesting. I tried to run it and it does not seem to work here. Here is what I did: =2D I copied the code below to a file =2D I evaluated the last block =2D I made sure that latex was one of the org-babel-load-languages language =2D I tried executing the first block, which generated this strange png =20=20 --=-=-= Content-Type: image/png Content-Disposition: attachment; filename=tree.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAAgAAAAMCAIAAADQ/GvKAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA 3ElEQVQYGU1OMQtGUBR93ysp0pcUJQaxWQ1YmGRSJpvRJj9G4UfJapJ/wGAwvu88y+fWve/dczr3 HMIYW5alLEvf9xVFCYIACIoSQvI8tyzrvm9d1+d5HoYBIN227boux3G+TwEax5ETaFEUi6KAwjRN rIIgcMJ13fM8YWMYxr7vlNKqqkAQ+BzH0fe953mSJMmy/HgzTkzThJkkCVLhDvyxcnOEgXRd1yiK kKBpGn6q6zrMOI6R2LZtiFRV5Yq2bcMwrOsakTRNQ7Y0TbkCzvx5VZZlUHzQL/D//QEIXWZKLiSM DwAAAABJRU5ErkJggg== --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D I exported both to html and pdf, and in both cases I would have a reference to the png instead of the svg/tikz code. I=E2=80=99m afraid I=E2=80=99m missing a step. Do you see what I=E2=80=99m = doing wrong? Thanks, Alan On 2015-08-12 10:50, Andreas Leha writ= es: > #+LATEX_HEADER: \usepackage{tikz} > > First execute the second code block, to define the convenience macro > and to set the required new variables in ob-latex.el. Then export to > HTML and to pdf to see the tree exported as an SVG image and as > embedded tikz respectively. > > * Tikz test > Here's a tree, exported to both html and pdf. > > #+header: :file (by-backend (html "tree.svg") (latex "tree.tikz") (t "tre= e.png")) > #+header: :imagemagick :iminoptions -density 600 :imoutoptions -geometry = 800 > #+header: :results file raw > #+header: :fit yes > #+begin_src latex > \usetikzlibrary{trees} > \begin{tikzpicture} > \node [circle, draw, fill=3Dred!20] at (0,0) {1} > child { node [circle, draw, fill=3Dblue!30] {2} > child { node [circle, draw, fill=3Dgreen!30] {3} } > child { node [circle, draw, fill=3Dyellow!30] {4} }}; > \end{tikzpicture} > #+end_src > > #+results: > [[file:tree.png]] > > * COMMENT setup > #+begin_src emacs-lisp :results silent > (setq org-babel-latex-htlatex "htlatex") > (defmacro by-backend (&rest body) > `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,= @body)) > #+end_src =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Last week athmospheric CO=E2=82=82 average (Updated August 31, 2015, Mauna = Loa Obs.): 377.82 ppm --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJV6DISAAoJEAQNCjtO0uXHnIkH/0KE8mPo7R9deWvv6wVFqvAi sxeqDACWRen1PIJP0zeDy5DRX/sED+VTAmtkPuNJbjTLzrZDFf4QDsb9R1vINWQ0 FCfTZhM/p3C8/CJuJGbMLtRkQPQaiSMR8YhM3N1mDiL91lZ+Iu6Z2KxBX7lrM5kX NP3tnKYL5nR6l5DRskyMre/R50PqwZD4zGX45Ph/kvDYUD0kb5MqUQC8gqTLfELw lRsYtisVaI+tsM1tYVpfGnauRXwRQkzcET6pLCbeQj08q2FldzFrFZ3v9o0eTao7 Hk6jDSerkyfHJK/b5ilZG9/OKPGxASSbtdKVsmATy/M9X8xwTZ4Q7wz8gH9lDjA= =UNR8 -----END PGP SIGNATURE----- --==-=-=--