emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Inlining TikZ blocks as SVG in HTML export


From: Christophe Garion
Subject: [O] Inlining TikZ blocks as SVG in HTML export
Date: Wed, 09 Jan 2019 22:46:12 +0100
User-agent: mu4e 1.1.0; emacs 26.1.50

Hello,

I would like to be able to export Org files containing TikZ pictures to
HTML files with SVG pictures corresponding to TikZ pictures inlined
directly in the HTML files. My use case is to produce quizz questions
with graph drawings for the Moodle LMS (https://moodle.org/) used at our
university. It is really painful to upload picture files to Moodle and link
them to text and Moodle accepts plain HTML5 for text description, so it
seems to be a rather food solution.

Of course, I can use LaTeX source blocks to generate a SVG file like

#+begin_src latex :results none :exports results :file "tree.svg"
  \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

but I must confessed that I am a bit lost with code blocks parameters
and that I have not found how to properly inline SVG in HTML export.

Sorry if the answer can be easily found on the web and thanks in
advance,

Christophe

--
Christophe Garion
GPG: 1982 15B2 64AC 3C34 532D  BF19 6CD6 246C 62DA 5A7F



reply via email to

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