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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

File metadata

  • Download URL: tylax-0.3.6.tar.gz
  • Upload date:
  • Size: 374.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.6.tar.gz
Algorithm Hash digest
SHA256 ad2da2c903398508976423ed8107d4c2e200b337377ce90e15835fab247e4394
MD5 87971cbe944332d2279470f47c5b6bd0
BLAKE2b-256 1cfee1a8120b5872c19aaa0a065778fd90330dc681a3c8897a335536678bccc4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tylax-0.3.6-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.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e9d8f5205575d10061c148c805cdd0ec4657430fa3cb350ffa0c42eec518fc3e
MD5 05d078628073ec264d56a7a3f5e71fb3
BLAKE2b-256 6bcc1e0566ae2ec1e4656afc4b008f68d05e14b3b3eddef1e497907fc2568f91

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tylax-0.3.6-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c641edba1b4426d4ee703e50a013a92fc3cb1dd2d9d83cd566e0b8e17c93801a
MD5 98d87b3c4811581d713fbb1c458b0384
BLAKE2b-256 1fb5a47043aef8e6fd7f0d33397d3e39912ffad6b826199fe6759648411edfcd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tylax-0.3.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 863a060e8bce14985fb18acf4d45cc1837d2310fafe1ad4125abb71e5e27ef1e
MD5 3ce4f0b910ed3ace6272ddd411f3c72b
BLAKE2b-256 c7e9e0d50ea5838b53b9fd7278db79e957133ba6f89d7da5006c67758e315b03

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tylax-0.3.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6756afc0d647c5a1412135846878e4c2720d098f0d62c8f07417b9b485a34aed
MD5 d739875c61ca710d40b5e7579067580b
BLAKE2b-256 03a01c4ae7df10e083662685f4d62b23ae033336e9c0823a17f1ec63ffbe707e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tylax-0.3.6-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e0d883a650c0e553fe5b36e968530f78cd0c61bd34dc03f6b5d6d1c2d5635d38
MD5 2e85e43669bd5e11f5760f70497c0e01
BLAKE2b-256 ba5e1d2c536e639ca31f8b7af362ada50467fe68090ae8859b254bc23811000a

See more details on using hashes here.

Provenance

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