yangsheng6810 / org-latex-impatient

Instant Previews LaTeX snippets in Org-mode
GNU General Public License v3.0
148 stars 10 forks source link

On OSX. preview either doesn't exist or is giant. #14

Open justinabrahms opened 2 years ago

justinabrahms commented 2 years ago

Okay, so by default.. they preview is giant. If I change the scale to 0.5, it disappears. Any thoughts?

(use-package org-latex-impatient
  :defer t
  :hook org-mode
  :ensure-system-package ((tex2svg . "npm install -g mathjax-node-cli"))
  :config
  (setq org-latex-impatient-tex2svg-bin "/usr/local/bin/tex2svg"
        org-latex-impatient-scale 0.5))

Photo w/ the scale enabled

The box in the middle is the preview pane

Screen Shot 2022-06-12 at 11 19 37 PM

Photo without scale enabled

Screen Shot 2022-06-12 at 11 21 05 PM
yangsheng6810 commented 2 years ago

I am not a Mac user, but I recall some had issue with scaling. Here are a few things you might want to check:

  1. Emacs version. Quite some changes were made in Emacs 28, some involving the rendering of SVG.
  2. librsvg version.
  3. Emacs distribution, i.e. emacs-mac, emacs-plus, etc. Some reported limited support for SVG for some distribution, specifically scaling capability.
  4. HiDPI setting in Emacs.

To start with debugging, you might want to change function org-latex-impatient--insert-into-posframe-buffer, and write ss into a temp file, like mentioned here: https://github.com/yangsheng6810/org-latex-impatient/issues/12#issuecomment-1098477929. This writes the SVG being rendered into "/tmp/org-latex-impatient-*.svg", and you can try opening it in Emacs directly and in your favorite SVG viewer.

dankessler commented 6 months ago

I think I have found a fix for this; see PR #24