unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Olive <olive.lin@versateladsl.be>
Subject: Re: integrating PDFLaTeX with emacs?
Date: Sat, 19 Mar 2005 23:28:42 +0100	[thread overview]
Message-ID: <423ca84d$1_4@x-privat.org> (raw)
In-Reply-To: <423ca722$2_5@x-privat.org>

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))))

      reply	other threads:[~2005-03-19 22:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-17 18:50 integrating PDFLaTeX with emacs? Elvis Chen
2005-03-17 19:50 ` Daniel Wright
2005-03-17 20:58 ` Peter Dyballa
2005-03-17 21:57 ` David Kastrup
2005-03-18  4:23 ` Stefan Monnier
2005-03-18  7:44   ` David Kastrup
2005-03-18 16:30     ` Stefan Monnier
2005-03-19 22:23 ` Olive
2005-03-19 22:28   ` Olive [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='423ca84d$1_4@x-privat.org' \
    --to=olive.lin@versateladsl.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).