emacs-orgmode
[Top][All Lists]
Advanced

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

latex block tikz to svg


From: Edouard Debry
Subject: latex block tikz to svg
Date: Mon, 17 Jan 2022 15:14:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)

Hello,

I experience some difficulties to export latex src block
consisting of tikz code to svg.

Here is for example the simple code I try to run with `C-c C-c` :

<==================================================>
#+HEADER: :file test1.png
#+HEADER: :imagemagick yes
#+HEADER: :exports results
#+HEADER: :results output silent graphics file
#+HEADER: :headers '("\\usepackage{tikz}")
#+HEADER: :fit yes :imoutoptions -geometry 400 :iminoptions -density 600
#+begin_src latex
\begin{tikzpicture}             %
\draw[->] (-3,0) -- (-2,0) arc[radius=0.5cm,start angle=-180,end angle=0] 
(-1,0) -- (1,0) arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);
\filldraw (-1.5,0) circle[radius=1mm];
\filldraw (1.5,0) circle[radius=1mm];
\end{tikzpicture}
#+end_src
<==================================================>

First of all, for this to work I have to change  `org-latex-pdf-process`
to ("latexmk.exe -pdf -f %f -cd %o"), which unfortunately breaks the
latex to pdf export of org files (C-c C-e l o/p).

Then, it works when image file format is png. However, a close look of
the pdflatex output shows this error :

<====================================================================>
=== TeX engine is 'pdfTeX'
Latexmk: All targets (latex-JEShjO.pdf) are up-to-date
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'd:/xxxx/Documents/utils/texlive/2021/texmf-dist/tex/latex/tools/.tex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -shell-escape -synctex=1 -interaction=nonstopmode  -recorder  
"d:\xxxxxx\Documents\utils\texlive\2021\texmf-dist\tex\latex\tools\.tex"'
------------
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) 
(preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(d:/xxxxxx/Documents/utils/texlive/2021/texmf-dist/tex/latex/tools/.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-01-12> File ignored)
! Emergency stop.
<*> ...exlive/2021/texmf-dist/tex/latex/tools/.tex
                                                  
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on .log.
Failure to make '.pdf'
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to '.log' for details
Latexmk: Undoing directory change

------------
Latexmk: Some operations failed, for the following tex file(s)
  
Latexmk: Examining '.log'
=== TeX engine is 'pdfTeX'
Latexmk: Errors, in force_mode: so I tried finishing targets
...xxxx\Documents\utils\texlive\2021\bin\win32\runscript.tlu:915: command 
failed with exit code 12:
perl.exe 
d:\xxxxxx\Documents\utils\texlive\2021\texmf-dist\scripts\latexmk\latexmk.pl 
-pdf -f "c:/Users/xxxxxx/AppData/Local/Temp/babel-B1S4gp/latex-JEShjO.tex" -cd 
"c:/Users/xxxxxx/AppData/Local/Temp/babel-B1S4gp/"
<=========================================================================================>

I wonder why it tries every time to compile a ".tex" file although the
temporary previous pdf file was correctly generated.


Finally, if I change "test1.png" to "test1.svg", such a svg file is
generated but with garbage in it.

I would like to find a way to generate svg images from latex src blocks
(using tikz) which works and is compatible with default orgmode settings
for latex export (at least does not break it)

Did you experience such issues ? do you have some workings settings and
examples ? I googled several times "org latex block tikz svg", but it is
difficult to guess how relevant are the elements found, some of them
seems quiet outdated. Hence my question on this mailing list

Regards

My configuration :
- windows 11
- emacs 29.0.50 (compiled master from a few days)
- orgmode (9.5.2)
- mingw64 : imagemagick
- texlive 2021 (installed from yesterday)



reply via email to

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