I have a standalone setup with the following file structure

├── A.tex
└── sections
    ├── B
    │   ├── Bimages
    │   │   └── cat.png
    │   └── B.tex
    └── C
        ├── Cimages
        └── C.tex

I have a main tex file called A and two subfiles B and C, such that the content of A is a title page then B and C concatenated. B has its own images directory, which is referenced in B.tex using \graphicspath{ {./Bimages/} } and C similarly has ./Cimages/. B and C compile separately perfectly well, however, when I compile A, I get LaTeX Warning: File Bimages/cat.png not found on input line 89.

Is this expected behaviour with standalone? Will it not account for relative file paths in subdirectories? If so, is there a way to work around this such that I can organise my images into separate folders(preferably without having to do \graphicspath{ {./sections/B/Bimages} {./sections/C/Cimages} } in A.tex, as I may have many more similar directories in the future.

1 Answer 1


you might want to change the way you import your subfiles

\input just copies the text content of B.tex into A.tex before compiling.
That makes A look for the graphicspath in it's home directory (which is /A/)

\include (I think) creates aux files for every sub-file and therefore might be able to find the correct subpath (for example /A/B/Bimages/)


see this for reference

If that does not do the trick, then you could maybe switch to using global paths for your images
(like "~/foo/bar/A/B/Bimages/" instead of "./B/Bimages/").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.