Emacs LaTeX 模式下的 ispell
当我在 LaTeX 模式下的 Emacs 缓冲区上运行 Emacs 命令 ispell-buffer
时,ispell 也会检查数学表达式内的拼写。
我非常想禁用这个。有简单的方法吗?
我读过有关 detex 的内容,但 detex 似乎没有集成到 Emacs 中。
When I run Emacs command ispell-buffer
on an Emacs buffer which is in the LaTeX mode, ispell checks spelling also inside math expressions.
I'd very much like to disable this. Is there an easy way to do it?
I've read about detex but detex does not seem to be integrated into Emacs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您使用乳胶(例如 \[ ... \]、方程环境、&c)来调用数学模式,则不应这样做。检查
ispell-tex-skip-alists
的内容;参见ispell 常见问题解答第 6 节了解应该包含哪些内容。您可以使用 $..$、$$..$$ 使用 ispell-tex-skip-alists 来标记数学,但要小心让它们失去平衡...
Postscript
另请检查以下值
ispell-parser
变量:这应该是'tex
,否则 ispell 将不会查找 $...$ 和 $$...$$ 区域。It shouldn't do this, if you are using latexisms (eg. \[ ... \], equation environments, &c) to invoke math mode. Check the contents of
ispell-tex-skip-alists
; cf. section 6 of the ispell FAQ for what kind of thing should be there.You can use $..$, $$..$$ to mark out maths using ispell-tex-skip-alists, but beware getting them out of kilter...
Postscript
Check also the value of the
ispell-parser
variable: this should be'tex
, otherwise ispell will not look for $...$ and $$...$$ regions.是的,您可以:安装 aspell 而不是 ispell,并使用 Flyspell 。
Yes, you can: install aspell instead of ispell, and use flyspell with it.
这并没有直接回答你的问题,但我发现 Flyspell ,一个即时拼写检查器,在编辑 LaTeX 文档时非常有用。它仍然对方程内部进行拼写检查,但比 ispell 的交互式命令更容易忽略一些额外的红色下划线。
This doesn't answer your question directly, but I have found Flyspell, an on-the-fly spell checker, incredibly useful when editing LaTeX documents. It still spellchecks inside equations, but it is much easier to ignore a few extra red underlines than ispell's interactive commands.
您可能知道这一点,但您可以在拼写检查期间按
A
将单词添加到缓冲区本地字典中(即大写A
,小写a
> 将其添加到全局词典中)。这并不理想,但这就是我通常在 LaTeX 文档中禁止对技术术语和变量名称等进行拼写检查的方式。You may know this, but you can press
A
during spell checking to add a word to the buffer-local dictionary (that's capitalA
, lowercasea
adds it to the global dictionary). It's not ideal, but this is how I usually suppress spell-checking of technical terms and variable names, etc., in my LaTeX documents.此 AUCTeX 邮件列表线程:“拼写检查器 (ispell-buffer) 抱怨数学模式下的产品” 有一些解决方法,答案演示了如何使用 ispell-tex-skip-alists。
This AUCTeX mailing list thread : "spell checker (ispell-buffer) complains about products in math modes" has some workarounds and the answer demonstrates how to use ispell-tex-skip-alists.
另一种方法是使用 ispell-skip-region-alist。以下示例是排除 org-mode src 块:
Another approach is to use
ispell-skip-region-alist
. The following example is to exclude org-mode src blocks: