Tex-master已设置却仍然询问主文件的问题

Auctex版本

        Status: Installed in ‘auctex-13.2.2/’. Delete
       Version: 13.2.2
        Commit: bc75884db3d173fe5656aefd7543990aaaac49e6
       Summary: Integrated environment for *TeX*
      Requires: emacs-26.1
       Website: https://www.gnu.org/software/auctex/
      Keywords: tex latex texinfo context doctex preview-latex 
    Maintainer: <[email protected]>
Other versions: 13.2.2 (gnu).

相关配置

(load "auctex.el" nil t t)
;; (load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)

(mapc (lambda (mode) (add-hook 'laTeX-mode-hook mode))
      (list ;'auto-complete-mode
       'auto-fill-mode
       'LaTeX-math-mode
       'turn-on-reftex
       'linum-mode))

(add-hook 'LaTeX-mode-hook
          (lambda ()
            (setq TeX-auto-untabify t     ; remove all tabs before saving
                  TeX-engine 'xetex       ; use latex default
                  TeX-show-compilation t) ; display compilation windows
            (TeX-global-PDF-mode t)       ; PDF mode enable, not plain
            (setq TeX-save-query nil)
            (imenu-add-menubar-index)
            (define-key LaTeX-mode-map (kbd "TAB")
          'TeX-complete-symbol)))

; set pdf view tool
(setq TeX-view-program-list '(("Okular" "okular %o")))

(add-hook 'LaTeX-mode-hook
          (lambda()
            (setq TeX-view-program-selection (output-pdf "Okular"))
            )
)

; XeLaTeX
(add-hook 'LaTeX-mode-hook (lambda()
    (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
    (setq TeX-command-default "XeLaTeX")
    (setq TeX-save-query  nil )
    (setq TeX-show-compilation t)
    ))

问题描述

文件配置

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End:

如上所示,已标记了主文件名称,但编译的时候询问仍然询问主文件,输入main.tex后能够正常编译,并将配置改为:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% TeX-master: "main"
%%% End:

下面是询问主文件的截图:

  • 如果二次编译operator.tex文件,则不再提问主文件并正确编译。
  • 如果再次打开该文件,则同样的询问会再次发生。

请教为什么配置没有记住我标记的主文件?

直接输入这些变量的话似乎不会有效果,试试C-c C-n

1 个赞