FlySpell in Org-Mode recognizes latex syntax like auctex

Original answer: I was trying to understand how latex in auctex mode does not seem to emit any latex functions with flyspell enabled. Is this a custom dictionary file or how is it implemented? Could this be easily included in the org-mode file, so it does not highlight the inserted latex code that will be exported.

Edit: A simple example taken from the top of the file and in the text. Basically, latex syntax like ref or label inside {} will not be spell-checked (this was fixed with (setq ispell-parser tex). Then, a function was also created in which certain C # + labels as the first text the string will not be checked. I would like the signature to be marked, but not # + LABEL: or # + TYP_TODO: (not shown. You can also add TODO keywords so that they are not checked. Add them to LOCALWORDS: ispell at startup is placed at the bottom of the file if it does not already exist, but there is 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] 
+6
source share
2 answers

flyspell internally uses ispell-mode . To change the way in which ispell parses files, set the ispell-parser variable to 'tex .

 (add-hook 'org-mode-hook (lambda () (setq ispell-parser 'tex))) 
+3
source

Auctex most likely uses flyspell-mode-predicate to determine which parts of the buffer should not be spelled. ( This answer shows how to do something similar for MoinMoinWiki.) Org-mode already has an org-mode-flyspell-verify that doesn't seem to work properly for you ... A quick look at the source suggests that org-remove-flyspell-overlays-in should be called for buffers containing code samples, etc.

Sorry for the manual answer; Noting this as a wiki community to suggest improvements.

+2
source

Source: https://habr.com/ru/post/921281/


All Articles