简体   繁体   English

如何摆脱 emacs 错误“void-variable org-format-latex-options”?

[英]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.我正在尝试在 macOS 上使用 doom-emacs 在 org-mode 中配置乳胶片段的预览。 I had a working setup before, but for some reason emacs does not recognize this variable anymore.我之前有一个工作设置,但由于某种原因 emacs 不再识别此变量。

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. Latex 已安装,在 init.el 中需要 org 并且 latex 片段的创建/预览工作正常,但由于此错误,我无法配置例如片段的大小。

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.关键点是 org-format-latex-options 仅org 加载后可用。 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!使用这个小修改,Emacs 不再报告提到的错误了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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