Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 864 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 864 Bytes

PyTex

Implementing a typesetting system for mathematical formulas using TeX algorithms and fonts inside Python without relying on an external TeX installation is a complex task

output PyTex

Compiler

  • Compiler design part is completed, which you can see from the /compiler folder.
token_specification = [
        ('NUMBER',    r'\d+(\.\d*)?'),    # Integer or decimal number
        ('IDENT',     r'[A-Za-z]'),       # Identifiers (variables)
        ('OP',        r'[+\-*/^]'),       # Arithmetic operators
        ('FRAC',      r'\\frac'),         # Fraction
        ('LBRACE',    r'\{'),             # Left brace
        ('RBRACE',    r'\}'),             # Right brace
        ('WS',        r'\s+'),            # Whitespace
        ('MISMATCH',  r'.'),              # Any other character
    ]