reddit / emacs

Nano emacs and math-preview

wakatara · 2022-12-12 03:46
I recently switched my config over to the (very!) aesthetically pleasing and nicely usable emacs nano. Already using it as a daily driver and very happy with it UX-wise, though I still have a thing (and a reported bug) keeping it from being near-ideal. Math-preview (using the new one with MathJax3), which I rely on heavily on latex when taking notes for astrophysics formulas and, well... math. ¯\\_(ツ)_/¯ Math-preview just gives a blank little box (smaller than formula's expansion) where the formulas should go despite the fact I have it triggered on all pages with formulas via this: ```elisp (use-package math-preview :straight t :custom (math-preview-command "/opt/homebrew/bin/math-preview")) (setq math-preview-scale 1.75) (setq math-preview-tex-marks-inline '(("$$" "$$"))) (setq math-preview-tex-marks '(("\\begin{equation}" "\\end{equation}") ("\\begin{equation*}" "\\end{equation*}") ("$$" "$$") )) (add-hook 'org-mode-hook #'math-preview-all) ``` modification in custom so that it does not trigger on pages talking about money and only explicitly on a double `$$` in case people were wondering. As you can probably tell from the preview command I'm on an M1 OSX system and straight as my package manager. This block works in my other config, so unsure if it's related to the fact nano uses fixed width in the main text (whereas I had variable pitch in my other config... or some other factor. Any insights appreciated.). I do notice that nano does some implicit (and nice!) rendering of things like CO_2 and sub and superscripts automatically inline typing, but this problem relates directly to complex math formula rendering. Anyone got it working with nano?
no-dupe · 2022-12-12 05:51
I have no real knowledge on this topic, but I would first check if there are different minor modes enabled between both emacs and nano emacs, and start investigating from there. Another test I would do is to replace the marker $$ to something more esoteric (££ for instance) to be sure it is not misinterpreting the character is some way.
wakatara · 2022-12-12 11:59
This was useful advice, (though it appears to not be the minor modes), as I believe the issue is not related to nano now but related to the fact I had to use emacs 28 instead of 29 to correct an issue with org-roam not working (and emacs 29 might be needed for the latest version of math-preview.).