Hi Hongyi, > Hongyi Zhao wrote (Sun, Jul 11, 2021 at 01:50:41PM +0800): >> But, how to let auctex do this trivial job for me automatically?
I recommend you to consult the relevant manual: https://www.gnu.org/software/auctex/manual/auctex/Multifile.html ,---- | If you insert | the following in your init file ('init.el' or '.emacs'), AUCTeX will use | a more advanced algorithm. | | (setq-default TeX-master nil) ; Query for master file. | | In this case, AUCTeX will ask for the name of the master file | associated with the buffer. To avoid asking you again, AUCTeX will | automatically insert the name of the master file as a file variable `---- ,---- | -- Command: TeX-master-file-ask | ('C-c _') Query for the name of a master file and add the | respective File Variables (*note (emacs)File Variables::) to the | file for setting this variable permanently. | | AUCTeX will not ask for a master file when it encounters existing | files. This function shall give you the possibility to insert the | variable manually. `---- N.B. The web manual falls behind the recent revise of the document and contains obsolete sentence "If AUCTeX finds the line indicating the end of the header in a master file (TeX-header-end), it can figure out for itself that this is a master file.", which isn't true. >>>>> Mandar Mitra <[email protected]> writes: > When I open a new .tex file, I'm prompted for the master file. If I provide a > file name, it's automatically quoted. More precisely, that occurs when TeX-master is customized to nil, as described above. > I don't remember giving auctex any special instructions to achieve > this. That's TeX-master-file-ask, bound to C-c _ and available in menu item LaTeX->Multifile/Parsing ->Set Master File also. Regards, Ikumi Keita
