Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A poor man's solution that works with advices and hooks is shown below. Paste the code into your .emacs configuration file and re-start emacs. Afterwards, the equation images should be scaled <del>at</del> <em>along with the text if you press</em> C-+/-/0. <em>They are just previews and their</em> <del>The bad thing is that the</del> resolution is not enlarged. To get equation images with a good resolution hit C-c C-x C-l to regenerate the images. <em>Note, that this sets the :scale property of the customization variable org-format-latex-options. The customization of this variable will be lost for the current emacs session.</em></p> <p>You need a gnu-emacs with built-in imagemagick. Should be standard by now.</p> <pre><code>(defvar text-scale-mode-hook nil "Hook run at end of command `text-scale-mode'.") (defadvice text-scale-mode (after text-scale-mode-hooks nil activate) "Run `text-scale-mode-hook' at end of command `text-scale-mode'." (if (functionp text-scale-mode-hook) (funcall text-scale-mode-hook) (loop for hook in text-scale-mode-hook do (if (eq hook 't) (run-hooks (default-value text-scale-mode-hook)) (run-hooks hook))))) (defun org-text-scale-eye () "Scale equation images according to text-scale-mode-amount." (when (boundp 'text-scale-mode-amount) (let ((relwidth (* (expt text-scale-mode-step text-scale-mode-amount)))) (loop for ol in (overlays-in (point-min) (point-max)) do (when (eq (overlay-get ol 'org-overlay-type) 'org-latex-overlay) (unless (overlay-get ol 'org-image-original-width) (overlay-put ol 'org-image-original-width (car (image-size (overlay-get ol 'display) t)))) (let ((ol-disp-plist (cdr (overlay-get ol 'display)))) (setq ol-disp-plist (plist-put ol-disp-plist :type 'imagemagick)) (setq ol-disp-plist (plist-put ol-disp-plist :width (round (* relwidth (overlay-get ol 'org-image-original-width))))) (overlay-put ol 'display (append '(image) ol-disp-plist)) )))) (force-window-update) )) (add-hook 'org-mode-hook '(lambda () (add-hook 'text-scale-mode-hook 'org-text-scale-eye))) (defadvice org-format-latex (before set-scale activate) "Set :scale in `org-format-latex-options' to the scaling factor resulting from `text-scale-mode' and clear cache." (let ((relwidth (expt text-scale-mode-step text-scale-mode-amount))) (unless (= (plist-get org-format-latex-options :scale) relwidth) (plist-put org-format-latex-options :scale relwidth)))) </code></pre> <p>Actually, I had a look at the code in org.el: The font height is regarded in the function org-create-formula-image-with-dvipng and the resolution option -D is set. Maybe, there goes something wrong. Furthermore, pityingly, in org-format-latex the images are cached and not reproduced after font size changes.</p> <p>If you want to increase the size of the latex-formulas for one session in general with good quality you can set the :scale value of the customization option "Org Format Latex Options" in the group "org-latex" to a higher value.</p> <p><em>Edit 2013-10-10 (marked as italic throughout the answer except the code, naturally): The :scale property of the option org-format-latex-options is now set automagically. Therefore, the above hack should be quite usable (such as the latex version mentioned below).</em></p> <hr> <p>The same problem as you describe in the original-post exists for latex-preview. But, for that case there is a better solution:</p> <pre><code>(require 'face-remap) (defadvice preview-inherited-face-attribute (after preview-inherit-local-face nil activate) "Scale preview images with respect to buffer-local face" (when (and text-scale-mode (eq attribute :height)) (setq ad-return-value (* (expt text-scale-mode-step text-scale-mode-amount) ad-return-value)))) </code></pre> <p>After C-+/-/0 type C-c C-p C-d to re-generate all formulas of the document. Afterwards, the formulas have just the right size and the right resolution.</p> <p>If switching to latex documents with preview is an option for you I would recommend it. I use org only for notes and time-tables with easy links.</p> <p>For more descriptive documents I use latex documents with auctex/preview. But, I actually compile them only very seldom to a final pdf document. The preview is good enough. See the following Figure. <img src="https://i.stack.imgur.com/7RihX.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload