thomasjo / atom-latex

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

Feature Request: Only build on save for compilable .tex files #362

Closed arewm closed 7 years ago

arewm commented 7 years ago

This is an extension of #342, but I figured that it is probably better to have its own issue.

I often make LaTeX documents by separating section into their own .tex files. If I enable build on save, it fails when saving these files because they are not a fully defined files. Would it be possible to have some directive (i.e. in a comment) that I can put into the top of a linked file to point to the main document that should be compiled upon save?

yitzchak commented 7 years ago

This is accomplished by using TeX magic comments. At the top of your sub-document insert the line (where master.tex is the name of your rool document)

%!TeX root = master.tex
arewm commented 7 years ago

Thanks, I missed that. Works like a charm!

yitzchak commented 7 years ago

Awesome! Glad you got it sorted.