Convert images of mathematical notes and equations into clean LaTeX with a Streamlit interface powered by OpenAI vision.
Live app: https://notes-2-latex.streamlit.app/
- Upload
.png,.jpg, or.jpegimages. - Extract only mathematical formulas as LaTeX.
- Convert a complete photographed page into a compilable
.texdocument. - Preview and copy generated LaTeX from the Streamlit UI.
- Download full-document output for use in Overleaf or another LaTeX editor.
- Uses
gpt-4o-minifor image understanding.
Foto2LaTeX (dual: FÓRMULAS o DOCUMENTO completo).py— recommended version with formula-only and full-document modes.Foto2LaTeX (solo FÓRMULAS → LaTeX).py— lightweight formula-only version.
- Python 3.10+
- Streamlit
- OpenAI Python SDK
- Pillow
- An OpenAI API key
Install dependencies:
pip install -r requirements.txtSet your API key as an environment variable:
export OPENAI_API_KEY="your-key"On Windows PowerShell:
$env:OPENAI_API_KEY="your-key"For Streamlit Cloud, store the key in the app secrets as OPENAI_API_KEY.
Never commit API keys to the repository.
Clone the project:
git clone https://github.com/MarioIbago/notes-2-LaTeX.git
cd notes-2-LaTeX
pip install -r requirements.txtRun the dual-mode app:
streamlit run "Foto2LaTeX (dual: FÓRMULAS o DOCUMENTO completo).py"Or run the formula-only version:
streamlit run "Foto2LaTeX (solo FÓRMULAS → LaTeX).py"- The uploaded image is normalized and encoded for the vision request.
- The selected mode asks the model either for raw equation LaTeX or for a complete compilable document.
- The response is returned to the Streamlit interface for preview, copy, or download.
See LICENSE.