emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to allow adjusting latex fragment display scale factor


From: Matt Huszagh
Subject: Patch to allow adjusting latex fragment display scale factor
Date: Sun, 10 Oct 2021 21:32:45 -0700

Hi,

I've created a patch to allow adjusting the scale factor used for inline
latex image fragments. This involves a customizable variable that can
either be set to a scale factor (defaults to 1.0) or a function that
evaluates to a scale factor.

This feature is in addition to the existing scale factor adjustment
capability provided by `org-preview-latex-process-alist' through
`:image-size-adjust'. Wherease image-size-adjust performs scaling at the
time of image generation, the new change performs it during
display. This can lead to significant time saving and suffers no loss of
quality for vector graphics.

As an example of use, I have several functions for changing frame
scaling. I've added

(if (eq major-mode 'org-mode)
      (progn
        (org-clear-latex-preview)
        ;; 16 corresponds to the C-u C-u arg prefix.
        (org-latex-preview 16)))

to these functions so that changing the frame scaling also
correspondingly changes the latex preview/fragment scaling to match the
new size of the surrounding text. Because of this new feature, this
change is effectively instantaneous for reasonably numbers of
overlays. Obviously, something similar could be done for
`text-scale-adjust' (e.g., through `advice-add').

Feedback appreciated.

Matt

Attachment: 0001-org.el-Allow-customizing-overlay-put-scale-factor.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]