0

Is there a way to save or export a tex file so as to produce a jpg/jpeg/png file?

1 Answers1

2
  1. Go to https://imagemagick.org/script/download.php and download the appropriate version. In my case (Windows) it is ImageMagick-7.0.9-12-Q16-x64-dll.exe (as of 2019-12-29).
  2. Go to https://www.ghostscript.com/download/gsdnld.html and download the appropriate version. In my case (Windows) it is Ghostscript 9.50 for Windows (32 bit) (GNU Affero General Public License). ImageMagick calls ghostscript for converting PDF as far as I understand.
  3. Generate a LaTeX file (test.tex) and produce a single PDF page.

\documentclass{article}

\begin{document}
Test
\end{document}

  1. In the same folder, create a text (myConvertBatch.txt) file with the following content (-density 300 is for better quality/resolution).

magick -density 300 test.pdf test.png 
pause

  1. Rename the text file to myConvertBatch.bat.
  2. Double-click on myConvertBatch.bat -- this should generate test.png.
  3. Look into the standalone document class (https://ctan.org/pkg/standalone).

For more details about the options of the magick command, see https://imagemagick.org/script/command-line-processing.php.

enter image description here

enter image description here

Related