llamatex
Convert natural language descriptions to LaTeX equations in your terminal, in under a second!
Features
llamatex offers two primary modes of operation:
- Single Instruction Mode: Generate LaTeX for a single equation description.
- Clipboard Mode: Send LaTeX code from highlighted text into your clipboard.
- Markdown File Editing Mode: Automatically replace natural language descriptions with LaTeX equations in a markdown file.
For equations that can be rendered in a single line, smoltex opens a new window displaying the rendered equation.
Installation
pip install llamatex
For local generation support:
pip install llamatex[local]
Alternatively, you can build from source using poetry.
poetry install
Usage
Single Instruction mode
llamatex render -p "equation for the area of a circle"
Output:
Latex string: A = \pi r^2
>> completion time: 856.4 ms
Clipboard mode
llamatex uses pynput to listen to your inputs and control the keyboard. To allow clipboard mode, allow your terminal/IDE to be added to Assessibility in System Settings.
Run llamatex in clipboard mode using the following command:
llamatex run
Markdown File Editing Mode
- Create a markdown file (e.g.,
equations.md) with placeholders:
# Important Equations
1. Area of a circle:
{"area of a circle"}
2. Einstein's mass-energy equivalence:
{"einstein's famous equation"}
- Run
llmatex:
llamatex render -f equations.md
- The file will be updated with LaTeX equations:
# Important Equations
1. Area of a circle:
$A = \pi r^2$
2. Einstein's mass-energy equivalence:
$E = mc^2$
Use the hotkey Cmd+Shift+L (on macOS) to process the selected text. Press esc to exit the program.
Configuration
API Setup
- Get a free API key from Groq console.
- Set the environment variable
export GROQ_API_KEY=your-api-key-here
Available models:
- llama3:
llama3-8b,llama3-70b,llama3.1-8b,llama3.1-70b - gemma:
gemma-7b,gemma2-9b - mixtral:
mixtral-8x7b - Phi3 (local only):
phi-3-mini
Server selection
Choose between groq (default) or llama-cpp (for local generation) using the -s or --server option:
llamatex render -p "pythagorean theorem" -s llama-cpp
Metadata
Release files for llmatex 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llmatex-0.1.0.tar.gz | 10.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llmatex-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.0 kB
Release files / llmatex-0.1.0.tar.gz
| Download URL | llmatex-0.1.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3beb59a21af62616859c53a8d299fda1d976c793c3b1aa0f1b5fe00f35c51785
|
|
BLAKE2b-256 checksum How to use checksums |
90ec8d45fb0e295f71f22e1736d43b925030e6e3ed3125cf018e12999b4a411f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.13 Darwin/22.3.0
|
Release files / llmatex-0.1.0-py3-none-any.whl
| Download URL | llmatex-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39d969753ac8a288305de66b440817c83db422ff3fa1e043a2d5812606d9c113
|
|
BLAKE2b-256 checksum How to use checksums |
88a0d3174bca49145d215e5107ae1f7b98f27be9c84e03549faf613ab6042ca7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.13 Darwin/22.3.0
|
Security for llmatex 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.