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.7.tar.gz (383.0 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.7-cp310-abi3-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

tylax-0.3.7-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.7-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.7-cp310-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tylax-0.3.7-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.7.tar.gz.

File metadata

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

File hashes

Hashes for tylax-0.3.7.tar.gz
Algorithm Hash digest
SHA256 f93312b43a60d932e7ab4d27d8541abc0be50567bf56246fc2db47bb8cb022dd
MD5 9342eb3dce0920df7363554a8b9ae688
BLAKE2b-256 572c40a9183332c663064a144f518d138b3263370e9d3f81e36320d1fd27d63f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.7.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.7-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: tylax-0.3.7-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.12

File hashes

Hashes for tylax-0.3.7-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4562070fba2b162c0d27681f52f3a8e446c8ad71200dc39e70e426794e50905d
MD5 c25a513d9d5ad206aa1cbec10a45f8c3
BLAKE2b-256 c9c8f3b932d19585ff87e60838d52692e21baaa52b3a7c3e86f8aa4e2d73131a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.7-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.7-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tylax-0.3.7-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 478dc2047687f6ca5e984597ba39179d1fa8f03a7a809c8f7e53a5467d615313
MD5 0b80aef496213c0ff8ec8e40c26d20f5
BLAKE2b-256 b5ec74c6365141d73d04393361507b215ab2178f390905db7d4073fdda850d31

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.7-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.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tylax-0.3.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 09c1ec7f6e01a3c07e11c8cbcd048ccd1f5da875446847550c2ae0aa06545dff
MD5 bcb6dfde99d79acaf32a5327c0238dd4
BLAKE2b-256 58b6bac826928676e9ef1cda1662f181fd08acc5faa3b2a80e27b9874438961c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.7-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.7-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tylax-0.3.7-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0100677eb0fd079ab07a1af64a1516289b9f174833af302dd80046e58993247
MD5 5a71327fc0e72b9d97f83439524ca18c
BLAKE2b-256 131938c81684472480d0e5c78d31ee6eb23d6fda89e44902ae68733a2cdcc56a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.7-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.7-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tylax-0.3.7-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f75a432faa4c118a7bd6cf0155b90a18437e4b520ea069b03dbc7d5467e2c6cb
MD5 3adaaf1cdfda2e8b2103859111e0002f
BLAKE2b-256 a2a358ae2dfd8324b4840510e7fc6c1b962ed8d2ae35f9ca1d969b29538936df

See more details on using hashes here.

Provenance

The following attestation bundles were made for tylax-0.3.7-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