I am using tikz plot in a LuaLatex paper. For a presentation, I would like to use the same plots in power point. Theoretically, I could add them as pdf object. The quality is quite bad though. Thus, I would like to export them as png. I found several code examples which should work. But I can't get them to work. They just output the pdf, no png.
I already tried following threads/ code snips.
https://www.latex4technics.com/?note=3p2n http://users.cecs.anu.edu.au/~rod/resources/p-tikz-external-png.html
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
%\tikzexternalize[mode=list and make]
\tikzset{
png export/.style={
% First we call ImageMagick; change settings to requirements
external/system call/.add={}{; convert -density 300 -transparent white "\image.pdf" "\image.png"},
% Now we force the PNG figure to be used instead of the PDF
/pgf/images/external info,
/pgf/images/include external/.code={
\includegraphics[width=\pgfexternalwidth,height=\pgfexternalheight]{##1.png}
},
}
}
\begin{document}
{
% Here we specify the figure will be converted and inserted as PNG
\tikzset{png export}
\begin{tikzpicture}
\draw (0,0) circle (1) ;
\end{tikzpicture}
}
% This figure will be inserted as PDF
\begin{tikzpicture}
\draw (0,0) circle (1) ;
\end{tikzpicture}
\end{document}
I have checked the convert -version
Version: ImageMagick 7.0.8-49 Q16 x64 2019-06-08 http://www.imagemagick.org Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Visual C++: 180040629 Features: Cipher DPC Modules OpenMP(2.0) Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib ```
If I check where convert
I get
C:\Program Files\ImageMagick-7.0.8-Q16\convert.exe C:\Windows\System32\convert.exe```
It seems suspicious to me to have two convert from different locations.
EDIT: This is now changed. I can call the convert.exe ether as imconvert or as magick. This works from console. It does not work from latex (texmaker) though.
Expected is a png and pdf output. Actual is a pdf output.