https://github.com/amm4r03/natural-language-to-latex
convert natural language mathematical expressions and equations to rendered latex
https://github.com/amm4r03/natural-language-to-latex
latex miktex pdflatex python
Last synced: 14 days ago
JSON representation
convert natural language mathematical expressions and equations to rendered latex
- Host: GitHub
- URL: https://github.com/amm4r03/natural-language-to-latex
- Owner: Amm4r03
- Created: 2024-07-30T02:52:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-03T12:34:26.000Z (about 1 year ago)
- Last Synced: 2025-04-07T08:44:57.542Z (7 months ago)
- Topics: latex, miktex, pdflatex, python
- Language: Python
- Homepage:
- Size: 1.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## natural language to latex
this tool converts user input for any mathematical equation or expression into its latex equivalent making use of LLM. the latex obtained is converted to a jpeg file and saved in the `/output` folder - thus the user can make use of the image or just the plain latex text obtained## features
- Converts natural language mathematical expressions and equations to LaTeX
- Generates jpeg images of LaTeX expressions## Example
**Input:** "integral of x squared from 0 to 1"**Output:**
- LaTeX: `\int_0^1 x^2 \, dx`
- Image: (image preview)examples for the images generated using this project have been added within the `examples` folder
Given below are some images that were generated using this project1. a 2x2 matrix with its determinant
2. bayes theorem
3. correlation coefficient r
## installation
run the following command
```git
git clone https://github.com/Amm4r03/natural-language-to-latex
```## requirements
install python packages using the following command :
(packages mentioned in `requirements.txt`)```cmd
pip install -r requirements.txt
```this project also makes use of `pdflatex` which comes installed with MiKTeX and can be downloaded from [here](https://miktex.org/howto/download-miktex)
## Usage
- When running the project for the first time, start by getting your API key up and running from [cohere](https://dashboard.cohere.com/api-keys) which provides fairly decent LLM usage under the free tier
- run the [start_here.py](start_here.py) and enter the API key obtained from cohere to get your API key saved to the .env file
- run the [app.py](app.py) file
- the output images obtained will be stored in the `/output` folder and the latex obtained for the expression will be displayed in the terminal