LaTeX to PNG on Windows · GitHub

您所在的位置:网站首页 latex2png LaTeX to PNG on Windows · GitHub

LaTeX to PNG on Windows · GitHub

#LaTeX to PNG on Windows · GitHub| 来源: 网络整理| 查看: 265

LaTeX to PNG on Windows Prerequisite Windows System (Tested on Windows 10) pdflatex TexLive (/w standalone package) Installing Tex Live over the Internet magick Image Magick choco install imagemagick gswin32c Ghost Script (x86) choco install ghostscript.app --x86 Or, https://www.ghostscript.com/download/gsdnld.html Workaround 1: imgconvert command

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)

Workaround 2: gswin32c command

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)

Step 1: Write code \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 Step 2: Compile pdflatex --shell-escape --enable-write18 file.tex

The above command should produce file.pdf and file.png.

latex2png_win_result.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. Injecting command line option into Image Magick

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 }, See Also The standalone Package - Martin Scaharrer TeX2PNG Online alpha off vs remove


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3