Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 1 day 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-17T23:31:49.000Z (8 days ago)
- Last Synced: 2025-01-18T00:24:59.329Z (8 days 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: 34.2 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
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:**
![DEMO](https://tex.jacob.workers.dev/?tex=\int_0^\infty\frac{x^2}{1%2bx^2}dx&css=svg{background:white})
![CSS DEMO](https://tex.jacob.workers.dev/?tex=-b%20\pm%20\sqrt{b^2%20-%204ac}%20\over%202a&css=svg{color:white;background:royalblue})- 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.