help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

loading TeX-PDF-mode


From: newbKt
Subject: loading TeX-PDF-mode
Date: 24 Jul 2006 17:35:23 -0700
User-agent: G2/0.2

I didn't find the TeX-command-list in my tex-site.el file (in the
site-lisp subfolder). Does anyone know how to modify the following
instruction set for the current version of Emacs? (I'm not very
comfortable changing loading files, so the more details that are
included, the better, like where to capitalize.) Thanks! Oh yeah, does
anyone know how to change the PDF viewer on AucTeX/Emacs? The default
is xpdf, which I don't have so I need to change to adobe. Thanks again!
-Kt

LaTeX PDF and Acrobat
Only 1 message in topic - view as tree

From:           Dr. F.C.Caner - view profile
Date:           Fri, Jun 20 2003 5:04 am
Email:          ferhun_ca...@yahoo.com (Dr. F.C.Caner)
Groups:                 gnu.emacs.help

Hello all,

Here is the final version of Lisp code which
(1) closes all the documents in the Acrobat window
(2) runs LaTeX Pdf
(3) opens the newly produced pdf file in the Acrobat window right
after LaTeX Pdf is done with compiling.

It is a very useful feature for those who use LaTeX Pdf on a Windows
system. It must be inserted into tex-site.el. Finally, TeX-run-LaTeX
that runs LaTeX Pdf in the TeX-command-list must be changed into
TeX-run-pdfLaTeX as shown below in the same file.

(defvar TeX-command-list
  (list
     ...
   (list "LaTeX PDF" "pdflatex '\\nonstopmode\\input{%t}'"
         'TeX-run-pdfLaTeX nil t)
     ...))

Best,
FCC.

;;; This function is by von Jesper Harder:
(defun acrobat-close-all-docs ()
  "Close all open documents in Acrobat."
  (save-excursion
    (set-buffer (get-buffer-create " *ddeclient*"))
    (erase-buffer)
    (insert "[CloseAllDocs()]")
    (call-process-region (point-min) (point-max)
       "c:/EmacsPlugins/ddeclient/ddeclient" t t nil "acroview"
"control")
    (if (= 0 (string-to-int (buffer-string))) t nil)))

(defun acrobat-open-doc (process event)
  "Open file in Acrobat."
  (save-excursion
    (set-buffer (get-buffer-create " *ddeclient*"))
    (erase-buffer)
    (insert (concat "[FileOpenEx(\"" file1 ".pdf\")]"))
    (call-process-region (point-min) (point-max)
       "c:/EmacsPlugins/ddeclient/ddeclient" t t nil "acroview"
"control")
    (if (= 0 (string-to-int (buffer-string))) t nil)
    )
  )

(defvar file1 "")

(defun TeX-run-pdfLaTeX (name command file)
  "Create a process for NAME using COMMAND to format FILE with
pdfLaTeX."
  (setq file1 file)
  (acrobat-close-all-docs)
  (TeX-run-LaTeX name command file)
  (set-process-sentinel (get-process "LaTeX PDF") 'acrobat-open-doc)
)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]