Org-Mode中的FlySpell会识别像auctex这样的胶乳语法 [英] FlySpell in Org-Mode recognize latex syntax like auctex
问题描述
原始响应:
我试图弄清楚如何在auctex模式下,似乎没有突出显示任何使用flyspell打开的乳胶功能。这是一个自定义的字典文件还是这样实现的?这可以很容易地并入组织模式文件,因此它不会突出显示将导出的插入的胶乳代码。
编辑:
从文件顶部和文本。基本上,像{ref}中的ref或label之类的乳胶语法不会被拼写检查(这是通过使用(setq ispell-parser tex)来修复的,然后还设置一个函数,使用#+作为第一个文本的特定标签我会想要标题检查,但不是#+ LABEL:或#+ TYP_TODO :(没有显示。也是一种添加TODO关键字不被检查的方式,我可以想到一种方法来做到这一点在启动时,将这些添加到LOCALWORDS:ispell位于文件底部,如果还没有,但是有一个更简单或更好的方式来执行此操作。
#+标签:注意报告export noexport MEETING
/ pre>
#+ TYP_TODO:TODO每周等待下一个|会议DONE
#+ STARTUP:隐藏内容隐藏
指数运行平均值显示在图\ref {fig:saturation_varying_alphaval_00f6set2}中的各种alpha值
#+ CAPTION:指数运行平均值($ EM $)与$ S_ {min} = 0.0008 \text {和p_m = 0.20 $
#+ LABEL:fig:saturation_varying_alphaval_00f6set2
#+ ATTR_LaTeX:width = 0.4\textwidth placement = [h!tb]
解决方案
flyspell
内部使用ispell -mode
。要更改ispell
解析文件的方式,将变量ispell-parser
设置为'tex
。(add-hook'org-mode-hook(lambda()(setq ispell-parser 'tex)))
Original Response: I was trying to figure out how in auctex mode latex doesn't seem to highlight any latex functions with flyspell turned on. Is this a custom dictionary file or how is this implemented? Can this be easily incorporated into an org-mode file so it doesn't highlight inserted latex code that will get exported.
Edit: Simple example taken from top of file and in the text. Basically so latex syntax like ref or label inside {} won't be spell checked (this has been fixed by using (setq ispell-parser tex). Then also setting up a function that specific labels with #+ as the first text on the line won't be checked. I would want the caption checked but not #+LABEL: or #+TYP_TODO: (not shown. Also a way to add TODO keywords to not get checked. I can think of a way to do this is on startup add these to the LOCALWORDS: ispell places at the bottom of the file if not already there but is there an easier or better way to do this.
#+TAGS: NOTE REPORT export noexport MEETING #+TYP_TODO: TODO Weekly WAITING NEXT | Meeting DONE #+STARTUP: hidestars content hideblocks The exponential running mean is shown for various alpha values in Figure \ref{fig:saturation_varying_alphaval_00f6set2}. #+CAPTION: Plot of varying alpha values for the exponential running mean ($EM$) with $S_{min} = 0.0008 \text{ and } P_m = 0.20$ #+LABEL: fig:saturation_varying_alphaval_00f6set2 #+ATTR_LaTeX: width=0.4\textwidth placement=[h!tb]
解决方案
flyspell
internally usesispell-mode
. To change the way thatispell
parses files set the variableispell-parser
to'tex
.(add-hook 'org-mode-hook (lambda () (setq ispell-parser 'tex)))
这篇关于Org-Mode中的FlySpell会识别像auctex这样的胶乳语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!