{"id":16881510,"url":"https://github.com/swhl/latextoimage","last_synced_at":"2026-05-17T02:36:39.019Z","repository":{"id":213448185,"uuid":"733724131","full_name":"SWHL/LaTeXToImage","owner":"SWHL","description":"Use LaTeX compilation tools to convert formulas in LaTeX format into corresponding images.","archived":false,"fork":false,"pushed_at":"2023-12-22T07:32:09.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T05:41:27.993Z","etag":null,"topics":["convert","latex","latex-ocr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SWHL.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}},"created_at":"2023-12-20T01:29:30.000Z","updated_at":"2024-11-02T14:50:36.000Z","dependencies_parsed_at":"2023-12-22T08:30:18.683Z","dependency_job_id":null,"html_url":"https://github.com/SWHL/LaTeXToImage","commit_stats":null,"previous_names":["swhl/latex_to_image","swhl/latextoimage"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FLaTeXToImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FLaTeXToImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FLaTeXToImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FLaTeXToImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SWHL","download_url":"https://codeload.github.com/SWHL/LaTeXToImage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244544769,"owners_count":20469725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["convert","latex","latex-ocr"],"created_at":"2024-10-13T16:02:57.773Z","updated_at":"2025-10-19T13:13:36.096Z","avatar_url":"https://github.com/SWHL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e\u003cb\u003e LaTeX To Image\u003c/b\u003e\u003c/h1\u003e\n  \u003c/div\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-\u003e=3.6,\u003c3.12-aff.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/OS-Linux%2C%20Mac%2C%20Win-pink.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/latex-to-image/\"\u003e\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/latex-to-image\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/latex-to-image\"\u003e\u003cimg src=\"https://static.pepy.tech/personalized-badge/latex-to-image?period=total\u0026units=abbreviation\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads\"\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://semver.org/\"\u003e\u003cimg alt=\"SemVer2.0\" src=\"https://img.shields.io/badge/SemVer-2.0-brightgreen\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/SWHL/latex_to_image/blob/3aa9c53d43281e1527271da023440b8fa95a8dbf/LICENSE\"\u003e\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/badge/license-MIT-blue\"\u003e\u003c/a\u003e\n\n[简体中文](./docs/README_zh.md) | English\n\u003c/div\u003e\n\n### Introduction\nThis tool is used to convert LaTeX formulas into corresponding images with the help of LaTeX tools.\n\n### Install LaTeX compile environment\nUbuntu:\n```bash\nsudo apt-get install texlive-full\n\n# verify whether the installation is successful.\n$ xelatex --help\n# Usage: pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS]\n#  or: pdftex [OPTION]... \\FIRST-LINE\n#  or: pdftex [OPTION]... \u0026FMT ARGS\n    # Run pdfTeX on TEXNAME, usually creating TEXNAME.pdf.\n```\n\nMacOS\n\nRecommend to install [MacTex](https://tug.org/mactex/mactex-download.html)\n\n```bash\n# verify whether the installation is successful.\n$ xelatex --help\n# Usage: xetex [OPTION]... [TEXNAME[.tex]] [COMMANDS]\n#    or: xetex [OPTION]... \\FIRST-LINE\n#    or: xetex [OPTION]... \u0026FMT ARGS\n#   Run XeTeX on TEXNAME, usually creating TEXNAME.pdf.\n```\n\n### Installation\n```bash\npip install latex_to_image\n```\n\n### CLI\n```bash\n$ latex_to_image \"x^2+y^2=1\" res.png\n```\n\n### Python\n```python\nimport cv2\nfrom latex_to_image import LaTeXToImg\n\nrender = LaTeXToImg()\n\nformula = \"x^2 + y ^2 = 1\"\nimg = render(formula)\ncv2.imwrite(\"res.png\", img)\n```\n\n### Result\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./docs/res.png\"\u003e\n\u003c/div\u003e\n\n### Reference\n- [LaTeX-OCR](https://github.com/lukas-blecher/LaTeX-OCR/blob/main/pix2tex/dataset/latex2png.py)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswhl%2Flatextoimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswhl%2Flatextoimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswhl%2Flatextoimage/lists"}