[Top][All Lists]

[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: Fri, 04 Sep 2015 09:10:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

Thanks to everyone, I now have this working. Here is the final version.

--8<---------------cut here---------------start------------->8---
#+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 
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 800
#+header: :results file raw
#+header: :fit yes
#+header: :headers '("\\usepackage{tikz}")
#+begin_src latex
    \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} }};


* COMMENT setup
#+begin_src emacs-lisp :results silent
  (setq org-babel-latex-htlatex "htlatex")
  (defmacro by-backend (&rest body)
    `(case org-export-current-backend ,@body))
--8<---------------cut here---------------end--------------->8---

The header line that says to use the package tikz right before the
source block is only necessary to generate the png when evaluating the
block (“C-c C-c” on it), but as it does not prevent the export to work,
I leave it there.

I had to change my systems pgfsys-tex4ht.def as described in
(having a local copy and modifying it as suggested on the site did not

Thanks again,


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]