From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Olive Newsgroups: gmane.emacs.help Subject: Re: integrating PDFLaTeX with emacs? Date: Sat, 19 Mar 2005 23:28:42 +0100 Organization: X-Privat NNTP Server - http://www.x-privat.org Message-ID: <423ca84d$1_4@x-privat.org> References: <423ca722$2_5@x-privat.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1111271285 26804 80.91.229.2 (19 Mar 2005 22:28:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2005 22:28:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 19 23:28:04 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DCmQM-0007K5-78 for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Mar 2005 23:28:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCmh8-0005Df-0s for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Mar 2005 17:45:22 -0500 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040618 X-Accept-Language: en-us, en Original-Newsgroups: gnu.emacs.help In-Reply-To: <423ca722$2_5@x-privat.org> Original-NNTP-Posting-Host: $$_ewcpdimnf7m3_.x-privat.org Original-Lines: 72 X-Authenticated-User: $$s059zlu66nq1tvzvcvj6lkm_d Original-X-Complaints-To: abuse@x-privat.org Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news.spies.com!newsfeed-3001.bay.webtv.net!news.moat.net!x-privat.org!not-for-mail Original-Xref: shelby.stanford.edu gnu.emacs.help:129446 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: news.gmane.org gmane.emacs.help:25001 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25001 Olive wrote: > Elvis Chen wrote: > >> hi all, >> >> sorry for what may be a trivial question, but please help if it is >> trivial >> nonetheless :) >> >> I'm trying to get PDFLaTeX to play nicely with emacs. I'm using Linux >> Suse 9.1 with Emacs-21.3. I would like to edit my ~/.gnu-emacs-custom >> such that I can rebind the keys: >> >> Ctrl-c Ctrl-f to "pdflatex" my .tex file, and >> Ctrl-c Ctrl-v to launch xpdf to view the resulting .pdf file >> >> can someone give me a hint please? >> >> From emacsWiki I have found what may work: >> (setq tex-command "pdftex") >> (defun tex-view () >> (interactive) >> (tex-send-command "xpdf" (tex-append tex-print-file ".pdf"))) >> >> but it doesn't. my key-binding were still tied to latex/xdvi >> >> tia, >> >> ECC >> > > (set-variable (quote latex-run-command) "pdflatex") > (set-variable (quote tex-dvi-view-command) "xpdf") > > You can also do this interactively by M-x customize-variable > latex-run-command and the same for tex-dvi-view-command > > This works for the standard mode of emacs. auctex has that functionality > built-in. Some people in this list find unbelievable to not use auctex. > I strongly disagree with this. Some people, as me, prefer to use the > standard TeX mode. > > Olive Oups... to view the pdf; you must also change the extension of the "dvi" file. Put this in your .emacs (defun tex-print (&optional alt) "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. Runs the shell command defined by `tex-dvi-print-command'. If prefix argument is provided, use the alternative command, `tex-alt-dvi-print-command'." (interactive "P") (let ((print-file-name-dvi (tex-append tex-print-file ".pdf")) test-name) (if (and (not (equal (current-buffer) tex-last-buffer-texed)) (buffer-file-name) ;; Check that this buffer's printed file is up to date. (file-newer-than-file-p (setq test-name (tex-append (buffer-file-name) ".pdf")) (buffer-file-name))) (setq print-file-name-dvi test-name)) (if (not (file-exists-p print-file-name-dvi)) (error "No appropriate `.dvi' file could be found") (if (tex-shell-running) (tex-kill-job) (tex-start-shell)) (tex-send-command (if alt tex-alt-dvi-print-command tex-dvi-print-command) print-file-name-dvi t))))