{"id":24291063,"url":"https://github.com/shnarazk/lucr","last_synced_at":"2026-04-24T23:34:21.291Z","repository":{"id":270934870,"uuid":"911875751","full_name":"shnarazk/lucr","owner":"shnarazk","description":"LaTeX math commands to Unicode symbols Converter in Rust","archived":false,"fork":false,"pushed_at":"2026-03-16T12:02:58.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-17T00:37:59.825Z","etag":null,"topics":["formatter","helix","lean4","zed-editor"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shnarazk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-04T04:36:16.000Z","updated_at":"2026-03-16T12:02:55.000Z","dependencies_parsed_at":"2025-01-04T07:24:24.589Z","dependency_job_id":"163b88ab-3f3e-424e-9414-d51c8d5c47fa","html_url":"https://github.com/shnarazk/lucr","commit_stats":null,"previous_names":["shnarazk/lucr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shnarazk/lucr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Flucr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Flucr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Flucr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Flucr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shnarazk","download_url":"https://codeload.github.com/shnarazk/lucr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Flucr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32245149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatter","helix","lean4","zed-editor"],"created_at":"2025-01-16T13:58:09.529Z","updated_at":"2026-04-24T23:34:21.283Z","avatar_url":"https://github.com/shnarazk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lucr\n\n**lucr** (LaTeX-to-Unicode Converter for Rust) is a fast formatter that converts LaTeX math commands to Unicode symbols. It's designed primarily for writing Lean4 files with proper mathematical notation in editors like Helix and Zed.\n\n## Features\n\n- **Fast Conversion**: Converts 238+ LaTeX commands to Unicode symbols\n- **Comprehensive Symbol Support**:\n  - Greek letters (`\\alpha` → α, `\\beta` → β, `\\Gamma` → Γ)\n  - Mathematical operators (`\\le` → ≤, `\\ge` → ≥, `\\in` → ∈, `\\notin` → ∉)\n  - Arrows (`\\r` → →, `\\l` → ←, `|-\u003e` → ↦)\n  - Superscripts and subscripts (`^2` → ², `_1` → ₁)\n  - Set notation (`\\cap` → ∩, `\\cup` → ∪, `\\empty` → ∅)\n  - Number sets (`\\N` → ℕ, `\\R` → ℝ, `\\Z` → ℤ, `\\Q` → ℚ, `\\C` → ℂ)\n  - Logical operators (`\\and` → ∧, `\\or` → ∨, `\\not` → ¬, `\\all` → ∀, `\\exists` → ∃)\n  - And many more mathematical symbols\n- **Editor Integration**: Works seamlessly with Helix and Zed editors\n- **Stdin/Stdout Filter**: Can be used in pipelines or as a standalone tool\n\n## Installation\n\n### From Cargo\n\n```bash\ncargo install lucr\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/shnarazk/lucr\ncd lucr\ncargo build --release\n# The binary will be in target/release/lucr\n```\n\n## Usage\n\n### Command Line\n\nlucr reads from standard input and writes to standard output:\n\n```bash\n# Basic usage\necho '\\alpha + \\beta = \\gamma' | lucr\n# Output: α + β = γ\n\n# Process a file\ncat math_file.lean | lucr \u003e output.lean\n\n# Use in a pipeline\ncat input.lean | lucr | other_tool\n```\n\n### Examples\n\n```bash\n# Greek letters\necho '\\alpha \\beta \\gamma \\Delta \\Omega' | lucr\n# → α β γ Δ Ω\n\n# Mathematical operators\necho 'x \\in \\N, x \\le 10 \\and x \\ge 0' | lucr\n# → x ∈ ℕ, x ≤ 10 ∧ x ≥ 0\n\n# Complex expressions\necho '\\all x \\in \\R, \\exists y \\in \\R, y^2 = x' | lucr\n# → ∀ x ∈ ℝ, ∃ y ∈ ℝ, y² = x\n```\n\n### helix configuration\n\n- .config/helix/languages.toml\n\n```toml\n[[language]]\nname = \"lean\"\nauto-format = true\nformatter = { command = \"lucr\", args = [] }\n```\n\n### zed configuration\n\n- You need Lean4 extension (now in dev mode): https://github.com/shnarazk/zed-lean4\n- .config/zed/settings.json\n\n```json\n  \"languages\": {\n    \"Lean4\": {\n      \"formatter\": {\n        \"external\": {\n          \"command\": \"lucr\"\n        }\n      }\n    }\n  },\n```\n\n## How It Works\n\nlucr uses a lookup table to match LaTeX commands with their Unicode equivalents. When it encounters a backslash (`\\`) in the input, it attempts to match the following characters against known LaTeX commands and replaces them with the corresponding Unicode symbol.\n\nThe tool is smart enough to:\n- Handle escaped backslashes (`\\\\`) correctly\n- Stop matching at word boundaries (spaces, parentheses, brackets, etc.)\n- Preserve unrecognized LaTeX commands as-is\n\n## Supported Symbol Categories\n\n1. **Italic alphabet** (Mi): Mathematical italic letters\n2. **Greek letters**: Both lowercase and uppercase\n3. **Number sets**: ℕ, ℤ, ℚ, ℝ, ℂ\n4. **Constants**: ∞, ∅, ⊤, ⊥\n5. **Superscripts**: ⁰¹²³⁴⁵⁶⁷⁸⁹ and letters\n6. **Subscripts**: ₀₁₂₃₄₅₆₇₈₉ and letters\n7. **Arrows**: ←, →, ↑, ↓, ↦\n8. **Parentheses**: ⟨, ⟩, ⟪, ⟫, «, »\n9. **Binary operators**: ∧, ∨, ∩, ∪, ×, •, ⊎, ⊓, ⊔\n10. **Relations**: ≤, ≥, ∈, ∉, ⊆, ⊇, ≠, ≃, ≅, ≺, ≼\n\n## License\n\nThis project is licensed under the Mozilla Public License Version 2.0 (MPL-2.0). See the [LICENSE](LICENSE) file for details.\n\n## Author\n\nNarazaki Shuji \u003cshujinarazaki@protonmail.com\u003e\n\n## Repository\n\nhttps://github.com/shnarazk/lucr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnarazk%2Flucr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshnarazk%2Flucr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnarazk%2Flucr/lists"}