[Top][All Lists]

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

Re: [AUCTeX] Parsing first line

From: Mosè Giordano
Subject: Re: [AUCTeX] Parsing first line
Date: Fri, 20 Feb 2015 09:31:50 +0100

Hi Tassilo,

2015-02-17 9:31 GMT+01:00 Tassilo Horn <address@hidden>:
> 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.

David explained why AUCTeX compiles with "\input file.tex" here:

Last year I tried to work on implementing a local variable to specify
the output directory, and so indirectly fix Alistair's problem, but
I've never finished it.  (One of) The main problem was how to share
such variable across multiple files of the same document (store it in
the auto file?), but there is the same problem for other variables
like `TeX-engine'.


reply via email to

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