I am following this tutorial (section subfiles) on how to use the package subfiles for a large latex document. I am using this package because I want to be able to compile each chapter separately. I keep my chapters in ./tex/ but main.tex is located in the root directory.
When I compile main.tex, I get no error but when I try to compile a chapter I get an error because the file ./mystyle.sty can't be found. If I go to main.tex and change the line \usepackage{./mystyle} to \usepackage{../mystyle}, I can compile the chapters now but I can't compile main.tex. I could solve this by providing the full path of to mystyle.sty but then it won't work with other computers. I would rather not the standalone package because I would like to use the command \chapter.
I have read the six year old post about the same issue but I was wondering if in the meantime subfiles package was modified to solve this or if there is a way to use \chapter in the standalone package.
subfiles
\usepackage
should take a name not a filepath,\usepackage{./mystyle}
should be\usepackage{mystyle}
/chapter
withstandalone
? If I compile\documentclass{standalone} \begin{document} \chapter{Test} Test \end{document}
I get undefined control sequence error.