- Windows System (Tested on Windows 10)
pdflatex
TexLive (/wstandalone
package)magick
Image Magickchoco install imagemagick
gswin32c
Ghost Script (x86)choco install ghostscript.app --x86
- Or, https://www.ghostscript.com/download/gsdnld.html
imgconvert
is not installed by default Chocolatey installer.
So, you must create batch file on PATH as follows:
REM imgconvert.bat
magick convert %*
NOTE: On Unix System, convert
is used by default.
(On Windows, name of convert
is registered by legacy name of drive manager)
choco install ghostscript.app --x86
DOES NOT add executables into PATH.
Therefore, must add them by your hands.
If you already have x64 binaries and don't want to additionally install x86, the following workaround may work: (not tested)
REM gswin32c.bat
REM Workaround: Bypassing to x64 binaries
gswin64c %*
Or, use gsexe
option.
the Ghostscript executable is usually named ‘gs’ under Linux/U-nix and ‘gswin32c’ under MS Windows and configured this way by default, butthis may be changed using the
gsexe
setting (5.6.2 Conversion Software)
\documentclass[
11pt,
border=2,
convert={
density=300,
outext=.png
},
]{standalone}
\begin{document}
$f(t) = 4k(\frac{t}{D})^{3}$
\end{document}
border
can used as "padding"density
affects its output resolution
pdflatex --shell-escape --enable-write18 file.tex
The above command should produce file.pdf and file.png.
- In modern
pdflatex
seems to enable--enable-write18
by default. So this may be not mandatory. - NOTE: that options must be preceding by filename. eg.
pdflatex file.tex --shell-escape ...
goes failed.
According to 5.6.3 Conversion process Table 2: Advanced Conversion Options, pre-expansion command line template as follows:
command=\unexpanded{{\convertexe\space -density \density\space
\infile\space \ifx\size\empty\else
-resize \size\fi\space -quality 90 \outfile}}
Therefore, \density
can be used as good placeholder command line options. eg.
\documentclass[
convert={
density=300 -alpha off -background #ffffff,
outext=.png
},