all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A quick build 'function' for auctex
@ 2008-05-15 17:06 Christophe Jorssen
  2008-05-15 18:37 ` harven
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Jorssen @ 2008-05-15 17:06 UTC (permalink / raw
  To: help-gnu-emacs

Hello,

I'm quite new to emacs. I used to type my TeX files in kile or in winedt.

I'd like to have a function similar to the 'quick build' feature in kile. 
That is :

1) Save the file (one file or all the files related to a master file)
2) [In pdfmode] Do pdflatex on the file (or on the master file) then if 
no error detected launch evince to see the resulting pdf file.
   OR
   [In dvimode] Do latex on the file (or on the master file) then if no 
error detected do dvips then do ps2pdf then launch evince to see the 
resulting pdf file.
3) If errors are detected, open a buffer to see the output

These steps would be done without prompting the user.

I'm confident that it is doable in emacs but I have no knowledge of emacs 
lisp. So, if anyone could spend a few time in helping me, I would be very 
grateful.

Thanks a lot.

-- 
Christophe


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

* Re: A quick build 'function' for auctex
  2008-05-15 17:06 A quick build 'function' for auctex Christophe Jorssen
@ 2008-05-15 18:37 ` harven
  2008-05-18 17:43   ` Christophe Jorssen
  0 siblings, 1 reply; 4+ messages in thread
From: harven @ 2008-05-15 18:37 UTC (permalink / raw
  To: help-gnu-emacs

On May 15, 7:06 pm, Christophe Jorssen
<christophe.jors...@libre.fr.invalid>

The following should prevent emacs from querying for a save
before compilation:
(setq TeX-save-query nil)

I don't know what is evince. Anyway, for modern versions of
auctex (11.85), the viewers used
for preview are contained in the list TeX-output-view-style.
Probably evince is not supported by default, xpdf is the default on
my box. Here is how to add a new entry to the list. Put the following
in your init-file.

(add-hook 'TeX-mode-hook (lambda ()
      (add-to-list 'TeX-output-view-style
          '("^.pdf$" "." "put-here-the-viewer-command arg"))))

Your viewer command take a few arguments (e.g. the placeholder for the
name of the file).  These must
be added using the format specifiers. You may want to try
%s or %d for the value of arg, depending on your viewer.
These arg are explained in the documentation of the TeX-expand-list
variable. You can see this doc by typing while in
tex-mode      C-h v TeX-expand-list.

Also, the following should prevent emacs from asking for the
viewer to use.

(add-hook 'TeX-mode-hook (lambda ()
           (add-to-list 'TeX-command-list
                '("View" "%V" TeX-run-discard nil t))))


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

* Re: A quick build 'function' for auctex
  2008-05-15 18:37 ` harven
@ 2008-05-18 17:43   ` Christophe Jorssen
  2008-05-18 21:50     ` harven
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Jorssen @ 2008-05-18 17:43 UTC (permalink / raw
  To: help-gnu-emacs

Thanks harven for your reply.

Le Thu, 15 May 2008 11:37:01 -0700, harven a écrit/wrote :

> On May 15, 7:06 pm, Christophe Jorssen
> <christophe.jors...@libre.fr.invalid>
> 
> The following should prevent emacs from querying for a save before
> compilation:
> (setq TeX-save-query nil)

ok. So I assume that a C-c C-c runs a test on the value of TeX-save-query?

> 
> I don't know what is evince. Anyway, for modern versions of auctex
> (11.85), the viewers used
> for preview are contained in the list TeX-output-view-style. Probably
> evince is not supported by default, xpdf is the default on my box. Here
> is how to add a new entry to the list. Put the following in your
> init-file.

evince is the default 'universal' viewver in ubuntu.
 
> (add-hook 'TeX-mode-hook (lambda ()
>       (add-to-list 'TeX-output-view-style
>           '("^.pdf$" "." "put-here-the-viewer-command arg"))))

One question: frequently I find lambda() in .emacs customization. What 
does it mean? 

> Your viewer command take a few arguments (e.g. the placeholder for the
> name of the file).  These must
> be added using the format specifiers. You may want to try %s or %d for
> the value of arg, depending on your viewer. These arg are explained in
> the documentation of the TeX-expand-list variable. You can see this doc
> by typing while in tex-mode      C-h v TeX-expand-list.

Thanks for this tip.

> Also, the following should prevent emacs from asking for the viewer to
> use.
> 
> (add-hook 'TeX-mode-hook (lambda ()
>            (add-to-list 'TeX-command-list
>                 '("View" "%V" TeX-run-discard nil t))))

ok. By the way, is there a pdf version where all the descriptions (given 
by C-h v) variables defined by auctex are available ?

Thanks again

-- 
Christophe


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

* Re: A quick build 'function' for auctex
  2008-05-18 17:43   ` Christophe Jorssen
@ 2008-05-18 21:50     ` harven
  0 siblings, 0 replies; 4+ messages in thread
From: harven @ 2008-05-18 21:50 UTC (permalink / raw
  To: help-gnu-emacs


> ok. So I assume that a C-c C-c runs a test on the value of TeX-save-query?

yes.

> One question: frequently I find lambda() in .emacs customization. What
> does it mean?

This is the way to define an anonymous function.
(lambda () (instruction-1)(instruction-2)...)
is just a function with no name which executes
instructions when called. The following could have been used instead:

(defun my-function ()
       (add-to-list 'TeX-output-view-style
           '("^.pdf$" "." "put-here-the-viewer-command arg"))))

(add-hook 'TeX-mode-hook 'my-function)

> > Your viewer command take a few arguments (e.g. the placeholder for the
> > name of the file).  These must
> > be added using the format specifiers. You may want to try %s or %d for
> > the value of arg, depending on your viewer. These arg are explained in
> > the documentation of the TeX-expand-list variable. You can see this doc
> > by typing while in tex-mode      C-h v TeX-expand-list.
>
> Thanks for this tip.
>
> > Also, the following should prevent emacs from asking for the viewer to
> > use.
>
> > (add-hook 'TeX-mode-hook (lambda ()
> >            (add-to-list 'TeX-command-list
> >                 '("View" "%V" TeX-run-discard nil t))))
>
> ok. By the way, is there a pdf version where all the descriptions (given
> by C-h v) variables defined by auctex are available ?

The auctex manual can be found at
http://www.gnu.org/software/auctex/manual/auctex.index.html


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

end of thread, other threads:[~2008-05-18 21:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 17:06 A quick build 'function' for auctex Christophe Jorssen
2008-05-15 18:37 ` harven
2008-05-18 17:43   ` Christophe Jorssen
2008-05-18 21:50     ` harven

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.