Is there a way to quickly (render and) print short latex snippets like single equations?

Something similar to

echo "Some text" | lpr


make-latex-image "$\frac{some}{equation}$" | command-to-print-images
  • 1
    there is preview-latex, which is part of auctex (in emacs) which lets you view math in an emacs latex buffer. – Faheem Mitha Mar 26 '14 at 16:16
  • I can't seem to find the package, and I want a command-line solution rather than invoking emacs. – user80551 Mar 26 '14 at 17:10
  • 1
    You might want to ask your question here: tex.stackexchange.com – mkc Mar 27 '14 at 3:35
  • @Ketan Yes, but the command-to-print-images part concerns U&L.SE more – user80551 Mar 27 '14 at 5:26

There are several projects out there (e.g. mathtex) that facilitate converting a single LaTeX fragment into an image. However in your case it it probably worth scripting something yourself so you get more options as far as the available LaTeX packages and your output format go. You should be able to whip up a LaTeX template with your desired packages pretty easily, then compile it and use dvipng to generate an image. One you have an image, most Linux and BSD distros have apsfilter already, so passing the image to the printer is as easy as calling lpr <image_file>.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.