简体   繁体   中英

How to get rid of emacs error "void-variable org-format-latex-options"?

I'm trying to configure the preview of latex-fragments in org-mode using doom-emacs on macOS. I had a working setup before, but for some reason emacs does not recognize this variable anymore.

Latex is installed, org is required in the init.el and the creating/preview of latex fragments is working, but I can't configure eg the size of the fragments because of this error.

Is there some specific requirement for the usage of this variable, or what could the origin of the error be?

I searched around a bit, and found the problem with my setup. The crucial point was that org-format-latex-options is only available after org has been loaded. Might be a bit of a nooby error, but I was not aware of this fact, maybe someone else in the future has the same problem...

To fix the error, for me that meant replacing this bit of configuration

(plist-put org-format-latex-options :scale 1.5)

with the following:

(after! org (plist-put org-format-latex-options :scale 1.5))

Using this minor modification, Emacs does not report the mentioned error anymore!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM