auctex-devel
[Top][All Lists]
Advanced

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

Re: Output filenames and the inconsistency of the `file` variable


From: Al Haji-Ali
Subject: Re: Output filenames and the inconsistency of the `file` variable
Date: Thu, 27 Aug 2020 09:24:07 +0100
User-agent: mu4e 1.5.5; emacs 27.1

Hi Ikumi,

> On the other hand, I don't understand the intention of this proposal. In
> both cases, the variable `name' is properly defined as a function
> argument of TeX-save-document and TeX-command-default, respectively. So
> I don't see point in using TeX-active-master here. Am I missing
> something?
>
Sorry, I should have explained more.
For the past 3 months, I have been using the `--output-directory` option of tex 
compilation engines (like pdflatex) to save all output and temporary files in 
an "auctex/build" sub-directory next to my tex files.
I found this arrangement to be very convenient. For version control, I simply 
gitignore the "auctex" directory (which also includes the temporary `el` files 
in my setup) instead of having to ignore extensions like pdf. Also, having 
multiple (independent) tex files in the same directory did not clutter my 
source files with temporary ones.

The way I implemented this is by:
1. Passing the `--output-directory` option to pdflatex through 
"TeX-command-extra-options"
2. Advising TeX-master-file to return a path in the output directory instead of 
the current directory whenever an output extension (or those in 
`*-clean-*-suffixes`) is passed as an argument.
3. This is not relevant to AUCTeX, but I also implemented two functions that 
can be executed in a tex file: one to copy the output file from the build 
directory to another one and another function to attach the pdf (from the build 
directory) in an email.

This worked surprisingly well! However, because AUCTeX has these lines of code 
where the path is constructed using a string concatenation rather than calling 
`TeX-active-master`, this meant that I had to patch some functions to ensure 
everything worked as intended (including viewing the pdf and tex-syncing it).

I plan to propose the whole setup as a contribution to AUCTeX, but I wanted to 
first make sure of the least disruptive way to add this functionality natively. 
The required modification of TeX-master-file is not disruptive, since it can be 
controlled with a flag. So the only potentially disruptive changes are the ones 
I outlined in my previous email.

>> Also, if these changes are acceptable, should I create a pull request
>> with them on the gitlab AUCTeX repository? Or is posting the diffs
>> here sufficient?
> The latter. I don't know gitlab AUCTeX repo, perhaps it is an unoffical
> mirror?
Ah probably. I will stick to diffs then.

Best regards,
-- Al



reply via email to

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