emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Block level specification for tex code html export method


From: Alan Schmitt
Subject: Re: [O] Block level specification for tex code html export method
Date: Thu, 03 Sep 2015 13:42:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

Hello Andreas,

I’m slowly catching up on the org mailing list, and I found your example
very interesting. I tried to run it and it does not seem to work here.
Here is what I did:
- I copied the code below to a file
- I evaluated the last block
- I made sure that latex was one of the org-babel-load-languages
  language
- I tried executing the first block, which generated this strange png
  

Attachment: tree.png
Description: PNG image

- 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’m afraid I’m missing a step. Do you see what I’m doing wrong?

Thanks,

Alan

On 2015-08-12 10:50, Andreas Leha <address@hidden> writes:

> #+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 
> "tree.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=red!20] at (0,0) {1}
>     child { node [circle, draw, fill=blue!30] {2}
>       child { node [circle, draw, fill=green!30] {3} }
>       child { node [circle, draw, fill=yellow!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

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Last week athmospheric CO₂ average (Updated August 31, 2015, Mauna Loa Obs.):
377.82 ppm

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]