2012-09-26 42 views
0

的Emacs:GNU Emacs的23.4
OS:OS X 10.6
rst.el:不知道版本,但是從網上下載sourceforge第一個模式 - 無法創建PDF

最新我已經設置了正確的路徑在我的.emacs,以便它看到rst2pdf。我正在嘗試使第一編譯pdf預覽()在我的第一模式下工作。當我做C-C C-C C-P時,我不知道發生了什麼 - 它無聲無息地失敗了。當我運行這個按鍵,我想Emacs的執行

rst2pdf "1 file with space.txt" -o "1 file with space.pdf" 

請注意,我需要有引號照顧的文件用空格和-o。

下面是代碼是被稱爲:

(defvar rst-pdf-program "/Applications/Preview.app/Contents/MacOS/Preview" 
"Program used to preview PDF files.") 

(defun rst-compile-pdf-preview() 
"Convert the document to a PDF file and launch a preview program." 
(interactive) 
(let* ((tmp-filename (make-temp-file "rst_el" nil ".pdf")) 
(command (format "%s %s %s && %s -o %s ; rm %s" 
      (cadr (assq 'pdf rst-compile-toolsets)) 
      buffer-file-name tmp-filename 
      rst-pdf-program tmp-filename tmp-filename))) 
    (start-process-shell-command "rst-pdf-preview" nil command) 
    ;; Note: you could also use (compile command) to view the compilation 
    ;; output. 
    )) 

(對不起,我似乎可以用粘貼正確的格式代碼,我不希望保留單獨格式化每一行)。

現在,當我做C-C C-C C-C,並手動發出rst2pdf 1.txt - 它的作品。

+0

任何理由,你爲什麼不使用隨Emacs的捆綁rst.el主要開發者? – Stefan

回答

0

看起來rst.el的這部分確實存在一個錯誤。需要引用buffer-file-name,因此請將buffer-file-name替換爲(shell-quote-argument buffer-file-name)。我的rst2pdf也需要一個-o,而rst.el代碼似乎沒有提供任何代碼,但上面的示例代碼加上-o太「太晚了」:它應該放置在第二個和第三個%s之間。

1

我檢查了問題,發現外部rst2pdf不符合reStructuredText調用標準。 rst.el在這方面是正確的,並且與Docutils沙盒中的rst2pdf一起使用。恕我直言,外部rst2pdf應該固定以符合reStructuredText標準。

此外,在預覽功能中添加「-o」並不能解決通常生成PDF時的問題。

斯特凡

維護者和rst.el

相關問題