【问题标题】:Autocompleting \cite{} with emacs + auctex gives "cite: no such database entry"使用 emacs + auctex 自动完成 \cite{} 给出“引用:没有这样的数据库条目”
【发布时间】:2011-03-05 00:57:52
【问题描述】:

我在 Ubuntu 8.10 机器上运行 Emacs 23.1.1 和 AucTeX 11.85。打开 tex 文件后,我第一次尝试使用 \cite{} 命令的自动补全,我得到

“引用:信息不可用,使用 `C-c &' 获取它。”

在小缓冲区中。完成'C-c &'后,我得到了

“字节码:没有带有引用键的 BibTeX 条目”。

对 \cite 的后续调用给了我信息

“引用:没有这样的数据库条目”。

我的 tex 文件中有一个 \bibliography{library},我手动完成的 \cite{} 条目按预期工作。

我的 .emacs 中有以下内容

(require 'reftex)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode) ;turn on pdf-mode.  AUCTeX
                                          ;will call pdflatex to
                                          ;compile instead of latex.
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) ;turn on math-mode by
                                             ;default
(add-hook 'LaTeX-mode-hook 'reftex-mode) ;turn on REFTeX mode by
                                         ;default
(add-hook 'LaTeX-mode-hook 'flyspell-mode) ;turn on flyspell mode by
                                           ;default

(setq reftex-plug-into-AUCTeX t)
(setq TeX-auto-save t)
(setq TeX-save-query nil)
(setq TeX-parse-self t)
(setq-default TeX-master nil)

我也尝试了Suggestion for \cite in Emacs with AUCTeX中的建议,但也没有用。

亚历杭德罗。

【问题讨论】:

  • 在尝试自动完成之前,您是否至少运行过一次 bibtex?你试过 C-c [
  • 我以前运行 bibtex。相同的行为。然而, C-c [ 成功了!谢谢。
  • 找到一种方法来结束你的问题,然后让它得到回答。也许写一个答案并打勾?
  • 我认为 \cite 自动补全应该可以工作(只需输入 \cite{)。我正在等待答案:)。
  • 看来我不会得到更好的答案。我只是添加我的答案。我需要等待 14 小时才能打勾。

标签: emacs auctex


【解决方案1】:

C-c [ 有效。 (我不确定在输入 \cite{ 后是否应该完成,但我对其他解决方案感到满意。)

【讨论】:

    【解决方案2】:

    我按照前面提到的步骤,发现 C-c [ 效果很好。我还可以使用以下命令查看可用的引文:

    1.) C-c
    2.) 类型:\cite
    3.) 类型:searchTerm

    其中 searchTerm 是 .bib 文件中项目的正则表达式。如前所述,请确保在尝试 \cite 自动完成之前运行 bibtex 和 latex。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-12
      • 2014-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-18
      • 1970-01-01
      相关资源
      最近更新 更多