I have a big LaTeX project divided in many files; the \documentclass statement and the preamble are in the main file, that in turn includes many (~20) other files, one for every chapter. One of the statements in the main file is \usepackage{paralist}, in order to use the environment compactdesc.
Visiting the main file, in the AucTeX LaTeX -> Insert Environment menu, compactdesc is listed; and M-Enter inside the environment inserts an \item and asks for the label of that item.
Visiting one of the included file, the lack of a \usepackage causes no inclusion of the compactdesc environment in the LaTeX -> Insert Environment menu list; and I don't like that.
Giving the command M-x LaTeX-environment followed by compactdesc, inserts in the file a \begin{compactdesc}-\end{compactdesc} couple, but M-Enter does not ask for the item label - and I would like to be able to enter the labels for every \item added.
I have tried with the local variables at the end of the file, inserting the lines
% Local Variables:
% mode: latex
% TeX-master: master.tex
% ispell-local-dictionary: "italian"
% End:
(where master is the main TeX file); but still LaTeX -> Insert Environment does not know about compactdesc.
How can I do, to have both 1) the environment compactdesc available and 2) AucTeX knowing about items of that environment having a label?
Thank you in advance for any help.
TeX-master-filemust be a string, this is exactly the same problem as the one reported here: http://emacs.stackexchange.com/q/20007/620 A good practice is to add this line to the init file:(setq-default TeX-master nil)– giordano Feb 10 '16 at 12:05TeX-master-file). – giordano Feb 10 '16 at 12:15;-)– giordano Feb 10 '16 at 12:18TeX-masterin the manual, not ofTeX-master-file; I tried with both version, with the same result. – Maurizio Loreti Feb 10 '16 at 13:44TeX-master. After you apply the change, you have to revert the buffer, useC-c C-nfor that – giordano Feb 10 '16 at 14:06(setq-default TeX-master nil),(setq TeX-parse-self t)and(setq TeX-auto-save t). If it matters, I have AucTeX 11.88, emacs 24.5 (macports), OS X 10.11.3 . – Maurizio Loreti Feb 10 '16 at 14:16;-)The best way yo set the master file is usingC-c _, which is run by default on a new *TeX file whenTeX-masterdefaults to nil. From now on, you'll be asked for the master file every time you create a new file and you won't for sure make mistakes – giordano Feb 10 '16 at 14:25C-c C-nin your master file, and then restart Emacs. – giordano Feb 10 '16 at 14:54