I've been using EWW and I noticed that it displays inline LaTeX expressions ($ ... $) but it fails to display those that have their own line ($$ ... $$). I'm attaching a print below. Have a look the blank space after the sentence "Symbolically, ".

I'm very new to Emacs, EWW, and text-based browsers so I have the following questions:

  • Is it possible to display those $$ ... $$ LaTeX formulas?
  • Can I choose whether I want to see the LaTeX code or the rendered version?

enter image description here

  • 1
    Neither Firefox nor EWW is rendering TeX. The inline expressions are pure HTML (e.g. <b>A</b><sup>1</sup> for A^1) and the standalone expressions are images.
    – Basil
    Oct 24, 2018 at 13:40
  • I see. So why aren't all the standalone formulas displayed in eww as images?
    – aadcg
    Oct 24, 2018 at 13:41
  • I'm not sure, can you reproduce from emacs -Q? Some causes off the top of my head are 0) running Emacs under a text terminal; 1) disabling HTML image rendering via variables like shr-inhibit-images/shr-blocked-images; 2) omitting some images by calling eww-readable; 3) image foreground is same colour as buffer background; 4) something else in your configuration or installed packages is somehow interfering; 5) Emacs is built without image support or has a bug; 6) etc. FWIW, I can't reproduce on latest Emacs development snapshot.
    – Basil
    Oct 24, 2018 at 13:54
  • 1
    Looks like it's some variant of option 5 (lack of image support or bug), the image loads fine for me on Emacs 26 and 27 but not in 25.
    – Basil
    Oct 24, 2018 at 13:58
  • I'm running version 25.2.2 so that's it... Thanks!
    – aadcg
    Oct 24, 2018 at 14:02

1 Answer 1


Looks like this is bug#24111, which was fixed for Emacs 26 in "Fix rendering of some complex SVG images" of 2017-01-24.

It is always recommended to use the latest Emacs version possible, especially in the context of browsing the web, but in the meantime I think you can hack around this issue on Emacs 25 with the following advice:

(define-advice shr-parse-image-data (:around (fn &rest args) my-emacs-25-patch)
  "Hackaround for bug#24111 in Emacs 25."
  (if shr-blocked-images
      (apply fn args)
    (cl-letf (((symbol-function 'libxml-parse-xml-region) #'buffer-substring)
              ((symbol-function 'shr-dom-to-xml)          #'identity))
      (apply fn args))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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