Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwtgck/math2image-npm
CLI for generating beautiful SVG/PNG mathematical image ∑ ∫ π² ∞
https://github.com/nwtgck/math2image-npm
cli latex math npm svg
Last synced: 15 days ago
JSON representation
CLI for generating beautiful SVG/PNG mathematical image ∑ ∫ π² ∞
- Host: GitHub
- URL: https://github.com/nwtgck/math2image-npm
- Owner: nwtgck
- License: mit
- Created: 2017-12-10T13:01:18.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-01-10T08:05:22.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T19:08:35.622Z (about 1 month ago)
- Topics: cli, latex, math, npm, svg
- Language: TypeScript
- Homepage:
- Size: 338 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# math2image
[![npm](https://img.shields.io/npm/v/math2image.svg)](https://www.npmjs.com/package/math2image) [![Node CI](https://github.com/nwtgck/math2image-npm/actions/workflows/ci.yml/badge.svg)](https://github.com/nwtgck/math2image-npm/actions/workflows/ci.yml)
CLI for generating beautiful SVG/PNG mathematical image from LaTeX syntax
## Installation
```bash
npm install -g math2image
```### Usages
#### from stdin
```bash
echo "e^{i \pi} + 1 = 0" | math2image > euler-identity.svg
```#### from a file
```bash
math2image sample7.math.tex
```#### from a file specifying output name
```bash
math2image -o output.svg sample7.math.tex
```#### save as .png
```bash
math2image --to-png --png-width=500 sample7.math.tex
```##### `sample7.math.tex`
```tex
% (from: https://en.wikibooks.org/wiki/LaTeX/Mathematics)
f(n) =
\begin{cases}
n/2 & \quad \text{if } n \text{ is even}\\
-(n+1)/2 & \quad \text{if } n \text{ is odd}
\end{cases}
```## Gallery
## My Note
[MYNOTE.md](MYNOTE.md)