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 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.1.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.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kivy_latex_label-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ad9bc1fb334e93066be981c8f5d0bf79408111876c44b3f0a88a4a4bfe6aa5ad
MD5 19fb91c3defc681f6761cbf4dd17689f
BLAKE2b-256 cb8fef19151fe12ad33c3e01dbb59008e7e3d6c26d2eeba4e0c4730a42c98bdc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kivy_latex_label-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e92bf99ef08e3d33eb97336e53be88d4f91dc72fb6f0a65ae708eb825b1421d5
MD5 97c965be0e212e2eca591989b3b96493
BLAKE2b-256 e9cf7675eddd2f9a0a0b2b9bf976c9445528f390430049e6af16dd2b2ea5b482

See more details on using hashes here.

Provenance

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