I am writing a long document with two other people using Dropbox as the file storage mechanism. I want to have each person be able to work on their piece individually. Therefore I want to be able to compile each document seperately, as well as compile the main document. The subfiles package seemed perfect for this.
I tried following the example for modular documents on Wikibooks, but it is not working for me. The top level document will build, but the lower level ones will have file not found errors.
Here is my setup:
- Images folder
- tex folder
- main.tex
- styles.sty
Inside main.tex:
\documentclass[11pt,letterpaper]{article}
\usepackage{styling} %includes \usepackage{subfiles}
\begin{document}
\maketitle
\tableofcontents
\subfile{./tex/subpiece1}
\end{document}
Inside subpiece1 in tex folder:
\documentclass[../main.tex]{subfiles}
\graphicspath{ {Images/subpiece1/} }
\begin{document}
\section{sectiontitle}
%Images and text
\end{document}
The error when building the subfile seperately: ../main.tex:4: LaTeX Error: File `styling.sty' not found. [^^M]
subfilespackage, with which I also get an error if I place sub-files in separate directories. – Andriy Drozdyuk Dec 24 '15 at 00:19subfilespackacke or class). Besides this, I suspect that your error will be different of the above. That was due to a non standard package in the local../but the subfile will search for packages it in the path (=error) and the local directory, that now will be../tex(=error). This is solved in the MWE f the question simply using the original\usepackage{subfiles}instead of\usepackage{styling}. – Fran Dec 24 '15 at 11:56subfilespackage, which in turn fails on sub-directory paths. – Andriy Drozdyuk Dec 24 '15 at 16:26subfiles.styis included instyling.styor not. Compilingsubpiece1.tex, it is *the document class*subfilesclass which work first and take the preamble of the main file. Here\usepackage{styling}search forstyling.styat the local directory (that now is the subfolder), but is not here, then in the path, but is not here = error. However, using\usepackage{subfiles.sty}directly in the main file will work because it should be accessible to any document in any folder (in a distribution well installed). – Fran Dec 24 '15 at 19:03importpackage: https://www.sharelatex.com/learn/Management_in_a_large_project – Andriy Drozdyuk Dec 25 '15 at 02:03