thomasjo / atom-latex

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

How to use for modular projects #466

Closed AntoinePrv closed 6 years ago

AntoinePrv commented 6 years ago

Hello,

Thank you for this great package! I am making a modular Latex project with the structure:

/main.tex
/mystyle.sty
/tex
  └  chapter1.tex
  └  chapter2.tex
/img
  └  myimage.png

Chapters and the main.tex are linked using the subfiles Latex package that let me compile chapters one at a time.

Now when I build chapter1.tex from within Atom, this doesn't work because the build is done from within the tex folder (or so it seems). All the path linking to images or \usepackage{mystyle} fail, even if they are used in the main.tex.

Using a terminal, the compilation works fine if I compile from the root folder (e.g. pdflatex tex/chapter1.tex). Hence: How can I define the "execution folder" to be the root folder of the project opened in Atom?

I tried to play with the % !TEX magic but couldn't figure it out.

Thanks for the help.

stale[bot] commented 6 years ago

This issue has been marked as stale because due to inactivity. It will be closed in 7 days if no further activity occurs.

thomasjo commented 6 years ago

@AntoinePrv Sorry about not responding to this earlier. Unless you've already figured it out, you should be able to accomplish what you desire by adding the following to the top of chapterX.tex files

% !TEX root = ../main.tex