auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Parsing first line


From: Tassilo Horn
Subject: Re: [AUCTeX] Parsing first line
Date: Tue, 17 Feb 2015 09:31:17 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Alistair Windsor <address@hidden> writes:

Hi Alistair,

> I would like to use the first line of my tex file to specify an
> alternative destination for the output file using %&
> -output-directory.  This works fine when I do pdflatex myfile.tex but
> when I execute latex from with auc-tex I get pdflatex
> "\input{myfile.tex}}" which thus bypasses the pre-compiler.  Is there
> a way to alter this behavior?

The \input master-file.tex is the result of expanding the %` format
specifier in of the LaTeX entry in `TeX-command-list'.  You can use the
%' specifier instead which expands to just the master file by placing
something like this in your ~/.emacs.

--8<---------------cut here---------------start------------->8---
(with-eval-after-load 'tex
  (add-to-list 'TeX-command-list
               '("LaTeX" "%'%l%(mode)%' %t" TeX-run-TeX nil
                 (latex-mode doctex-mode)
                 :help "Run LaTeX")))
--8<---------------cut here---------------end--------------->8---

I'm not exactly sure why the default is to compile a document with

  latex <options> "\input yourfile.tex"

instead of just

  latex <options> yourfile.tex

when using latex/pdflatex but I guess there's a reason, so that
suggestion might have some caveat I'm not aware of.

Bye,
Tassilo




reply via email to

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