unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* integrating PDFLaTeX with emacs?
@ 2005-03-17 18:50 Elvis Chen
  2005-03-17 19:50 ` Daniel Wright
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Elvis Chen @ 2005-03-17 18:50 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Daniel Wright @ 2005-03-17 19:50 UTC (permalink / raw)


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

Hi!
Are you using AucTeX?
<URL:http://www.gnu.org/software/auctex/>
It provides the things you'd like to do and a lot, lot more.
Greetings,
Daniel.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2005-03-17 20:58 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 17.03.2005 um 19:50 schrieb Elvis Chen:

> I'm trying to get PDFLaTeX to play nicely with emacs.

Don't forget RefTeX (it should already be part of your Emacs), 
(http://staff.science.uva.nl/~dominik/Tools/reftex/). These settings 
help a bit too:

   (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
   (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
   (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
   (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
   (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
   (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
   (setq reftex-plug-into-AUCTeX t)
;  M-x customize-variable RET reftex-plug-into-AUCTeX RET

And besides AUCTeX there is preview-latex 
(http://preview-latex.sourceforge.net/, 
http://prdownloads.sourceforge.net/preview-latex/). It converts 
particularly math into graphics.

AUCTeX allows a lot of customization ...

(setq TeX-view-format "pdf")
;--  (remove ".pdf" completion-ignored-extensions))
(setq pdf-previewer-program "texdoc")
  '(TeX-PDF-mode t)
  '(dired-view-command-alist (quote (("\\.\\(ps\\|ps_pages\\|eps\\)\\'" 
. "texdoc %s") ("\\.pdf\\'" . "texdoc %s") 
("\\.\\(jpe?g\\|gif\\|png\\)\\'" . "xv %s") ("\\.dvi\\'" . "texdoc 
%s"))))


--
Greetings

   Pete

"Don't just do something, sit there."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  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-19 22:23 ` Olive
  4 siblings, 0 replies; 9+ messages in thread
From: David Kastrup @ 2005-03-17 21:57 UTC (permalink / raw)


Elvis Chen <chene@cs.queensu.ca> writes:

> 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

Ok, this very much looks like you use the builtin TeX mode of Emacs.
I would very much suggest that you try using AUCTeX
<URL:http://www.gnu.org/software/auctex>.  This is reasonably easy,
since we provide a SuSE RPM at <URL:ftp://ftp.gnu.org/pub/gnu/auctex>.
AUCTeX in its current versions will usually guess from package options
in the preamble whether to use LaTeX or PDFLaTeX, and you can easily
switch between the two manually, too.  C-c C-v will start the
respective viewer, but the usual "dispatcher" uses C-c C-c RET instead
of C-c C-f.  One can get used to it.

Apart from better indentation and formatting, you get a lot of
document-sensitive help for inputting stuff.  It is really worth a
try.

Even preview-latex <URL:http://preview-latex.sourceforge.net> works
with PDFLaTeX by now.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  2005-03-17 18:50 integrating PDFLaTeX with emacs? Elvis Chen
                   ` (2 preceding siblings ...)
  2005-03-17 21:57 ` David Kastrup
@ 2005-03-18  4:23 ` Stefan Monnier
  2005-03-18  7:44   ` David Kastrup
  2005-03-19 22:23 ` Olive
  4 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2005-03-18  4:23 UTC (permalink / raw)


> 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

Have you tried C-c C-c ?


        Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  2005-03-18  4:23 ` Stefan Monnier
@ 2005-03-18  7:44   ` David Kastrup
  2005-03-18 16:30     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: David Kastrup @ 2005-03-18  7:44 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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
>
> Have you tried C-c C-c ?

With Emacs-21.3?  That won't get him anywhere without AUCTeX, and it
is pretty obvious that he is not using AUCTeX yet from the rest of his
report.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  2005-03-18  7:44   ` David Kastrup
@ 2005-03-18 16:30     ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2005-03-18 16:30 UTC (permalink / raw)


>>> 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
>> 
>> Have you tried C-c C-c ?

> With Emacs-21.3?

Duh! You're right, tex-compile didn't make it to 21.3.
Oh well, in that case, either install AUCTeX or install Emacs-CVS
and try C-c C-c again,


        Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  2005-03-17 18:50 integrating PDFLaTeX with emacs? Elvis Chen
                   ` (3 preceding siblings ...)
  2005-03-18  4:23 ` Stefan Monnier
@ 2005-03-19 22:23 ` Olive
  2005-03-19 22:28   ` Olive
  4 siblings, 1 reply; 9+ messages in thread
From: Olive @ 2005-03-19 22:23 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: integrating PDFLaTeX with emacs?
  2005-03-19 22:23 ` Olive
@ 2005-03-19 22:28   ` Olive
  0 siblings, 0 replies; 9+ messages in thread
From: Olive @ 2005-03-19 22:28 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-03-19 22:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).