Hello Ikumi, Thank you very much for testing and for the links below.
On 05/02/2021, Ikumi Keita wrote: > I noticed another problem. AUCTeX usually detects that the output file > (pdf or dvi) is ready to view when the user typed C-c C-c sufficient > times repeatedly. However, after your patch is applied, that feature no > longer works when TeX-output-dir is non-nil. How many times the user > types C-c C-c in a buffer without intermediate editing, AUCTeX always > suggests "LaTeX" as default command and never suggests "View" as > default. This makes C-c C-a useless. > Oh, I didn't notice this. It is likely related to the first set of issues I mentioned in tex-buf.el where the outputs extensions ("(TeX-output-extension)", ".ind", ".idx" and ".bbl") are appended to an argument `name` or similar to get a filename. When those outputs are in the build directory, the current code considers them missing and thinks the tex file needs to built again. As I said, these should be changed to use TeX-active-master or similar instead but this would require me changing the interfaces of existing functions (so that they don't accept a "name" argument and instead rely on TeX-active-master) which I am hesitant to do before I get confirmation that it would be OK or someone suggests a better alternative. > Generally speaking, it seems that this kind of task (=keeping the > document directory clean) should be taken care of by external tool > dedicated for that purpose. I came across blog posts discussing > this issue[1] and summarizing such tools[2]. (Note that these posts are > written in Japanese.) Actually I was made aware of subdiretory issue of > \include from the post[1]. The author of these posts claims that > "--output-directory" is too deficient and actually created one of the > tools mentioned above, ClutTeX[3]. Interesting articles! I auto-translated the articles and found an English description of the package here [1]. [1] https://anorien.csc.warwick.ac.uk/mirrors/CTAN/support/cluttex/doc/cluttex.pdf > Taking into the difficulties to make it compatible with preview-latex, > I'd recommend to consider that you don't aim for a comprehensive tool > but rather a tool with limited range of application, i.e., for users who > don't need preview-latex and \include+subdirectory. I completely agree with this. I think supporting \include and any external shell packages would be too difficult (though I don't think impossible) since the `--output-directory` implementation in tex seems incomplete; I think one of the reasons it is this way is because most people don't really mind the file-clutter. Regarding preview-latex, I don't think it would be as difficult to make it support TeX-output-dir, including generating the preview tex files in said directory. It will just take me (or others) time to figure out the preview code and make the necessary changes. This could be done at a later stage once the core functionality of TeX-output-dir is implemented correctly. Best regards, Al