unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Auctex&Beamer recognising pdftex mode automatically
@ 2007-05-10 22:14 Brendan Halpin
  2007-05-10 23:18 ` Lars Madsen
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Brendan Halpin @ 2007-05-10 22:14 UTC (permalink / raw)
  To: help-gnu-emacs

I've been looking for a way to get Emacs/AucTeX to recognise that a
paticular latex file should be processed by pdflatex, and was
delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
or \documentclass[pdftex]{...} was enough. 

But it doesn't seem to work for Beamer files, i.e.
\documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
this an oddity of beamer.cls?

A pity if so because it's a nice neat feature.

Brendan
-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-10 22:14 Auctex&Beamer recognising pdftex mode automatically Brendan Halpin
@ 2007-05-10 23:18 ` Lars Madsen
  2007-05-10 23:48 ` Amy Templeton
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Lars Madsen @ 2007-05-10 23:18 UTC (permalink / raw)
  To: help-gnu-emacs

Brendan Halpin wrote:
> I've been looking for a way to get Emacs/AucTeX to recognise that a
> paticular latex file should be processed by pdflatex, and was
> delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
> or \documentclass[pdftex]{...} was enough. 
> 
> But it doesn't seem to work for Beamer files, i.e.
> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
> this an oddity of beamer.cls?
> 
> A pity if so because it's a nice neat feature.
> 
> Brendan

I have this at the bottom of the files that need pdflatex

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-PDF-mode: t
%%% End:




-- 

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/    (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-10 22:14 Auctex&Beamer recognising pdftex mode automatically Brendan Halpin
  2007-05-10 23:18 ` Lars Madsen
@ 2007-05-10 23:48 ` Amy Templeton
  2007-05-11  5:45 ` Ulrich M. Schwarz
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Amy Templeton @ 2007-05-10 23:48 UTC (permalink / raw)
  To: help-gnu-emacs

Brendan Halpin <brendan.halpin@ul.ie> wrote:
> I've been looking for a way to get Emacs/AucTeX to recognise that
> a paticular latex file should be processed by pdflatex, and was
> delighted to stumble on the fact that
> \usepackage[pdftex]{graphicx} or \documentclass[pdftex]{...} was
> enough.

> But it doesn't seem to work for Beamer files, i.e.
> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
> this an oddity of beamer.cls?

That's very odd...over here it definitely creates PDFs correctly if
you put the [pdftex] argument in the \documentclass command, and I
just made up a Beamer presentation the other day. However, it still
says "latex" is the default compiler when I hit C-c C-c...but the
output is definitely straight to PDF. Are you using any packages
that might conflict with this behavior?

Amy

-- 
Loneliness is a terrible price to pay for independence.

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-10 22:14 Auctex&Beamer recognising pdftex mode automatically Brendan Halpin
  2007-05-10 23:18 ` Lars Madsen
  2007-05-10 23:48 ` Amy Templeton
@ 2007-05-11  5:45 ` Ulrich M. Schwarz
  2007-05-11  6:00   ` Ralf Angeli
  2007-05-11  9:32 ` Peter Dyballa
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Ulrich M. Schwarz @ 2007-05-11  5:45 UTC (permalink / raw)
  To: help-gnu-emacs

Brendan Halpin <brendan.halpin@ul.ie> writes:

> I've been looking for a way to get Emacs/AucTeX to recognise that a
> paticular latex file should be processed by pdflatex, and was
> delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
> or \documentclass[pdftex]{...} was enough. 
>
> But it doesn't seem to work for Beamer files, i.e.
> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
> this an oddity of beamer.cls?
>
> A pity if so because it's a nice neat feature.

Putting %&pdflatex as the first line will¹ cause LaTeX to behave as if
you called pdflatex (even if you called latex).

HTH
 Ulrich

¹ this can be disabled; the key phrase to look for is "parse first
line". I believe it's enabled in recent TeXLives, don't know about the
rest. 
-- 
I've done a lot; God knows I've tried // To find the truth. I've even lied.
But all I know is down inside// I'm bleeding...
                                                         "Super Heroes"

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-11  5:45 ` Ulrich M. Schwarz
@ 2007-05-11  6:00   ` Ralf Angeli
  0 siblings, 0 replies; 11+ messages in thread
From: Ralf Angeli @ 2007-05-11  6:00 UTC (permalink / raw)
  To: help-gnu-emacs

* Ulrich M. Schwarz (2007-05-11) writes:

> Brendan Halpin <brendan.halpin@ul.ie> writes:
>
>> I've been looking for a way to get Emacs/AucTeX to recognise that a
>> paticular latex file should be processed by pdflatex, and was
>> delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
>> or \documentclass[pdftex]{...} was enough. 
>>
>> But it doesn't seem to work for Beamer files, i.e.
>> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
>> this an oddity of beamer.cls?
>>
>> A pity if so because it's a nice neat feature.
>
> Putting %&pdflatex as the first line will¹ cause LaTeX to behave as if
> you called pdflatex (even if you called latex).

But it won't lead to AUCTeX activating TeX PDF mode for the file.
Therefore the wrong viewers will be launched, for example.

-- 
Ralf

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-10 22:14 Auctex&Beamer recognising pdftex mode automatically Brendan Halpin
                   ` (2 preceding siblings ...)
  2007-05-11  5:45 ` Ulrich M. Schwarz
@ 2007-05-11  9:32 ` Peter Dyballa
       [not found] ` <mailman.506.1178841043.32220.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Peter Dyballa @ 2007-05-11  9:32 UTC (permalink / raw)
  To: brendan.halpin; +Cc: help-gnu-emacs


Am 11.05.2007 um 00:14 schrieb Brendan Halpin:

> I've been looking for a way to get Emacs/AucTeX to recognise that a
> paticular latex file should be processed by pdflatex, and was
> delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
> or \documentclass[pdftex]{...} was enough.
>
> But it doesn't seem to work for Beamer files, i.e.
> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
> this an oddity of beamer.cls?

In a modern TeX installation latex is a sym-link, for example to  
pdftex, which itself is actually pdfetex. So latex produces PDF  
directly.

You can make AUCTeX prefer pdfTeX by adding this customisation(s,  
enabling micro-typography for DVI output, too):

	 '(TeX-PDF-mode t)
	; '(TeX-DVI-via-PDFTeX t)

The third option is to add a file local variable:

	%%% TeX-command-default: "pdfelatex"

which needs to de defined as a TeX command in AUCTeX.


IMO it is not recommended to restrict TeX packages to some mode  
(pdftex, dvips, ...), except you use a package of which you exactly  
know that it is not able to determine whether (x)dvipdfm(x) or dvips  
or something else will process the DVI output. Not using such a  
restrictive options the LaTeX source is free to be compiled by any  
TeX version to PDF, DVI, or whatever. It can be useful to have a  
construct like this in the file's preamble:

	\usepackage{ifpdf}
	\ifpdf
	   \immediate\write16{\jobname: Bonjour, PDF !}
	   \usepackage{cmap}
	   \usepackage[pdftex]{graphicx}
	%   \DeclareGraphicsExtensions{.png,.gif,.tif,.jpeg}
	   \usepackage[activate={true,nocompatibility}]{microtype}
	\else		% for non-pdfTeX
	   \immediate\write16{¡Hola \jobname: DVI!}
	%   \DeclareGraphicsExtensions{.eps,.ps}
	   \usepackage[dvips]{graphicx}
	   \usepackage[protrusion=true,expansion=false]{microtype}
	\fi


--
Greetings

   Pete

The human brain operates at only 10% of its capacity. The rest is  
overhead for the operating system.

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

* Re: Auctex&Beamer recognising pdftex mode automatically
       [not found] ` <mailman.506.1178841043.32220.help-gnu-emacs@gnu.org>
@ 2007-05-11 15:35   ` Brendan Halpin
  0 siblings, 0 replies; 11+ messages in thread
From: Brendan Halpin @ 2007-05-11 15:35 UTC (permalink / raw)
  To: help-gnu-emacs

Amy Templeton <amy.g.templeton@gmail.com> writes:

> Brendan Halpin <brendan.halpin@ul.ie> wrote:
>> But it doesn't seem to work for Beamer files, i.e.
>> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
>> this an oddity of beamer.cls?
>
> That's very odd...over here it definitely creates PDFs correctly if
> you put the [pdftex] argument in the \documentclass command, and I
> just made up a Beamer presentation the other day. 

There is probably an oddity in my beamer setup because it objects
to \usepackage[pdftex]{graphicx} on the grounds that graphicx has
already been loaded with different options, presumably by
beamer.cls. 

Brendan

-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html

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

* Re: Auctex&Beamer recognising pdftex mode automatically
       [not found] ` <mailman.514.1178876409.32220.help-gnu-emacs@gnu.org>
@ 2007-05-11 18:08   ` Ralf Angeli
  0 siblings, 0 replies; 11+ messages in thread
From: Ralf Angeli @ 2007-05-11 18:08 UTC (permalink / raw)
  To: help-gnu-emacs

* Peter Dyballa (2007-05-11) writes:

> In a modern TeX installation latex is a sym-link, for example to  
> pdftex, which itself is actually pdfetex. So latex produces PDF  
> directly.

If you call `latex', it does not unless you fiddle with the input.

> You can make AUCTeX prefer pdfTeX by adding this customisation(s,  
> enabling micro-typography for DVI output, too):
>
> 	 '(TeX-PDF-mode t)

That activates PDF output.

> 	; '(TeX-DVI-via-PDFTeX t)

That's obviously of no use since it is commented.  It's additionally
useless if PDFTeX is the default engine.

> The third option is to add a file local variable:
>
> 	%%% TeX-command-default: "pdfelatex"
>
> which needs to de defined as a TeX command in AUCTeX.

The idea of TeX PDF mode is that `C-c C-c LaTeX RET' produces PDF
output without having to define a new command.  What you are
suggesting is unnecessary.

-- 
Ralf

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-10 22:14 Auctex&Beamer recognising pdftex mode automatically Brendan Halpin
                   ` (5 preceding siblings ...)
       [not found] ` <mailman.514.1178876409.32220.help-gnu-emacs@gnu.org>
@ 2007-05-12 21:10 ` Stephen Eglen
  2007-05-12 21:25   ` Ralf Angeli
  6 siblings, 1 reply; 11+ messages in thread
From: Stephen Eglen @ 2007-05-12 21:10 UTC (permalink / raw)
  To: help-gnu-emacs

Brendan Halpin <brendan.halpin@ul.ie> writes:

> I've been looking for a way to get Emacs/AucTeX to recognise that a
> paticular latex file should be processed by pdflatex, and was
> delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
> or \documentclass[pdftex]{...} was enough. 
>
> But it doesn't seem to work for Beamer files, i.e.
> \documentclass[pdftex]{beamer} still gets put in LaTeX-mode. Is
> this an oddity of beamer.cls?

I previously asked a similar question.  Try the following in .emacs


(eval-after-load "tex"
  '(TeX-add-style-hook "beamer" 'my-beamer-mode))

(defun my-beamer-mode ()
  "My adds on for when in beamer."

  ;; when in a Beamer file I want to use pdflatex.
  ;; Thanks to Ralf Angeli for this.
  (TeX-PDF-mode 1)			;turn on PDF mode.
)

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-12 21:10 ` Stephen Eglen
@ 2007-05-12 21:25   ` Ralf Angeli
  2007-05-13 12:58     ` Michele Dondi
  0 siblings, 1 reply; 11+ messages in thread
From: Ralf Angeli @ 2007-05-12 21:25 UTC (permalink / raw)
  To: help-gnu-emacs

* Stephen Eglen (2007-05-12) writes:

> Brendan Halpin <brendan.halpin@ul.ie> writes:
>
>> I've been looking for a way to get Emacs/AucTeX to recognise that a
>> paticular latex file should be processed by pdflatex, and was
>> delighted to stumble on the fact that \usepackage[pdftex]{graphicx}
>> or \documentclass[pdftex]{...} was enough. 
>
> I previously asked a similar question.  Try the following in .emacs

Please don't.  The code has negative side effects.  See
<URL:http://thread.gmane.org/loom.20051107T174444-65%40post.gmane.org> and
<URL:http://thread.gmane.org/m2slhuht2y.fsf%40sl392.st-edmunds.cam.ac.uk>.

Followup-To: gnu.emacs.help

-- 
Ralf

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

* Re: Auctex&Beamer recognising pdftex mode automatically
  2007-05-12 21:25   ` Ralf Angeli
@ 2007-05-13 12:58     ` Michele Dondi
  0 siblings, 0 replies; 11+ messages in thread
From: Michele Dondi @ 2007-05-13 12:58 UTC (permalink / raw)
  To: help-gnu-emacs

On Sat, 12 May 2007 23:25:37 +0200, Ralf Angeli
<dev.null@caeruleus.net> wrote:

>Followup-To: gnu.emacs.help

Please report here, after you've solved your problem.


Michele
-- 
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth.  See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel in sci.math, thread "Why numbers?"

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

end of thread, other threads:[~2007-05-13 12:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10 22:14 Auctex&Beamer recognising pdftex mode automatically Brendan Halpin
2007-05-10 23:18 ` Lars Madsen
2007-05-10 23:48 ` Amy Templeton
2007-05-11  5:45 ` Ulrich M. Schwarz
2007-05-11  6:00   ` Ralf Angeli
2007-05-11  9:32 ` Peter Dyballa
     [not found] ` <mailman.506.1178841043.32220.help-gnu-emacs@gnu.org>
2007-05-11 15:35   ` Brendan Halpin
     [not found] ` <mailman.514.1178876409.32220.help-gnu-emacs@gnu.org>
2007-05-11 18:08   ` Ralf Angeli
2007-05-12 21:10 ` Stephen Eglen
2007-05-12 21:25   ` Ralf Angeli
2007-05-13 12:58     ` Michele Dondi

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