minoki / cluttex

Process LaTeX documents without cluttering your working directory
GNU General Public License v3.0
45 stars 3 forks source link

Handle output_directory and change_directory properly #8

Closed atticus-sullivan closed 2 years ago

atticus-sullivan commented 2 years ago

If option change_directory is used output_directory should be relative to the new pwd (in current implementation that would be . always) or use absolute path. In addition if option change_directory is used flag -output-directory doesn't need to be set on the tex compilation command.

This implements this behaviour by setting options.output_directory to nil (so that -output-directory will not be set later) after generating the init lua script.

Addresses #7

I'm not quite sure about the options.output_directory handling. Maybe it would be nicer if tex_engine would respect the change_directory option to achieve a more consistent tex_options. On the other hand having a change_directory option for tex_engine just to avoid setting the -output-directory flag on the tex command isn't that nice either.

I hope these are all spots which were causing the change_directory trouble.

minoki commented 2 years ago

Merged. Thank you for the contribution!