My main .tex document is located in a "Parent" folder. The "Parent" folder contains several "Chapter" folders: 0_Chapter, 1_Chapter, 2_Chapter, etc. Each "Chapter" folder contains a .tex document (chapter0.tex, chapter1.tex, chapter2.tex), as well as a figure folder (figures0, figures1, figures2, etc), which are included in the main.tex document upon compilation.
As an example, the path for the figures in Chapter 0 is indicated in the chapter0.tex file using \graphicspath{{0_Chapter/figures0/}}, and for Chapter 1, chapter1.tex contains the line \graphicspath{{1_Chapter/figures1/}}.
When I compile the main.tex file, the figures are nicely added to the document. So far, so good.
However, as soon as I do the same for the next Chapter, I get the error message image.png not found.
I tried as well to add a single figure path by adding \graphicspath{{0_Chapter/figures0/}{1_Chapter/figures1/}{2_Chapter/figures2/}} in the main.tex file, however, it only works when including figures from the first two figure directories, and gives an error message for the third one.
The only thing that allows calling the figures from the figures2 folder is by adding the directory directly in \includegraphics...:
\begin{figure}[H]
\includegraphics[width=1\textwidth]{2_Chapter/figures2/image.png}
\end{figure}
I really cannot figure out what the problem is... I tried several methods (some of the links below), but none of them worked... How to add graphics in LaTeX; How to use \graphicspath? ; Multiple graphics directory; \graphicspath and \include;
Does anyone know what the problem might be? Thanks a lot in advance!
EDIT: My files contain the following:
main.tex
\documentclass[a4paper,11pt,twoside]{report}
\usepackage{graphicx}
\graphicspath{{0_Chapter/figures0/}{figures0/}{1_Chapter/figures1/}{figures1/}{2_Chapter/figures2/}{figures2/}}
\begin{document}
\include{0_Chapter/chapter0.tex}
\include{1_Chapter/chapter1.tex}
\include{2_Chapter/chapter2.tex}
\end{document
chapter0.tex
\chapter{Chapter 0}
Text....
\begin{figure}[H]
\includegraphics[width=1\textwidth]{image0.png}
\end{figure}
chapter1.tex
\chapter{Chapter 1}
Text....
\begin{figure}[H]
\includegraphics[width=1\textwidth]{image1.png}
\end{figure}
chapter2.tex
\chapter{Chapter 2}
Text....
\begin{figure}[H]
\includegraphics[width=1\textwidth]{image2.png}
\end{figure}
Actually, everything works nicely, until I try to include figures in chapter2.tex... (text, sectioning, etc from chapter2.tex is included in the main document... only the figures can't be added)
main.texC1/figures1makes sense, but insideC1you needfigures1. Have you tried\graphicspath{{0_Chapter/figures0/}{figures0/}{1_Chapter/figures1/}{figures1/}{2_Chapter/figures2/}{figures2/}}? – daleif Jan 05 '17 at 13:45\includegraphics. It makes your document less portable. – Jan Jan 05 '17 at 14:32{figure1}etc. Where exactly isimage.png(the one you are saying LaTeX cannot find). Are you 100% sure you spelled that filename correctly? – daleif Jan 05 '17 at 14:49[H]option. Please make sure your data is 100% correct. And that you actually have files like this on disk. Again this works fine on my system. With the MWE you post here, can we see the.log, update your question with that information. – daleif Jan 05 '17 at 15:12.texextension in\includeit will break badly.\include{0_Chapter/chapter0}not\include{0_Chapter/chapter0.tex}– David Carlisle Jan 05 '17 at 15:20