My question is similar to this one, but I have a problem with relative paths when including files.
Assume I have three projects which all start with
\documentclass[12pt,a4paper]{article}
\usepackage[]{}
...
\usepackage[]{}
\begin{document}
...
\input{parts/chapter1}
...
\includegraphics{graphics/figure1.eps}
...
\end{document}
All these projects include own relative paths to other resources, e.g. graphics and chapters.
My goal is to build a new file that will contain all three including everything between \begin{document}
and \end{document}
, such that I can work on my three small projects and easily compile them into my PhD Thesis.
I could get it working with package catchfilebetweentags, but with full paths only. I also found another package import that helps to recognize relative paths. But I do not know how to combine these two packages. Can one help?
A simple example:
main.tex
\documentclass[12pt,a4paper]{article}
\usepackage{import}
\begin{document}
1.Hello World
\subimport{test/}{inputFile.tex}
\end{document}
test/inputFile.tex
\documentclass[12pt,a4paper]{article}
\begin{document}
2.Hello World\\
\input{inputFile2.tex}
\end{document}
test/inputFile2.tex
3.Hello World
It would work if I commented \documentclass[12pt,a4paper]{article}
, \begin{document}
, \end{document}
in inputFile.tex. But then I cannot compile inputFile.tex independently.
input
after thebegin{document}
command to load the subprojects. These files should then only contain the text (and markup needed for it). You can still compile only one subproject by commenting out the other project files.