I would like to build a modular document in latex. My main directory (in which I put the main file "thesis.tex") is called "tesi". Inside "tesi" i have another directory named "capitoli" where I woluld like to store my chapters named "chapter1.tex","chapter2.tex", and so on. Also I woluld like to compile either from my main file or directly from my subfiles, and so I used the subfile package.
Also I'm using a style file named mystyle.sty placed in the main directory "tesi". There is also a directory called "immagini" (where i store my images) inside the main directory.
If I use the following code
% main file "thesis.tex" in the main directory "tesi" %
\documentclass[a4paper,12pt]{memoir}
\usepackage{./tesi/mystyle.sty}
\begin{document}
\subfile{../tesi/capitoli/chapter1.tex}
\end{document}
% subfile "chapter1.tex" in the subdirectory "capitoli" %
\documentclass[../thesis.tex]{subfiles}
\begin{document}
\begin{figure}
\centering
\includegraphics{../immagini/image1.jpg}
\end{figure}
\end{document}
I can compile from subfile "chapter1.tex" but can't compile from main file "thesis.tex" (error messages refers to the path of the image files)
If I use the following code ( just changed the relative/absolute paths of mystyle.sty and image1.jpg)
% main file "thesis.tex" in the main directory "tesi" %
\documentclass[a4paper,12pt]{memoir}
\usepackage{../tesi/mystyle.sty}
\begin{document}
\subfile{../tesi/capitoli/chapter1.tex}
\end{document}
% subfile "chapter1.tex" in the subdirectory "capitoli" %
\documentclass[../thesis.tex]{subfiles}
\begin{document}
\begin{figure}
\centering
\includegraphics{./immagini/image1.jpg}
\end{figure}
\end{document}
I can't compile from subfile "chapter1.tex" (error message cannot find mystyle.sty) but can compile from main file "thesis.tex".
Someone could fix this issue, thanks.
Edit
I also post mystyle.sty
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{subfiles}
\usepackage{graphicx}
texor atxtfile? – Clément Jul 03 '14 at 08:42mystyle.sty. Without this, it works perfectly. – LaRiFaRi Jul 03 '14 at 08:43