5/28/2023 0 Comments Latex overlay text on image(plist-put org-format-latex-options :justify 'center) I apply the functions as after advice to the function that creates the overlay, so we do not have to adapt the org code at all. While we are at it, I will add a tooltip to the image so you can see the LaTeX code that created it, and make it clickable so you can toggle it back to the code. The idea is pretty simple, we get the width of the window, and the width of the image, and compute the offset that approximately centers or right justifies the overlay, and then add the before-string property to the overlay. You should see the video to see this in action:Īn \(x^2 = -1\) equation in the text is not affected.Ī display equation with some space after the equation: This will only justify equations that start at the beginning of a line to avoid modifying fragments that are in text. You have to add a :justify option to org-format-latex-options, and the option is either 'center or 'right (anything else means left-justified as the default). I worked out a full solution that lets you "justify" the preview images. We thought it might be possible to just offset the overlay with a before-string made up of the right number of spaces. This might make org-mode notes look nicer when lecturing, for example. (advice-add 'org-create-formula-image :around #'org-renumber-environment)Ī colleague asked if I knew how to center the preview images of LaTeX equations in an org-buffer. (( and (string-match "\\\\begin\n" numberp) (org-element-map (org-element-parse-buffer) 'latex-environment ( defun org-renumber-environment (orig-func
0 Comments
Leave a Reply. |