LaTeX-OCR is a library for converting images to LATEX code. I recently had to reinstall it and ran into some issues. I’m documenting them here so it can help someone else.
brew install miniconda
conda init
conda create -n latexocr python=3.11
. Ifpip install qt=6.6.3 "pix2tex[gui]"
Thanks to this post for fixing issue with numpy
installation.
I also added this fish helper function to start with a single
command: latexocr
function latexocr
conda_init
conda activate latexocr
/opt/homebrew/Caskroom/miniconda/base/envs/latexocr/bin/latexocr
end
function conda_init
if test -f /opt/homebrew/Caskroom/miniconda/base/bin/conda
eval /opt/homebrew/Caskroom/miniconda/base/bin/conda "shell.fish" "hook" $argv | source
else
if test -f "/opt/homebrew/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish"
. "/opt/homebrew/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish"
else
set -x PATH "/opt/homebrew/Caskroom/miniconda/base/bin" $PATH
end
end
end