6

When I compile a file using Emacs AucTeX with C-c C-c (which runs TeX-command-master which runs TeX-run-TeX) the top line of the log output looks like this:

Running `LaTeX' on `mwe' with ``pdflatex  -interaction=nonstopmode "\input" mwe.tex''

(This is the top line of the buffer when I do C-c C-l.

Why on earth is aucTeX doing "\input" mwe.tex rather than just mwe.tex? What can this possibly achieve apart from causing my %&custom fmt definition to get ignored?

And secondly, where do I stop it doing this? I've looked at how the various commands mentioned above are defined. None of them seem to specify this behaviour. So what is actually causing this invocation of pdflatex?

5
  • 2
    it may be related to the fact that when auctex began tex didn't have any command line arguments so you needed to do tex \nonstopmode\input mwe.tex to run a file in that mode. Aug 9, 2012 at 15:58
  • @DavidCarlisle I see. I didn't know that. That makes the behaviour make sense, I guess.
    – Seamus
    Aug 9, 2012 at 16:00
  • 3
    I'm putting this as a comment and not an answer, since I don't have enough time now to write more, but look at the variables TeX-command-list and TeX-expand-list. (I was also dissatisfied with this default behavior and customized TeX-command-list to change it.)
    – mbork
    Aug 9, 2012 at 16:00
  • 3
    @mbork Aha! TeX-expand-list includes %' which expands to some complicated stuff that includes the dreaded \input. That's a pretty impressive way to obfuscate your option setting. Deleting %' from the right part of TeX-command-list seems to have done the trick.
    – Seamus
    Aug 9, 2012 at 16:06
  • @Seamus If you are still interested in the "Why on earth is aucTeX doing "\input" mwe.tex rather than just mwe.tex?" question, David Kastrup gave here an answer, more or less.
    – giordano
    Feb 18, 2014 at 23:02

1 Answer 1

4

Thanks to mbork I found the answer. In TeX-command-list you get some pretty mystifying code soup:

%`%l%(mode)%' %t

Err. OK. The trick is that these things are defined in TeX-expand-list. One of these things, namely %' expands to a bunch of other stuff I don't understand but includes the \input that I wanted to get rid of. So deleting %' from the LaTeX part of TeX-command-list seems to fix things. I can't promise this is robust or that it won't cause problems somewhere down the line. If David Carlise is right that this \input is a throwback to before the latex command had command line options.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .