Skip to content

Node.js service to convert latex equations into svg

Notifications You must be signed in to change notification settings

vrayulu/latex2svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

latex2svg

Node.js service to convert latex equations into svg. This uses mathjax npm module to convert latex equations to SVG images.

Build and run the server

  • Clone the repository
  • Run npm install to download the dependencies
  • Run node server.js to start the server

The server will be running on port 80.

Usage

Use the following API to convert latex into SVG:

http://localhost/convert?equation=<latex_equation>

Examples

The above examples have the equations in encoded format so that the URL works when opened in a browser window.

This API can be directly embedded within an img as follows:

<img src="http://localhost/convert?equation=f(x)%3Da_0%2B%5Csum%20_%7Bn%3D1%7D%5E%7B%5Cinfty%20%7D(a_n%5Ccos%20%5Cfrac%7Bn%5CPi%20x%7D%7BL%7D%2Bb_n%5Csin%20%5Cfrac%7Bn%5CPi%20x%7D%7BL%7D)"/>

Convert to PNG

This API can be used to convert latex into PNG image by adding ".png" at the end of the URL.

Examples

About

Node.js service to convert latex equations into svg

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published