kivy-latex-label


Namekivy-latex-label JSON
Version 1.0.3 PyPI version JSON
download
home_pageNone
SummaryA package that defines a new label class for Kivy to display text with LaTeX equations.
upload_time2025-09-06 22:20:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords kivy label latex
VCS
bugtrack_url
requirements matplotlib kivy pillow
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Kivy LaTeX Label

![PyPI - Version](https://img.shields.io/pypi/v/kivy-latex-label)![PyPI - Downloads](https://img.shields.io/pypi/dm/kivy-latex-label)

This is a simple package that provides a special LatexLabel class to display text containing equations with kivy. No LaTeX installation is required, the rendering is performed using matplotlib.

## Installation

To use this widget, you can simply copy and paste the "latex_label" folder in your code and import the widget. A pip installation will possible in the future.

## How to use it

You can use the LatexLabel as any other Label in kivy (although all options may not be available), your equations just need to be delimited by dollar symbols ($) like in any LaTeX document.

Here is a short demo with a python and kv files. To run it, the python should be pasted in a file called "demo.py" and the kv in "demo.kv".

```python
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy_latex_label import LatexLabel

class DemoApp(App, Widget):

    def build(self):
        Window.clearcolor = (1, 1, 1, 1)

if __name__ == "__main__":
    DemoApp().run()
```

```kv
#:kivy 2.0.0

FloatLayout:
    size_hint: (1,1)

    LatexLabel:
        pos_hint: {"top":1,"x":0.05}
        size_hint:(0.9,1)
        text: r"The SINDy method is a recently developed technique that leverages sparse regression to identify the governing equations from a given time series (Figure 1). We consider a system with state $\boldsymbol{x}(t)=\left[x_{1}(t), x_{2}(t), \ldots x_{d}(t)\right]^{\top} \in$ $\mathbb{R}^{d}$ governed by the differential equation: $\dot{\boldsymbol{x}}=\boldsymbol{f}(\boldsymbol{x})$."
        color: (0,0,0,1)
        text_size: root.size
        valign: "top"
        font_size: 20
```

Here is how it looks like: 

<img width="820" height="655" alt="image" src="https://github.com/user-attachments/assets/dc86ffd9-0316-4a73-9810-69a027c00dce" />


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "kivy-latex-label",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "kivy, label, latex",
    "author": null,
    "author_email": "PaulCreusy <paul.creusy@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2d/a3/061f0473ab8b0b1644d36c9f422acecaec71e22e1f1ea8d69fa6beb959f7/kivy_latex_label-1.0.3.tar.gz",
    "platform": null,
    "description": "# Kivy LaTeX Label\n\n![PyPI - Version](https://img.shields.io/pypi/v/kivy-latex-label)![PyPI - Downloads](https://img.shields.io/pypi/dm/kivy-latex-label)\n\nThis is a simple package that provides a special LatexLabel class to display text containing equations with kivy. No LaTeX installation is required, the rendering is performed using matplotlib.\n\n## Installation\n\nTo use this widget, you can simply copy and paste the \"latex_label\" folder in your code and import the widget. A pip installation will possible in the future.\n\n## How to use it\n\nYou can use the LatexLabel as any other Label in kivy (although all options may not be available), your equations just need to be delimited by dollar symbols ($) like in any LaTeX document.\n\nHere is a short demo with a python and kv files. To run it, the python should be pasted in a file called \"demo.py\" and the kv in \"demo.kv\".\n\n```python\nfrom kivy.app import App\nfrom kivy.uix.widget import Widget\nfrom kivy.core.window import Window\nfrom kivy_latex_label import LatexLabel\n\nclass DemoApp(App, Widget):\n\n    def build(self):\n        Window.clearcolor = (1, 1, 1, 1)\n\nif __name__ == \"__main__\":\n    DemoApp().run()\n```\n\n```kv\n#:kivy 2.0.0\n\nFloatLayout:\n    size_hint: (1,1)\n\n    LatexLabel:\n        pos_hint: {\"top\":1,\"x\":0.05}\n        size_hint:(0.9,1)\n        text: r\"The SINDy method is a recently developed technique that leverages sparse regression to identify the governing equations from a given time series (Figure 1). We consider a system with state $\\boldsymbol{x}(t)=\\left[x_{1}(t), x_{2}(t), \\ldots x_{d}(t)\\right]^{\\top} \\in$ $\\mathbb{R}^{d}$ governed by the differential equation: $\\dot{\\boldsymbol{x}}=\\boldsymbol{f}(\\boldsymbol{x})$.\"\n        color: (0,0,0,1)\n        text_size: root.size\n        valign: \"top\"\n        font_size: 20\n```\n\nHere is how it looks like: \n\n<img width=\"820\" height=\"655\" alt=\"image\" src=\"https://github.com/user-attachments/assets/dc86ffd9-0316-4a73-9810-69a027c00dce\" />\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package that defines a new label class for Kivy to display text with LaTeX equations.",
    "version": "1.0.3",
    "project_urls": {
        "Documentation": "https://github.com/PaulCreusy/kivy-latex-label",
        "Homepage": "https://github.com/PaulCreusy/kivy-latex-label",
        "Issues": "https://github.com/PaulCreusy/kivy-latex-label/issues"
    },
    "split_keywords": [
        "kivy",
        " label",
        " latex"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7555db32b9bbae7211eb2dd0ab6d66575605609c03978488fbc80166c9b73bbc",
                "md5": "4a1c17dfb64bd54810237e85bb5ed966",
                "sha256": "969026003bcf237bd3df6a8a6afc5e4fa247277415937414333dd9ff46fb71c7"
            },
            "downloads": -1,
            "filename": "kivy_latex_label-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a1c17dfb64bd54810237e85bb5ed966",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5563,
            "upload_time": "2025-09-06T22:20:34",
            "upload_time_iso_8601": "2025-09-06T22:20:34.411971Z",
            "url": "https://files.pythonhosted.org/packages/75/55/db32b9bbae7211eb2dd0ab6d66575605609c03978488fbc80166c9b73bbc/kivy_latex_label-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2da3061f0473ab8b0b1644d36c9f422acecaec71e22e1f1ea8d69fa6beb959f7",
                "md5": "74193d7542eea0cfd2c1b4b5d705bebd",
                "sha256": "e25ce6659985da7e85263bd3cb7d5dd56bdc56840c75896c63c5793941258961"
            },
            "downloads": -1,
            "filename": "kivy_latex_label-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "74193d7542eea0cfd2c1b4b5d705bebd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4387,
            "upload_time": "2025-09-06T22:20:35",
            "upload_time_iso_8601": "2025-09-06T22:20:35.903910Z",
            "url": "https://files.pythonhosted.org/packages/2d/a3/061f0473ab8b0b1644d36c9f422acecaec71e22e1f1ea8d69fa6beb959f7/kivy_latex_label-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-06 22:20:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PaulCreusy",
    "github_project": "kivy-latex-label",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "matplotlib",
            "specs": [
                [
                    ">=",
                    "3.8.0"
                ]
            ]
        },
        {
            "name": "kivy",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pillow",
            "specs": []
        }
    ],
    "lcname": "kivy-latex-label"
}
        
Elapsed time: 2.17069s