In general, detexify (here) and my ScanTools workflow is great. However, sometimes more can be done.

1micromamba create -n textocr
2micromamba activate textocr
3micromamba install torchvision -c pytorch
4pip install pix2tex[gui]
5pip install python-doctr
6pip install nougat-ocr

The TeX tool (LaTeX OCR) works great even via the terminal. The doctr library is a bit more finicky, but can be a decent way to extract plain text when regular OCR tools fail (e.g. ocrmypdf).

Which is alright, called via python -c doctr_runner.py blah.pdf.

Or Meta’s nougat, which is slower but generally better formatted:

1nougat blah.pdf -o output_dir

As of 15-11-2023, both these options have a known warning about a memory leak.