From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: ferhun_caner@yahoo.com (Dr. F.C.Caner) Newsgroups: gmane.emacs.help Subject: LaTeX PDF and Acrobat Date: 20 Jun 2003 02:04:34 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <65fef11f.0306200104.479e1365@posting.google.com> NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1056100004 27485 80.91.224.249 (20 Jun 2003 09:06:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2003 09:06:44 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 20 11:06:42 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19THr0-00079A-00 for ; Fri, 20 Jun 2003 11:06:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19THpf-0003jN-B2 for gnu-help-gnu-emacs@m.gmane.org; Fri, 20 Jun 2003 05:05:19 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 59 Original-NNTP-Posting-Host: 194.27.206.56 Original-X-Trace: posting.google.com 1056099875 24960 127.0.0.1 (20 Jun 2003 09:04:35 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 20 Jun 2003 09:04:35 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:114600 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11092 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11092 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) )