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

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 latex_label.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.0.tar.gz (2.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.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kivy_latex_label-1.0.0.tar.gz
  • Upload date:
  • Size: 2.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.0.tar.gz
Algorithm Hash digest
SHA256 8740af5eaf7f91c2005619732bf7fb13cbc4bdec72770943b500b39a6d3b1c45
MD5 4001bb5406a0d7537d0137a82da62d8b
BLAKE2b-256 08039db3f22c2ac3903af5e72e1c7b02959483b7d02eb95a66b291cc2aa21734

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kivy_latex_label-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43be135a6154da1e2ef612060cb942ae2e1686c2e39a2a1bc44aa548d2efb9b6
MD5 a33c5aee0060629567f869ceced5bd1f
BLAKE2b-256 2d43d215b16b29b14694407b2e81f12a699384a7f79a03a4c52eebe48559fdef

See more details on using hashes here.

Provenance

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