emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex block tikz to svg
@ 2022-01-17 14:14 Edouard Debry
  2022-01-17 16:01 ` Juan Manuel Macías
  0 siblings, 1 reply; 4+ messages in thread
From: Edouard Debry @ 2022-01-17 14:14 UTC (permalink / raw)
  To: emacs-orgmode


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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-18 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 14:14 latex block tikz to svg Edouard Debry
2022-01-17 16:01 ` Juan Manuel Macías
2022-01-25 23:24   ` Edouard Debry
2022-04-18 13:23   ` Edouard Debry

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).