3

I'm basically want to ask the question that was asked in Tex Stackexchange but was considered off-topic there (this is the link to the question).

When I am trying to compile (using the command C-c C-c or C-c C-a) a latex document which already has the needed local variables to point to the master-file like lines below at the end:

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

or if the master-file is another file:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "fileNameOfMasterFile"
%%% End:

it does not compile and instead, just shows the following messageMaster file already set in the mini buffer.

If I simply delete the local variable %%% TeX-master: "fileNameOfMasterFile" or %%% TeX-master: t and try to compile again (using the command C-c C-c or C-c C-a) it asks for the master-file and compiles as usual. Further on, it works normally when I compile again. But if I simply close the buffer and (re-)open the file again I face the same issue.

Is it a natural behavior? If not, any idea why this happens and how I can solve it?

If needed, I have the following in my init file:

(setq-default TeX-master nil)

Add-on: I'm suspicious that this might be related to AUCTeX version. What I just explained in the question was tested on AUCTeXversion 12.2.0 and I tried with a similar setting (same init file but an older emacs) with an older version AUCTeX (12.1.2)(on a different machine) and it works as it is expected.

2
  • 1
    Do you also have (setq TeX-parse-self t) in your init file? Jan 6, 2020 at 16:27
  • 1
    also tried that one. The same behaviour :( Jan 6, 2020 at 23:00

1 Answer 1

0

Change to (setq-default TeX-master t) and don't forget to omit the "tex" extension.

3
  • Thanks for the suggestion. I tried but didn't work :( It causes a different problem it didn't recognize the master file and compile it as it's a file on its own (error like missing \begin{doc... ). If delete the local variable line (similar to what I explained aboce), then it works. Jan 5, 2020 at 22:08
  • 1
    I'm suspicious that this is related to AUCTeX version. What I just explained in the question was tested on version 12.2.0 and I tried with almost the same settings in an older version (12.1.2)(on a different machine) and it works as it is expected. Jan 5, 2020 at 22:12
  • 1
    I have to admit I've had lots of problems with the auctex package in the past. I now run auctex from the git version with no issues. I would recommend you give it a try: "git clone git://git.savannah.gnu.org/auctex.git".
    – user16762
    Jan 6, 2020 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.