Closed karthink closed 6 months ago
Looking at the implementation, I think the only way this can happen is if display-mm-height
is zero. The docstring also says it can be nil
, so I'm going to update the function to this:
(defun org-latex-preview--get-display-dpi ()
"Get the DPI of the display.
The function assumes that the display has the same pixel width in
the horizontal and vertical directions."
(if (display-graphic-p)
(let ((mm-height (or (display-mm-height) 0))
(mm-per-inch 25.4))
(if (= 0 mm-height)
140 ; Fallback reasonable DPI
(round (/ (display-pixel-height) (/ mm-height mm-per-inch)))))
(error "Attempt to calculate the dpi of a non-graphic display")))
Running
org-latex-preview
returns an arithmetic overflow error with the functionorg-latex-preview--get-display-dpi
. Report from user: