Plugin to Convert Latex to Image

Is there any plugin which can be installed on server or just kept on server to convert latex equations to images?

I want to give input like

A_{m,n}=\begin{pmatrix}a_{1,1}&a_{1,2}&\cdots&a_{1,n}\\a_{2,1}&a_{2,2}&\cdots&a_{2,n}\\\vdots&\vdots&\ddots&\vdots\\a_{m,1}&a_{m,2}&\cdots&a_{m,n}\end{pmatrix}

and get the output as an image

I have gone through a GitHub solution and figured out this bash script, but it does not support for some Latex equations like

A_{m,n}=\begin{pmatrix}a_{1,1}&a_{1,2}&\cdots&a_{1,n}\\a_{2,1}&a_{2,2}&\cdots&a_{2,n}\\\vdots&\vdots&\ddots&\vdots\\a_{m,1}&a_{m,2}&\cdots&a_{m,n}\end{pmatrix}

and

M=\begin{bmatrix}\frac56&\frac16&0\\[0.3em]\frac56&0&\frac16\\[0.3em]0&\frac56&\frac16\end{bmatrix}

2 Answers

Let say your latex file is myfile.tex,
then you can do:
latex myfile.tex to produce a dvi file. (i.e myfile.dvi)
To convert the dvi file to image,
run:
dvipng myfile.dvi
or:
dvigif myfile.dvi

This process can easily be of course be automated with a shell script or setting an alias.

You can use ImageMagick to do that. It has a lot of features to do what you want with latex equations as far as i know.

The Imagemagick tag on Stack Overflow has posts related to your question.

This is a plugin for ImageMagick: github LatexEquationPreview

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest