{"id":14525197,"url":"https://github.com/prinsss/node-tikzjax","last_synced_at":"2026-02-28T13:32:52.383Z","repository":{"id":217017110,"uuid":"742959402","full_name":"prinsss/node-tikzjax","owner":"prinsss","description":"A port of TikZJax runs on pure Node.js and WebAssembly.","archived":false,"fork":false,"pushed_at":"2026-02-19T23:29:49.000Z","size":7797,"stargazers_count":98,"open_issues_count":2,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-20T03:26:43.173Z","etag":null,"topics":["latex","nodejs","tikz","webassembly"],"latest_commit_sha":null,"homepage":"https://stackblitz.com/edit/node-tikzjax","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lppl-1.3c","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prinsss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-13T21:54:49.000Z","updated_at":"2026-02-19T23:52:51.000Z","dependencies_parsed_at":"2024-10-27T12:47:25.669Z","dependency_job_id":"7c199dcd-9ecc-4cac-b4e2-080058d810e5","html_url":"https://github.com/prinsss/node-tikzjax","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"0454f82cf8fe4ea034c8c57f2e53e5fd1db1e433"},"previous_names":["prinsss/node-tikzjax"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/prinsss/node-tikzjax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinsss%2Fnode-tikzjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinsss%2Fnode-tikzjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinsss%2Fnode-tikzjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinsss%2Fnode-tikzjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prinsss","download_url":"https://codeload.github.com/prinsss/node-tikzjax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinsss%2Fnode-tikzjax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29935368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:16:57.922Z","status":"ssl_error","status_checked_at":"2026-02-28T13:11:15.149Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latex","nodejs","tikz","webassembly"],"created_at":"2024-09-04T14:00:59.280Z","updated_at":"2026-02-28T13:32:52.349Z","avatar_url":"https://github.com/prinsss.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Node-TikZJax\n\nA port of [TikZJax](https://tikzjax.com) runs on pure Node.js and WebAssembly.\n\nNode-TikZJax lets you render LaTeX and TikZ diagrams to SVG images without the need to install LaTeX toolchain to the environment. You can render graphs, figures, circuits, chemical diagrams, commutative diagrams, and more.\n\n## Installation\n\n```bash\nnpm install node-tikzjax\n```\n\n## Examples\n\nSee the [demo](demo) folder for some example TikZ diagrams.\n\nLive demo: [https://stackblitz.com/edit/node-tikzjax](https://stackblitz.com/edit/node-tikzjax)\n\n![screenshot](https://github.com/prinsss/node-tikzjax/raw/main/demo/screenshot.png)\n\nThe example TeX source code is taken from [obsidian-tikzjax](https://github.com/artisticat1/obsidian-tikzjax).\n\n## Usage\n\nBasic usage:\n\n```typescript\nimport tex2svg from 'node-tikzjax';\n\nconst source = `\\\\begin{document}\n\\\\begin{tikzpicture}\n\\\\draw (0,0) circle (1in);\n\\\\end{tikzpicture}\n\\\\end{document}`;\n\nconst svg = await tex2svg(source);\n```\n\nWhich generates the following SVG:\n\n```html\n\u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"193.253\" height=\"193.253\" viewBox=\"-72 -72 144.94 144.94\"\u003e\n  \u003cpath fill=\"none\" stroke=\"#000\" stroke-miterlimit=\"10\" stroke-width=\".4\" d=\"M72.47.2c0-39.914-32.356-72.27-72.27-72.27S-72.07-39.714-72.07.2-39.714 72.47.2 72.47 72.47 40.114 72.47.2ZM.2.2\"/\u003e\n\u003c/svg\u003e\n```\n\nThe input TeX source is rendered to DVI, then rendered to SVG.\n\n- Remember to load any packages you need with `\\usepackage{}`, and include `\\begin{document}` and `\\end{document}`.\n- The standalone document class is used (`\\documentclass{standalone}`).\n\nThe following packages are available in `\\usepackage{}`:\n\n- chemfig\n- tikz-cd\n- circuitikz\n- pgfplots\n- array\n- amsmath\n- amstext\n- amsfonts\n- amssymb\n- tikz-3dplot\n\n\u003e [!NOTE]\n\u003e Don't run multiple instances of `node-tikzjax` at the same time. This may cause unexpected results.\n\n## Advanced Usage\n\nThere are some options you can pass to `tex2svg()`:\n\n```typescript\nconst svg = await tex2svg(source, {\n  // Print log of TeX engine to console. Default: false.\n  showConsole: true,\n  // Additional TeX packages to load. Default: {}.\n  // The following example results in `\\usepackage{pgfplots}\\usepackage[intlimits]{amsmath}`.\n  texPackages: { pgfplots: '', amsmath: 'intlimits' },\n  // Additional TikZ libraries to load. Default: ''.\n  // The following example results in `\\usetikzlibrary{arrows.meta,calc}`.\n  tikzLibraries: 'arrows.meta,calc',\n  // Additional source code to add to the preamble of input. Default: ''.\n  addToPreamble: '% comment',\n  // Add `\u003cdefs\u003e\u003cstyle\u003e@import url('fonts.css');\u003c/style\u003e\u003c/defs\u003e` to SVG. Default: false.\n  // This could be useful if you want to embed the SVG in a HTML file.\n  embedFontCss: true,\n  // URL of the font CSS file. Default: 'https://cdn.jsdelivr.net/npm/node-tikzjax@latest/css/fonts.css'.\n  fontCssUrl: 'https://cdn.jsdelivr.net/npm/node-tikzjax@latest/css/fonts.css',\n  // Disable SVG optimization with SVGO. Default: false.\n  disableOptimize: false,\n});\n```\n\nYou can also separate the TeX rendering and DVI to SVG conversion steps:\n\n```typescript\nimport { load, tex, dvi2svg } from 'node-tikzjax';\n\n// Load the WebAssembly module and necessary files.\nawait load();\n\n// Read TeX source from a file.\nconst input = readFileSync('sample.tex', 'utf8');\n\n// Render TeX source to DVI.\nconst dvi = await tex(input, {\n  showConsole: true,\n  texPackages: { pgfplots: '', amsmath: 'intlimits' },\n  tikzLibraries: 'arrows.meta,calc',\n  addToPreamble: '% comment',\n});\n\n// Output generated DVI to a file.\nwriteFileSync('sample.dvi', dvi);\n\n// Render DVI to SVG.\nconst svg = await dvi2svg(dvi, {\n  embedFontCss: true,\n  fontCssUrl: 'https://cdn.jsdelivr.net/npm/node-tikzjax@latest/css/fonts.css',\n  disableOptimize: false,\n});\n\n// Output generated SVG to a file.\nwriteFileSync('sample.svg', svg);\n```\n\n## Acknowledgements\n\nThis project is greatly inspired by [obsidian-tikzjax](https://github.com/artisticat1/obsidian-tikzjax).\n\nThis port would not be possible without the original [tikzjax](https://github.com/kisonecat/tikzjax) project.\n\nPrebuilt WebAssembly binaries and supporting files are [downloaded](download.sh) from [artisticat1/tikzjax#output-single-file](https://github.com/artisticat1/tikzjax/tree/output-single-file).\n\nA fork of [artisticat1/dvi2html#ww-modifications](https://github.com/artisticat1/dvi2html/tree/ww-modifications) is used to convert DVI to SVG.\n\nThe BaKoMa fonts shipped with this package are licensed under the [BaKoMa Fonts Licence](css/bakoma/LICENCE).\n\nThanks to all the authors for their great work!\n\n## License\n\n[LaTeX Project Public License v1.3c](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinsss%2Fnode-tikzjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprinsss%2Fnode-tikzjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinsss%2Fnode-tikzjax/lists"}