emacs auctex:可以自动填充节标签吗?
我目前正在使用 emacs 和 auctex 来编写我的 Latex 文档。这当然是太棒了。但是,我希望在使用 Cc Ce
创建新标题时让 emacs 和/或 auctex 自动填充节标签。它最终应该看起来像这样:
\section{This is a section title}
\label{sec:this-is-a-section-title}
标题的标签与标题相同,但没有空格。我不懂 lisp 或 elisp,也不知道从哪里开始。如果有人可以提供帮助那就太好了!
I am currently using emacs and auctex to author my latex documents. This is, of course, fantastic. However, I would like to have emacs and/or auctex auto-fill the section label when using C-c C-e
to make a new header. It should end up looking like this:
\section{This is a section title}
\label{sec:this-is-a-section-title}
with the label for the header the same as the title, but with no spaces. I don't know lisp or elisp, and I'd have no idea where to start. If anyone could help that would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 RefTeX,则
Cc (
将执行您想要的操作(如果您愿意,您可以有机会更改标签)。此外Cc )
将插入\ref {...}
,弹出一个缓冲区以选择要使用的标签。它还可以做其他事情,包括处理参考书目。你绝对应该调查一下。我认为它现在是 AUCTeX 发行版的一部分,因此您所要做的就是添加
到您的 .emacs 中。
If you use RefTeX then
C-c (
will do what you want (giving you the opportunity to change the label if you wish). AlsoC-c )
will insert\ref{...}
, popping up a buffer to choose which label to use. It also does other stuff including working with bibliographies. You should definitely look into it.I think it's now part of the AUCTeX distribution so that all you should have to do is add
to your .emacs.