auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Question involving TeX-source-correlate-method


From: Nikolaus Vonessen
Subject: Re: [AUCTeX] Question involving TeX-source-correlate-method
Date: Mon, 24 Feb 2014 16:55:17 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hi Tassilo:

On 2/24/2014 12:48 AM, Tassilo Horn wrote:
Nikolaus Vonessen <address@hidden> writes:

Hi Nikolaus,

I used to use latex to generate dvi files, but am now switching to
pdflatex.  Often, I create new files based on older ones.  Some older
latex files, in particular ones involving graphics, do not compile
correctly using pdflatex.  Therefore, it would be very useful to be
able to switch, on a per-buffer-basis, between compiling between
ordinary latex and pdflatex, and in both cases using the appropriate
TeX-source-correlate-method (source-specials for dvi, synctex for
pdf).  The problem is that, according to the documentation of
TeX-source-correlate-method:

     Setting this variable does not take effect if TeX Source
     Correlate mode has already been active.  Restart Emacs in this
     case.

Restarting emacs is rather drastic if one wants to work with two files
at the same time.

Is there a way to get around this?
I did some experimentation, and it seems you can work around this
limitation when you set the active correlate method using a file local
variable in the documents that need it.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-PDF-mode: nil
%%% TeX-source-correlate-method-active: source-specials
%%% End:

This works great!  Thanks, Tassilo!

Since I prefer not to change old files by appending file local variables, I incorporated
your suggestion into a function which I define in my .emacs, and which I can run in a
buffer as needed:
(defun my-switch-to-dvi ()
  "Makes LaTeX create dvi documents with source-specials"
  (interactive)
  (setq TeX-PDF-mode nil)
  (set (make-local-variable 'TeX-source-correlate-method-active)
       'source-specials))
Thanks again!

Nikolaus







reply via email to

[Prev in Thread] Current Thread [Next in Thread]