Following the Project Structure Wiki and Subfiles Wiki, I've built the following project structure:
./mydocument.tex
./mystyle.sty
./tex/mysubfile.tex
./img/
mydocument.tex
looks like:
\documentclass{report}
\usepackage{mystyle}
\begin{document}
\subfile{./tex/mysubfile.tex}
\end{document}
mystyle.sty
looks like:
\ProvidesPackage{mystyle}
\usepackage{subfiles}
% other packages
% command declarations
mysubfile.tex
looks like:
\documentclass[../mydocument.tex]{subfiles}
\begin{document}
% stuff goes here.
\end{document}
I'm using (1) the subfiles
package because I'd like to compile mysubfile.tex
by itself and (2) mystyle.sty
because I'd like to modularize this project a bit and split package and command declarations into their own .sty
file. The problem is that when I try and compile mysubfile.tex
by itself it can't "see" mystyle.sty
.
Q: Is there some way I can still satisfy (1), (2), and the project structure outlined above and get things working? Some sort of option or command in the subfiles
package?
I've tried: (1) moving mystyle.sty
to different directories, (2) moving the subfiles
declaration \usepackage{subfiles}
to different parts of the document, (3) checking the subfiles
documentation. All no dice.
I suppose that the second best option would be to stick all project files in the same folder and get rid of my .\tex
folder. At least then, I can get things to compile. But I'd rather not sacrifice the project structure.