thomasjo / atom-latex

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

Build from non-root file #497

Closed ghost closed 6 years ago

ghost commented 6 years ago

I have a project in which my root file contains several imports (\input{certainfile.tex}. I am able to compile (using ctrl-alt-b) my project from my root file perfectly. The content of certainfile.tex is processed in a correct way. However, if I am working in this subfile and I compile, the compilation fails. I need to switch to the root file every time and compile the project there. Is there a way to overcome this problem?

thomasjo commented 6 years ago

Yes, this is supported with the magic comment feature, specifically % !TEX root = your-main-file.tex

Ref: https://github.com/thomasjo/atom-latex/wiki/Overridding-Build-Settings

falcondai commented 5 years ago

Thanks for the awesome package. I wonder if we can specify root in a known config file (maybe named .latex.yaml) instead of prepending the magic comment in every tex file (nice to see an updated preview as I save the current fragment)? Or is it a conscious design decision you made?