auctex
[Top][All Lists]
Advanced

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

Re: Auctex persistent problems not recognizing master file


From: Ikumi Keita
Subject: Re: Auctex persistent problems not recognizing master file
Date: Tue, 06 Apr 2021 03:09:41 +0900

[Cc: Al Haji-Ali]

Hi David,

>>>>> David Denton <dwsdenton@gmail.com> writes:
> Here is my set up:

> I have a file named main.tex in the top level of the folder which
> "includes" chapter files located in a /chapters sub-folder.

> I can compile from the main document but not from the included files.
> I am using latexmk to compile but the issue is the same with calling 
> pdflatex directly. When I try to compile from an included file, I get
> a bunch of errors, basically telling me that it did not find
> \begin{document.

> My individual chapter files identify the master as follows:

> %%% Local Variables:
> %%%mode: latex
> %%%TeX-master: "../main"
> %%% End:

> My master (main) file is identified in this manner:

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

> Currently, I am using Doom-Emacs (doom 2.09, with emacs 26.3). With my
> doom installation, my Auctex version is 13.0.5.2021-03-25.

> My config.el in doom includes:

> (setq TeX-auto-save t)
> (setq TeX-parse-self t)
> ;; (setq-default TeX-master nil) ; Query for master file.
> (setq-default TeX-master "main") ; All master files called "master"
> ;;(setq-default TeX-master "../main") ; All master files called "master"

Unfortunately, it doesn't reproduce for me. Here are what I tried:
1. Put the main file as /tmp/main.tex:
---- main.tex --------------------------------------------------------
\documentclass{article}
\begin{document}
main

\input{chapters/sub}
%\include{chapters/sub}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
----------------------------------------------------------------------
2. Make a subdirectory "chapters" and put a sub file as
/tmp/chapters/sub.tex:
---- sub.tex ---------------------------------------------------------
abc \(a^2+b^2=c^2\) def

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../main"
%%% End:
----------------------------------------------------------------------
3. Prepare minimal init file ~/.emacs.d/init.el:
---- init.el ---------------------------------------------------------
(load "auctex.el" nil t t)

(setq-default TeX-parse-self t)
(setq-default TeX-master "main")
(setq-default TeX-auto-save t)
(custom-set-variables
 '(TeX-view-program-selection
   '(((output-dvi has-no-display-manager)
      "dvi2tty")
     ((output-dvi style-pstricks)
      "dvips and gv")
     (output-dvi "xdvi")
     (output-pdf "Atril")
     (output-html "xdg-open"))))
----------------------------------------------------------------------
I don't use doom-emacs and ELPA-based AUCTeX, so I do configuration
manually as above. I use atril for pdf viewer, so "Atril" is specified
as `output-pdf' entry.
4. Launch a new emacs session with "emacs -q -l .emacs.d/init.el" in my
home directory.
5. Open sub file /tmp/chapters/sub.tex with C-x C-f, and type C-c C-c
several times.
RESULT: LaTeX ran smoothly and the viewer opens the generated pdf file
without problem, for both "\input" and "\include" in main.tex.

> But I have tried all combinations and it doesn't work. Is it possible
> that this is a new Auctex bug, or am I really doing something wrong
> here?

If you are using AUCTeX via ELPA, please try deleting and re-installing
it again. If that doesn't resolve your problem or you didn't install
AUCTeX from ELPA, could you give us sample set of documents which
doesn't work for you, preferably using "M-x TeX-submit-bug-report"?
Actually, AUCTeX went through a bigger update recently with respect to
the way to identify the master file, so it can be a real AUCTeX bug
which we overlooked.

Regards,
Ikumi Keita



reply via email to

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