Let’s assume a project with a main file main.tex
including the chapter with \include
.
% main.tex
\documentclass{book}
\includeonly{one}
\begin{document}
\include{one}
\include{two}
\end{document}
% one.tex
\chapter{First chapter}
Some text
% two.tex
\chapter{Second chapter}
Some text
To keep the diretory clean the chapters should be saved in a folder named chapters/
. Doing this means also to add the folder to each \include
macro and to \includeonly
too.
\documentclass{book}
\includeonly{chapters/one}
\begin{document}
\include{chapters/one}
\include{chapters/two}
\end{document}
So I wonder if it is possible to change the default path used with \include(only)
?
Best Answer
It seems to be possible to hack the definition of
\include(only)
. It seems to work but I’m not sure about the consequences …I thought about make this a little package providing a macro
\includepath{<dir>}
to add the directory automatically. Would this work without any harms?