thomasjo / atom-latex

Compile LaTeX or knitr documents from within Atom
https://atom.io/packages/latex
MIT License
223 stars 42 forks source link

Specifying which file to build in a project #536

Closed Axeln78 closed 4 years ago

Axeln78 commented 4 years ago

Hi,

Could there be a way to specify which file to built when doing build on save?

For instance in the case where there is a main.tex file that includes an other.tex file, saving the other.tex file would trigger a build (which failes).

I think there might be two options, either save the other.tex file and save and automatically save/build the main file to have an updated PDF. Or simply only building when the main file is saved.

thomasjo commented 4 years ago

Assuming that other.tex is a partial file that is included in main.tex, you want the act of saving other.tex to trigger a build of main.tex? If that is correct, this is already supported via magic comments.

Add the following comment to the top of other.tex:

% !TEX root = main.tex
Axeln78 commented 4 years ago

Thank you! This is absolutely what I was after. Kudos for the great implementation!