Emacs 中 LaTeX 的代码折叠
是否有一个 Emacs 次要模式(或一段 elisp 代码)可以让您在 LaTeX 模式下有选择地隐藏/显示环境?例如,我想移动到一个长 \begin{figure}
块的开头,按一下按键,然后将该图形环境的内容隐藏在视图中。与 \begin{proof}
等类似,理想情况下甚至与 \subsection
也是如此。
这可能吗?我刚刚尝试了 hs-minor-mode
、allout-mode
和 outline-minor-mode
,但大多数都无法识别 LaTeX环境,例如 hs-minor-mode 失败并显示“扫描错误:括号不平衡”。我不想输入显式的折叠标记,例如 folding-mode 中的 {{{ 。
[理想情况下,如果折叠是持久的,那就太好了,但我发现这个问题没有还没有一个被接受的答案。]
Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure}
block, hit a keystroke, and have the contents of that figure environment hidden from view. Similarly with \begin{proof}
and so on, and ideally even with \subsection
s.
Is this possible? I just tried hs-minor-mode
, allout-mode
, and outline-minor-mode
, but most of them don't recognize LaTeX's environments, e.g. hs-minor-mode fails with "scan error: unbalanced parentheses". I would prefer not to have to enter explicit folding marks like {{{ as in folding-mode.
[Ideally it would be great if the folding were persistent, but I see that that question doesn't have an accepted answer yet.]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AUCTeX 进行折叠: http://www.gnu.org/software/ auctex/manual/auctex.html#Folding
AUCTeX does folding: http://www.gnu.org/software/auctex/manual/auctex.html#Folding