https://github.com/jacoblincool/tex-svg-worker
Translate TeX to SVG on the fly. Free & Open Source TeX-SVG API. Batch Conversion Supported.
https://github.com/jacoblincool/tex-svg-worker
cloudflare-workers latex svg tex
Last synced: 28 days ago
JSON representation
Translate TeX to SVG on the fly. Free & Open Source TeX-SVG API. Batch Conversion Supported.
- Host: GitHub
- URL: https://github.com/jacoblincool/tex-svg-worker
- Owner: JacobLinCool
- License: mit
- Created: 2022-02-16T17:03:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-15T07:26:44.000Z (3 months ago)
- Last Synced: 2025-03-31T06:51:08.214Z (2 months ago)
- Topics: cloudflare-workers, latex, svg, tex
- Language: TypeScript
- Homepage: https://tex.jacob.workers.dev/?tex=-b%20\pm%20\sqrt{b^2%20-%204ac}%20\over%202a
- Size: 35.2 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TeX SVG Worker
A Cloudflare Worker that translates TeX to SVG.
## Usage
### Direct Image Link
```
GET https://tex.jacob.workers.dev/?tex=
```**Example:**

- Add `&inline=true` to the end of the URL to get the "inline" version of the image.
- Add `&css=` to inject css into the image. For example: `svg{color:white;background:royalblue}`### Use Post
```
POST https://tex.jacob.workers.dev/
```**Body:**
```json
{
"tex": ""
}
```### JSON Batch Convert API
```
POST https://tex.jacob.workers.dev/json
```**Body:**
```json
{
"tex": [
"",
"",
...
],
"key": true
}
````tex` is a list of TeX expressions.
`key` is a boolean value. If `true`, the response will be a JSON object with key-value pairs of TeX expression and their SVGs. If `false`, the response will be a JSON array of SVGs.
**`key` set to `true`:**
```json
{
"": "",
"": "",
...
}
```**`key` set to `false`:**
```json
[
"",
"",
...
]
```Other options:
- `inline`: display the inline version of the image.
- `css`: CSS string to be injected into the SVG.