emacs-orgmode
[Top][All Lists]
Advanced

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

svg file from tikz picture


From: reza
Subject: svg file from tikz picture
Date: Mon, 15 Aug 2022 18:50:36 +0000

Hi list

when running the following code

#+header: :file "absolute-distance.pdf"
#+header: :results file drawer :exports results :fit yes :border 0cm
#+header: :headers '("\\usepackage{tikz}")
#+begin_src latex
   \usetikzlibrary{positioning}
   \begin{tikzpicture}
     \node[circle,fill,label=above:$P_1$,node font=\Large] (point1) at 
(0,0) {};
     \node[circle,fill,label=above:$P_2$,node font=\Large] (point2) at 
(3,0) {};
     \draw[latex-latex] (point1) -- (point2);
   \end{tikzpicture}
#+end_src

everything runs fine and a pdf file gets produced. But when I change the 
file header to "absolute-distance.svg" an error occurs and no output 
gets produced. Find attached the tex file and the log of the compilation.

What is the problem here, why is it defining "\pgfsysdriver" in the 
preamble of the tex document. I thought it is converting the produced 
pdf file with imagemagick (or inkscape?) to svg?

Thanks for any clarification.

Cheers Reza

P.S:

My workaround consist in producing a pdf file and convert it with a 
":post pdftosvg(file=*this*)" header call to svg. This is the post block

#+name: pdftosvg
#+begin_src shell :var file="" :exports none :results output
   pdf2svg ${file:7:-2} ${file:7:-5}"svg" && echo 
"[[file:"${file:7:-5}"svg]]"
#+end_src

but it feels a little hacky and cumbersome and it would be nice to 
produce directly svg

Attachment: latex-kc4M19.log
Description: Text Data

Attachment: latex-kc4M19.tex
Description: Text Data

Attachment: OpenPGP_0xC375C6AF05125C52.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: PGP signature


reply via email to

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