https://github.com/joulev/latex2svg-service
A small online service to convert a LaTeX document to SVG, using Bun, Elysia, texlive.net and pdf2svg
https://github.com/joulev/latex2svg-service
Last synced: over 1 year ago
JSON representation
A small online service to convert a LaTeX document to SVG, using Bun, Elysia, texlive.net and pdf2svg
- Host: GitHub
- URL: https://github.com/joulev/latex2svg-service
- Owner: joulev
- Created: 2023-12-30T03:40:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-30T05:34:05.000Z (over 2 years ago)
- Last Synced: 2025-01-29T18:38:27.037Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# latex2svg-service
A small online service to convert a LaTeX document to SVG, using Bun, Elysia, texlive.net and `pdf2svg`.
This is mainly intended for internal usage in a company, so it's run on a pretty small machine and I don't want to pay too much for this. Hence an API key is required to prevent over-use. If you want an API key, feel free to contact me@joulev.dev.
```ts
const texContent = `
\\documentclass[tikz]{standalone}
\\begin{document}
\\begin{tikzpicture}
\\draw (0,0) circle (1cm);
\\end{tikzpicture}
\\end{document}
`.trimStart();
const res = await fetch("https://latex2svg.joulev.dev/v1", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ fileContent: texContent }),
});
const svg = await res.text();
//