{"id":13994572,"url":"https://github.com/mkhan45/CalcuLaTeX","last_synced_at":"2025-07-22T19:32:48.723Z","repository":{"id":47235815,"uuid":"338450328","full_name":"mkhan45/CalcuLaTeX","owner":"mkhan45","description":"A pretty printing calculator language with support for units. Makes calculations easier and more presentable with real time LaTeX output, along with support for units, variables, and mathematical functions.","archived":false,"fork":false,"pushed_at":"2021-09-07T15:12:53.000Z","size":1031,"stargazers_count":396,"open_issues_count":19,"forks_count":17,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-11-15T16:53:41.160Z","etag":null,"topics":["calculator","interpreter","latex","math","science"],"latest_commit_sha":null,"homepage":"https://calcula.tech","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/mkhan45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-12T22:41:54.000Z","updated_at":"2024-09-09T17:15:16.000Z","dependencies_parsed_at":"2022-08-29T23:21:58.051Z","dependency_job_id":null,"html_url":"https://github.com/mkhan45/CalcuLaTeX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhan45%2FCalcuLaTeX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhan45%2FCalcuLaTeX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhan45%2FCalcuLaTeX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhan45%2FCalcuLaTeX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkhan45","download_url":"https://codeload.github.com/mkhan45/CalcuLaTeX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227166801,"owners_count":17740983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["calculator","interpreter","latex","math","science"],"created_at":"2024-08-09T14:02:57.205Z","updated_at":"2024-11-29T16:31:33.301Z","avatar_url":"https://github.com/mkhan45.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# CalcuLaTeX\n\n![Test Status](https://img.shields.io/github/workflow/status/mkhan45/CalcuLaTeX/Test?label=Tests)\n![Crates.io](https://img.shields.io/crates/v/calculatex)\n\nTry it out at \u003chttps://calcula.tech/app\u003e\n\n## Example\n\n```\n'''\nGiven a rock with mass $m_{rock}$ thrown by a force of $F_0$ acting over a duration $dt_{force}$,\ncalculate its airtime and the max height it achieves.\n'''\n\n''' Given: '''\ng = 9.81 m/s^2\nm_{rock} = 10 kg\nF_0 = 1000 N\ndt_{force} = 0.1 s\n\n\n''' Solution: '''\ny_{vel} = F_0 / m_{rock} * dt_{force} = ?\n\nairtime = y_{vel} / g * 2 = ?\nheight_{max} = y_{vel} * airtime / 4 = ? cm\n```\n\nOutputs:\n\n![example 1](images/ex1.png)\n\n```\n''' \nCalcuLaTeX:\n\nWrite an expression followed by = ? to evaluate it:\n'''\n\n50 g + 1 kg = ?\n\n'''\nYou can suggest a unit if it outputs the wrong one. \\\\\nMake sure it's correct otherwise the document won't \\\\\ncompile!\n'''\n\n5 m/s^2 * 3 kg = ?\n5 m/s^2 * 3 kg = ? N\n\n'''\nAssign variables with =\n\nThey support some LaTeX formatting\n'''\na_b = 5\nc = 10 kg\na_b * c = ?\nz = a_b kg + c = ?\n\n'''\nYou can also add aliases for hard to type variables\n'''\nalias dx \\frac{dx}{dt}\nalias dt \\Delta{t}\n\ndx = 10 m/s\ndt = 14 days\nx = dx * dt = ?\n\n'''\nSet the output digits or use scientific notation \\\\\nby using !digits \\{n\\} or !scientific \n'''\n\n1 / 3 = ?\n\n!digits 10\n1 / 3 = ?\n\n!digits 1\n!scientific\n1 kg = ? mg\n\n'''\nBasic mathematical functions are supported.\n\nAdditionally, builtin constants include $\\pi$ and $e$.\n'''\n\nsin(\\pi) = ?\ncos(\\pi) = ?\ne = ?\n\n'''\nEscape raw latex with three single quotes.\n\nThere's still plenty of bugs, so feel free to \\\\\nopen an issue at \\\\\nhttps://github.com/mkhan45/CalcuLaTeX\n'''\n```\n\nOutputs:\n\n![tutorial](images/tutorial.png)\n\n___\n\n# CLI Usage\n\nAssuming the binary is called `calculatex`, running `calculatex [input] [output.pdf]` will watch the `input` file and output to `output.pdf` on change. This is meant for use with a PDF viewer which updates in realtime.\n\nTo run the CalcuLaTeX cli, you'll also need pandoc and a texlive installation.\n\n___\n\n# Compiling\n\nTo build CalcuLaTeX, you need a nightly Rust compiler and Cargo, preferably through rustup. After that, it's as simple as:\n\n```\ngit clone git@github.com:mkhan45/CalcuLaTeX.git\ncd CalcuLaTeX\n\n# both of these output to target/release/\ncargo build --release # builds the library only\ncargo build --features build-binary --release # builds the CLI\n```\n\n___\n\n# Contributing\n\nIf you'd like to contribute, feel free to open an issue or send me an email. The code base is very messy right now but it's small enough to be pretty understandable. Performance suggestions are welcome, but only if they don't introduce any extra complexity. I haven't benchmarked anything but LaTeX compilation is pretty much guaranteed to take an order of magnitude longer than the interpreter.\n\nFor guidelines, read [CONTRIBUTING.md](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhan45%2FCalcuLaTeX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkhan45%2FCalcuLaTeX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhan45%2FCalcuLaTeX/lists"}