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 "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.2.tar.gz (2.6 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.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kivy_latex_label-1.0.2.tar.gz
  • Upload date:
  • Size: 2.6 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.2.tar.gz
Algorithm Hash digest
SHA256 dda674305d6569362e7c8e22695c7336f7862ff3f434070dfa3a63b2abfc99a0
MD5 6b45d006be1d9664e374cdb55b717999
BLAKE2b-256 a2b0e5519ee49e44b22f052274570c6a7c224c35b8fd3a99f9ce3e8944735f14

See more details on using hashes here.

Provenance

The following attestation bundles were made for kivy_latex_label-1.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kivy_latex_label-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a547d302f0281df4d9c2e1006630cfaf42277adf46f7a04ea436622cd68973a6
MD5 2e69a62b5b923dc67f1ecf6891a9b6a4
BLAKE2b-256 14101b69fba065e050918277b928809dbfa37f6c35cd3a7e84f4e8eece870643

See more details on using hashes here.

Provenance

The following attestation bundles were made for kivy_latex_label-1.0.2-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