Skip to main content

A package that defines a new label class for Kivy to display text with LaTeX equations.

Project description

Kivy LaTeX Label

PyPI - VersionPyPI - Downloads

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 "kivy_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".

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()
#: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:

image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kivy_latex_label-1.0.8.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kivy_latex_label-1.0.8-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file kivy_latex_label-1.0.8.tar.gz.

File metadata

  • Download URL: kivy_latex_label-1.0.8.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kivy_latex_label-1.0.8.tar.gz
Algorithm Hash digest
SHA256 a753157b7cd48186818b728a6884d2a2421187298450e5d67a9d19da6135e214
MD5 b5c777c38e78cc325132b9bfa2a0bc61
BLAKE2b-256 ce5f26c9a9650ff2ff3533081ec787eb9fb033494b564bffb71c04318d73d744

See more details on using hashes here.

Provenance

The following attestation bundles were made for kivy_latex_label-1.0.8.tar.gz:

Publisher: python-publish.yml on PaulCreusy/kivy-latex-label

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kivy_latex_label-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for kivy_latex_label-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1737aee29bd25df83adb9d4f3355968180c9c0a0e0e1b20641cad7cb7fa135a5
MD5 6d61a86d1220de2a6ced33bf327dcb4b
BLAKE2b-256 bc407181e8f13128fdd13d22f209f06832c79d1b533875038eebbfbaafae7c4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kivy_latex_label-1.0.8-py3-none-any.whl:

Publisher: python-publish.yml on PaulCreusy/kivy-latex-label

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page