I finally made things work with the following declarations
(org-babel-do-load-languages
 'org-babel-load-languages
 '((latex . t)))
(setq org-babel-latex-preamble (lambda (_)
    "\\documentclass[preview]{standalone}"))
(defun my/org-latex-compile-nonint (orig-fun file &rest args)
  "Call ORIG-FUN as if Emacs were noninteractive."
  (let ((noninteractive t))
    (apply orig-fun file args)))

(advice-add 'org-latex-compile :around #'my/org-latex-compile-nonint)

and src block itself
#+header: :headers '("\\usepackage{tikz}")
#+begin_src latex :file tree.svg :exports results :results raw file
  \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

Now I see a subtle difference:) Is it easy/possible to incorporate this
nice currentColor foreground formatting from org-latex-preview into
org-link-preview as well?

-- 
Best wishes,
Yaroslav Drachov

Attachment: signature.asc
Description: PGP signature

  • ob-latex issues Yaroslav Drachov
    • feature request: ob-latex svgs with currentColor for... Yaroslav Drachov

Reply via email to