Input
\documentclass[
tikz,
border=2mm,
convert={
true,
%false,
density = 300,
convertexe = {convert},
%command={\convertexe\space -density \density\space \infile\space \ifx\size\empty\else -resize \size\fi\space -quality 90 \outfile}
}
]
{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\addplot
[
red,
]
{
x^2
};
\end{axis}
\end{tikzpicture}
\end{document}
Output
Problem
I want to use the convert
option to generate PNG files on the fly. As you can see in the code example above: It works basically!
The problem is that the resulting PNG has transparency (transparent background and not a white background):
In my case this is not wanted. Normally if you use the convert command from the console or in a batch file (I use Windows 7/10) then you just add -alpha remove
and the problem is solved.
However I do not know how to add the option within the standalone
package. In the documentation of the standalone package it says that the default command that is passed to the convert
command is:
command={\convertexe\space -density
\density\space \infile\space \ifx\size\empty\else
-resize \size\fi\space -quality 90 \outfile}
So I entered this in the class option and expected no change. In a second step I would have added the -alpha remove
option.
But with this document class options:
\documentclass[
tikz,
border=2mm,
convert={
true,
%false,
density = 300,
convertexe = {convert},
command={\convertexe\space -density \density\space \infile\space \ifx\size\empty\else -resize \size\fi\space -quality 90 \outfile}
}
]
{standalone}
Then I get this error:
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9) (preloaded format=pdflatex 2015.12.20) 29 MAR 2016 22:38
entering extended mode
**\expandafter\def\csname sa@internal@run\endcsname{1}\input{lala}
(lala.tex
! Undefined control sequence.
<argument> ...e = {convert}, command={\convertexe
\space -density \density \...
l.13
?
! Emergency stop.
<argument> ...e = {convert}, command={\convertexe
\space -density \density \...
l.13
End of file on the terminal!
- Can you reproduce the problem?
- Do I misread the documentation?
- Maybe you know a solution!