I have a main document which calls several modules and also uses images from upper folders, this is the structure of the folders:

  • Icons
  • Common
    • Covers
  • Test
    • All
      • main.tex
    • Module
      • subfile.tex
      • Figures
        • figure.png

This is the code of the main:

\usepackage[a4paper,margin=3cm,bindingoffset=0.5cm,footskip=1.7cm]{geometry} %proper formatting for a4pages
\usepackage{graphicx} %allows the inclusion of graphics and resizing rotating etc.
\usepackage{fancyhdr} %allows use of complex headers and footers
\usepackage{subfiles} % allows inclusion of chapter files which can also be compiled stand-alone



\leftwatermark{\ThisCenterWallPaper{1.0}{bg-page-left.pdf}} %these are in folder covers

% table of contents has own roman numeral numbering

\fancyhead[LE,RO]{\leftmark} % put the chapter name in the right hand corner

\tableofcontents                    % table of contents




A small introduction 




And this is the code of the subfile:


\graphicspath{{\subfix{../../Icons/}}                %don't touch
             {\subfix{../Module/Figures/}}}    %change the name of the folder accordingly


\section{Name of the Section}

\subsection{Name of the Subsection}

Use the icon \includegraphics[width=13px,height=9px]{/toolboxes/printpreview/pagenext.png} to jump to next page. %this figure is in the Icons folder

This figure is in the Figures folder inside the module

    \includegraphics[angle= 0, width=0.8\textwidth]{figure.png}
    \caption{Just a cat picture}


It used to work with previous versions, but since I updated it does not work anymore. Can anybody help me?

  • Just one more clarification, I know that if I define the paths in the main and the subfile it works, but I would like to only define the figures path in the subfile, like before
    – fancy_docs
    Commented May 18, 2022 at 7:11

1 Answer 1


Between subfiles v1.x and subflies v2.x, there was a major change in the default behaviour. Load subfiles with the option v1 to get the old behaviour back.


In version v1.x, the \subfile command would processes also the preamble of the subfile as well as all the stuff after \end{document}, which for most users comes unexpected and has some peculiarities.

In version v2.x, the \subfile command includes only the stuff between \begin{document} and \end{document}. In your use case, the \graphicspath command in the preamble of the subfile will be ignored when loading the file with \subfile, and the figure will not be found. The package option v1 restores the old behaviour. For more information, see the documentation of the package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .