Skip to main content

High-performance bidirectional LaTeX <-> Typst converter

Project description

tylax

High-performance bidirectional LaTeX <-> Typst converter. Python bindings for tylax.

Installation

pip install tylax

Requires Python 3.10+. Pre-built wheels available for Linux, macOS, and Windows.

Usage

import tylax

# Math conversion
typst = tylax.latex_to_typst(r"\frac{1}{2}")
latex = tylax.typst_to_latex("frac(1, 2)")

# Document conversion
typst_doc = tylax.latex_to_typst(r"\section{Hello}", document=True)
latex_doc = tylax.typst_to_latex("= Hello\nWorld", document=True)

# Auto-detect format
output, fmt = tylax.convert_auto(r"\frac{1}{2}")

# Format detection
tylax.detect_format(r"\documentclass{article}")  # "latex"

# With options
opts = tylax.L2TOptions(frac_to_slash=False)
tylax.latex_to_typst(r"\frac{a}{b}", options=opts)

# Diagnostics
result = tylax.typst_to_latex_diagnostics("frac(1, 2)")
print(result.output)
for w in result.warnings:
    print(f"[{w.kind}] {w.message}")

API

  • latex_to_typst(text, *, document=False, options=None) -> str
  • typst_to_latex(text, *, document=False, options=None) -> str
  • latex_to_typst_diagnostics(...) -> ConversionResult
  • typst_to_latex_diagnostics(...) -> ConversionResult
  • detect_format(text) -> str
  • convert_auto(text, *, document=False) -> tuple[str, str]

License

Apache-2.0

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

tylax-0.3.5.tar.gz (361.5 kB view details)

Uploaded Source

Built Distributions

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

tylax-0.3.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

tylax-0.3.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

tylax-0.3.5-cp310-abi3-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

tylax-0.3.5-cp310-abi3-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

tylax-0.3.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tylax-0.3.5-cp310-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tylax-0.3.5-cp310-abi3-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file tylax-0.3.5.tar.gz.

File metadata

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

File hashes

Hashes for tylax-0.3.5.tar.gz
Algorithm Hash digest
SHA256 e5c3a0671ed375ebf242d5dcc4f808b5a43f7833cc5d674acf44d7271f6bb41a
MD5 8be352d359ab758573bffab2fa272bc2
BLAKE2b-256 48fac6dc6d07d36c802f80d6337db4b4f5e680cf39ad229e72197882c5b558c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5.tar.gz:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tylax-0.3.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f53b2fc5dc7e0575dc7a09d699a984f536135968e3383e5b5643d379eba9e675
MD5 d6d27fb68864aff29e2e020b80a8324b
BLAKE2b-256 0d31cc8a4fa9315e8cba5035b0d8de9ad3d4c5b8310da50e830f3f954aa39eac

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tylax-0.3.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c4efe3a2f22ae8314af2cca580c96cb79990aec7c2d1a46291a81269b8b48460
MD5 f7e6ab5492fb1b9eb79a3580ad3f46bc
BLAKE2b-256 183c295e13d3ef3efcca1508c3cb11a0ce410b690c1abd2b33b3c74fb703dd72

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: tylax-0.3.5-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tylax-0.3.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fd3c837798e8d2adb87e46a133cccb071bf317b5727c3ed04a751e4ce7b6a9cd
MD5 8c394ca70062bd745283e0f049465976
BLAKE2b-256 13dbcb979b189116b9ad6dfdd4c7b7e3b360acbe06de6b152810dbe98e918cd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-cp310-abi3-win_amd64.whl:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tylax-0.3.5-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 adc481807639c0921782b1405db671fd67edb640de6f22e30130638eac106ce2
MD5 52a4073a24fb611e03093b154f6ffa5b
BLAKE2b-256 0d85b03ac4c747413cdf6c6be9b68fa9c6e9b5c81d11e658edc74459f3d07b62

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-cp310-abi3-manylinux_2_34_x86_64.whl:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tylax-0.3.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d317d25764fadc0281afdad8a424748fad47ec2071c04e4582ed5317ce100271
MD5 09e10f08283cdfec13d21b71eff1388c
BLAKE2b-256 803b61efc06c2f2583debebf328e9998094590500d7a32d0d9e17d24a361e74e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tylax-0.3.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d33453221ea7ece111a97812398292c0051e541f440aefcbd75e7dc38da06b4
MD5 fbe80ac4dd82b73fd96f4a45cc62a509
BLAKE2b-256 835a6ceec9386df8091621b975b827d9e82226f7020e247510171ba2eb67484c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: python-release.yml on scipenai/tylax

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

File details

Details for the file tylax-0.3.5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tylax-0.3.5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d9ab576ecc30074d437357d6956d8528d6d8b50b21e5fffa0e20f68fe2a9773b
MD5 7d742f45aad7c74cf0be67da4378d06d
BLAKE2b-256 ed37134ba2a7b0ab0d06e0474327253fe099299ec6a5fd49600141621d4c100c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.5-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: python-release.yml on scipenai/tylax

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