gpt4 book ai didi

Emacs Auctex 编译错误: "Use M-x make-directory RET RET to create the directory and its parents"

转载 作者:行者123 更新时间:2023-12-01 11:43:25 25 4
gpt4 key购买 nike

我在 ubuntu 12.04 和 auctex 11.86 上运行 emacs 23.3.1。每当我去编译 latex 文档(使用 C-c C-c)时,如果没有错误,一切都编译得很好。但是,如果有任何错误,它会告诉我使用 C-` 查看错误,如果我这样做,我会收到此错误消息

Use M-x make-directory RET RET to create the directory and its parents

它会在几秒钟后消失。然后它将我带到另一个屏幕,解释 latex 代码中的错误。但是,现在我不能简单地执行 C-x 1 来返回 latex 代码。我必须 C-x C-c 并重新启动 emacs。

这是我的.emacs 文件

(setq backup-by-copying t
backup-directory-alist '(("." . "~/.emacsBkups"))
delete-old-versions t
kept-new-versions 5
kept-old-versions 2
version-control t)


(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-PDF-mode t)

;;(require 'ess-site)
;;(ess-toggle-underscore nil)
(require 'whitespace)
(setq whitespace-style '(lines-tail face))

(add-hook 'c-mode-hook 'whitespace-mode)
(add-hook 'c++-mode-hook 'whitespace-mode)
(add-hook 'python-mode-hook 'whitespace-mode)

(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
(c-set-offset (quote cpp-macro) 0 nil)



(setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))
(setq TeX-view-program-selection '((output-pdf "Evince")))

最佳答案

有时 AUCTeX 在解析 (La)TeX 编译的日志时会感到困惑,并且无法猜测引发错误的正确行。在某些情况下,当括号不平衡时,AUCTeX 会发出一条模糊的消息“最后一个 TeX 文件关闭后发生错误”,在您的情况下,它建议您创建一个新目录。为了帮助 AUCTeX 找到引发错误的正确行,您可以通过自定义变量将 -file-line-error 选项添加到 latexpdflatex LaTeX 命令样式。为此,将以下代码添加到您的 .emacs:

(setq LaTeX-command-style '(("" "%(PDF)%(latex) -file-line-error %S%(PDFout)")))

另见 AUCTeX FAQ :

8. Why does TeX-next-error (C-c `) fail?

When writing the log file, TeX puts information related to a file, including error messages, between a pair of parentheses. AUCTeX determines the file where the error happened by parsing the log file and counting the parentheses. This can fail when there are other, unbalanced parentheses present.

As a workaround you can activate so-called file:line:error messages for the log file. (Those are are easier to parse, but may lack some details.) Either you do this in the configuration of your TeX system (consult its manual to see where this is) or you add a command line switch to the (la)tex call, e.g. by customizing LaTeX-command-style or TeX-command-list.

关于Emacs Auctex 编译错误: "Use M-x make-directory RET RET to create the directory and its parents",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17346514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com