{ "info": { "author": "Quantum", "author_email": "quantum@dmoj.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Topic :: Artistic Software", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Software Development" ], "description": "# Texoid\nPython server for LaTeX math rendering to SVG and PNG.\nIt is lightweight and perfect for embedding LaTeX documents into webpages, without the hassle of rendering the documents yourself.\n\n## Installation\nTexoid is super simple to set up and use.\n\n```shell\n$ pip install texoid\n```\n\nTexoid uses [`texbox`](https://github.com/DMOJ/texbox), a Docker image built for converting LaTeX documents to SVG and PNG securely, without exposing your system to malicious LaTeX code. To use Texoid with `texbox`, [install Docker](https://docs.docker.com/install/).\n\nAlternatively, Texoid can directly use LaTeX to render documents to DVI format, `dvisvgm` to convert to SVGs, and ImageMagick to convert SVGs into PNGs. On a typical Debian or Ubuntu machine, you can the dependencies for this with:\n\n```shell\n$ apt-get install texlive-latex-base texlive-binaries imagemagick\n```\n\n## Running Texoid\n\n### With Docker\nTo run Texoid with Docker, simply run the following command with a user in the `docker` group:\n\n```shell\n$ texoid --port= --docker\n```\n\nThis will automatically pull the latest `texbox` image and start using it.\n\n### Without Docker\nTo start the Texoid without Docker, use:\n\n```shell\n$ LATEX_BIN= DVISVGM_BIN= CONVERT_BIN= texoid --port=\n```\n\nThe environment variables are not necessary if all three executables are present in `/usr/bin`. Here, `convert` refers to ImageMagick's `convert` tool.\n\n## Using Texoid\n\nTexoid expects POST body to contain the LaTeX document to render. You should send the request with an appropriate `Content-Type`, for example, `text/plain`, `application/x-tex`, or `text/x-tex`. Do not use `application/x-www-form-urlencoded`.\n\nTexoid also has a legacy API. This API uses `application/x-www-form-urlencoded` as `Content-Type`, and sends the LaTeX code form-encoded in the `q` field.\n\n### Response\nThe response will always contain a boolean field, `success`.\n\nIf `success` is `true`:\n\n* `svg` will contain the SVG source of the rendered document\n* `png` will contain a base64-encoded binary PNG file\n* `meta` will be a dict containing two entries:\n * `width`, the width of the rendered document in pixels\n * `height`, the height of the rendered document, again in pixels\n * these arguments are what the SVG/PNGs generated should be sized by to display properly in webpages\n\nIf `success` is `false`, the response will contain an `error` field with the LaTeX error output.\n\n### Examples\nIn these examples, a Texoid server is assumed to be running on `localhost`, port 8888. We will be rendering a simple LaTeX document:\n\n```latex\n\\documentclass{standalone}\n\\begin{document}\n$E=mc^2$\n\\end{document}\n```\n\n#### A successful render\n```shell\n$ curl -H 'Content-Type: text/plain' --data-raw '\\documentclass{standalone}\\begin{document}$E=mc^2$\\end{document}' localhost:8888\n{\"success\": true, \"svg\": \"\", \"png\": \"iVBORw0KGgoA....RK5CYII=\", \"meta\": {\"width\": \"48\", \"height\": \"10\"}}\n```\n\n#### A malformed request\n```shell\n$ curl -H 'Content-Type: text/plain' --data 'malformed' localhost:8888\n{\"success\": false, \"error\": \"This is pdfTeX, Version 3.14159265-2.6-1.40.15...LaTeX Error: Missing \\\\begin{document}...\"}\n```\n\nAnd that's it!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DMOJ/texoid", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "texoid", "package_url": "https://pypi.org/project/texoid/", "platform": "", "project_url": "https://pypi.org/project/texoid/", "project_urls": { "Homepage": "https://github.com/DMOJ/texoid" }, "release_url": "https://pypi.org/project/texoid/0.2/", "requires_dist": [ "tornado" ], "requires_python": "", "summary": "LaTeX math rendering server.", "version": "0.2" }, "last_serial": 4615056, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "b7ab76bfbc01ee8ba2b66bb5a21f3877", "sha256": "7ecd8fd15d075ac21fd1453893cecdc4b0d2cf0f711c6ec82f390c4d726dcffa" }, "downloads": -1, "filename": "texoid-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b7ab76bfbc01ee8ba2b66bb5a21f3877", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16828, "upload_time": "2018-12-19T04:47:29", "url": "https://files.pythonhosted.org/packages/5b/37/1bb7894a697c6bc9d73294cc5749889b6ad75ef65eed870d5f020c478fb9/texoid-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4660c3b371508f3dc9fa6b7629e59b26", "sha256": "815319c9f570442283f3aeecb96f3b6e93c3063665424cd64e340bd7b537155b" }, "downloads": -1, "filename": "texoid-0.2.tar.gz", "has_sig": false, "md5_digest": "4660c3b371508f3dc9fa6b7629e59b26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16152, "upload_time": "2018-12-19T04:47:31", "url": "https://files.pythonhosted.org/packages/2a/4c/1a2ab3309bb7af1bcb7b0bec6df43fb4b0d0b4fc5ca587d74e58fbcb3d5b/texoid-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b7ab76bfbc01ee8ba2b66bb5a21f3877", "sha256": "7ecd8fd15d075ac21fd1453893cecdc4b0d2cf0f711c6ec82f390c4d726dcffa" }, "downloads": -1, "filename": "texoid-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b7ab76bfbc01ee8ba2b66bb5a21f3877", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16828, "upload_time": "2018-12-19T04:47:29", "url": "https://files.pythonhosted.org/packages/5b/37/1bb7894a697c6bc9d73294cc5749889b6ad75ef65eed870d5f020c478fb9/texoid-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4660c3b371508f3dc9fa6b7629e59b26", "sha256": "815319c9f570442283f3aeecb96f3b6e93c3063665424cd64e340bd7b537155b" }, "downloads": -1, "filename": "texoid-0.2.tar.gz", "has_sig": false, "md5_digest": "4660c3b371508f3dc9fa6b7629e59b26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16152, "upload_time": "2018-12-19T04:47:31", "url": "https://files.pythonhosted.org/packages/2a/4c/1a2ab3309bb7af1bcb7b0bec6df43fb4b0d0b4fc5ca587d74e58fbcb3d5b/texoid-0.2.tar.gz" } ] }