Closed N9199 closed 3 years ago
Could you be a bit more specific about what's going wrong? The example below compiles. What are you doing differently?
Make sure that you are using a recent version of subfiles
; it should be v2.0
.
% main.tex
\documentclass{article}
\usepackage{subfiles}
\begin{document}
This is main.
\subfile{part1/part1}
\end{document}
% part1/part1.tex
\documentclass[../main]{subfiles}
\begin{document}
This is part 1.
\subfile{part1section1}
\end{document}
% part1/part1section1.tex
\documentclass[../main]{subfiles}
\begin{document}
This is part 1, section 1.
\end{document}
Try subfiles
without any hacks. graphicspath
should be handled automatically and correctly (at least in v2.0, but probably also before).
Ohh, I think I got what was wrong, I had \documentclass[part1]{subfiles}
on part1section1.tex, I thought that because it's technically a subfile of part1.tex, then it had to reference part1.tex as its "parent", that clears a lot. Thanks
Hello, I have a project with a structure similar to the follwing
Where
part1section1.tex
is a subfile ofpart1.tex
, which is a subfile ofmain.tex
. Now, this doesn't compile and I think it's because the input paths are not correct when parsing everything. But I've had a similar problem before with graphics path, which I solved by redefining the subfile command the following way:This made it so I could use relative paths and the graphic paths automatically corrected itself. So, is there a way to do something similar in this case? (I'm asking here, cause my Google-Fu failed me, and because I'm still trying to get how the programmatic part of LaTeX works)