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.4.tar.gz (4.5 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.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kivy_latex_label-1.0.4.tar.gz
  • Upload date:
  • Size: 4.5 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.4.tar.gz
Algorithm Hash digest
SHA256 1d24fee411a9c44641de2602530f886efb28183a09e78d280658063c0033ed92
MD5 2af51c672955ec7a8b10ce95ea899e9e
BLAKE2b-256 f512b282145a3ce07b2f2f86932d14fd3948bd145fed331d08d3eb97f6b44763

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kivy_latex_label-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 96b96d34ba82204d7ccba1e51d72699e1f498071ab1e56cde95765576d899c2f
MD5 70abb19882ee73d8c9033b68c3cb5cc9
BLAKE2b-256 000dfbd616923bbff0be15ca263ca55959895e98d86a74cc088da3bbdfc45d17

See more details on using hashes here.

Provenance

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