This extension takes your latest copied image from your clipboard and converts the math to latex and inserts it at your position in the editor. See GIF below for example of usage with a keybinding:
A couple of things happen here
- I take a screenshot of the formula on the left
- I use a keybinding to trigger the OCRToLatex
- A loading indicator is inserted
To get started first get an api token, see below. Then go to settings and insert it. After this you are ready to use the plugin. Try to snip a math formula to your clipboard and run the command Generate latex from last image to clipboard
To use this plugin you need to create a developer account at https://simpletex.cn. Below I describe how to do this
- Go to https://simpletex.cn/api
- Click "Go to API Dashboard"
- Create an account
- After this go to
User Access Token
and clickCreate token
- Copy the token and paste into Obsidian settings
- Now you are ready to use the addon ๐ฅณ
It is possible to a self-hosted instance.The self-hosted API should just return a string with quotes containing the LaTeX text, you can use this image from this repo.
- Setup the docker container image
- Enable
Use Docker
in the plugin settings - Enter the URL to the container, if you use the image above you need to postfix
/predict/
e.g.http://localhost:8502/predict/
- Optional add username and password, if container is behind a basic auth proxy (e.g. nginx)
- Convert already pasted images
- Use https://github.com/lukas-blecher/LaTeX-OCR for self hosted version
Thanks to these libraries and services for making this plugin possible