Emacs Auctex更改默认的View命令


0

我需要帮助使用View在emacs中运行的Auctex中的命令。这对查看pdf至关重要,没有它我无法制作TeX文档。在我的emacs文件中,我有以下内容(由Mx customize-variable创建):

(custom-set-variables                                                                    
 ;; custom-set-variables was added by Custom.                                            
 ;; If you edit it by hand, you could mess it up, so be careful.                         
 ;; Your init file should contain only one such instance.                                
 ;; If there is more than one, they won't work right.                                    
 '(TeX-view-program-list (quote (("Preview" "\"open -a Preview.app %o\""))))

现在我打开一个.tex文档并输入C-c C-c(我已编译):

Emacs给出: Command: (default View)

我点击进入

Emacs提供此默认命令: View command: dvi2tty -q -w 132

我点击了输入,emacs说:View: done.但在pdf阅读器中没有显示任何内容!

dvi2tty用于纯文本设备,该命令实际上在emacs中创建一个新的缓冲区,试图显示pdf文件(它非常混乱)。无论如何,如果我dvi2tty -q -w 132用`open -a Preview.app%o' 替换(我正在运行Mac OS X 10.8.4并且Preview是默认pdf阅读器的名称),那么预览打开pdf!

  1. 如何更改默认View commanddvi2tty -q -w 132open -a Preview.app %o

非常感谢所有帮助!

Answers:


1

我很幸运,找到了解决方案!

跟着这些步骤

  1. M-x customize-variable
  2. Emacs给出:Customize variable:输入:TeX-command-list
  3. 搜索View(输入C-s然后键入`查看)
  4. Emacs将带您进入视图命令,您可以在其中输入文本。

它看起来像这样(在Command之后会有一个文本输入的地方):

[INS] [DEL] Name: View                                                                                 
            Command: open -a Preview.app %s.pdf                                                        
            How: [Value Menu] TeX-run-command                                                          
            Create a process for NAME using COMMAND to process FILE. More                              
            Prompt: [Toggle]  on (non-nil)                                                             
            Modes: [Value Menu] All                                                                    
            Menu elements:                                                                             
            [INS] [DEL] Lisp expression: :help                                                         
            [INS] [DEL] Lisp expression: "Run Text viewer"

将文本更改为Command:您需要的任何内容。这将自动更改您的~/.emacs文件。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.