I'm studying machine learning and the literature is formulae-rich.

I want to be able to extract the formulae (which seem to be created by TeX) to either:

  • .PNG images
  • LaTeX

I've tried:

  • pdfimages -- only the raster images are extracted (no formulae)
  • pdf2html -c -- formulae are garbled
  • 1
    TeX formula are typeset as positioned characters, not as images. Ghostscript can render to PNG, and you can crop as well: see e.g. here. Though it may be easier to render the whole page, and crop with some other program. But I am not sure in what way images of the formulae will help you ... – dirkt Jun 17 '17 at 8:57
  • @dirkt Are the typeset characters in containers that could be translated into separate images? If separate images are the best that can be done, that's bunches better than having to manually recreate them. Otherwise, it looks like screenshotting is the way to go. – Tom Hale Jun 19 '17 at 4:06
  • 1
    Without looking at your PDF file(s) I can't say, but usually they won't we in some kind of container. Using gs with a PNG driver is better than screenshotting in terms of quality, because you can set the resolution, and you won't get the font and spacing artifacts that you get when displaying a PDF at the (comparatively low) screen resolution. But screenshotting of course also works in principle. – dirkt Jun 19 '17 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.