I am trying to set up a multi-file document where I use \input to add different .tex files to my main document. Each .tex file is in its own directory/folder. There is also a separate directory for figures. When I compile one of the .tex files (called 'Methods') which contains a figure, the image loads as expected.

However, when I add this file to the main document and compile, the image is missing and I get the following error message:

File `Testimage' not found. ...ludegraphics[width=1\textwidth]{Testimage}

Can I have some advice please?

I have included the following MWE:

Main document

% put all the other packages here:





% Bibliography:


My style package - contains all of the preamble from the various .tex files.

\usepackage{graphicx, epstopdf}
\usepackage{etoolbox}%This package combined with the \pathcmd rewrites the standard style for 'Chapter' to allow the fancy horizontal and vertical lines. 
\usepackage{booktabs,caption, makecell}
\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
\usepackage[section]{placeins}%Allows you to permanently fix figures. 
\usepackage{titleps}%fancy page borders? 
\usepackage[left=2.8cm, right=2.8cm, top=3.5cm, bottom=3.5cm]{geometry}

    \sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

}%This part creates the fancy top (horizontal) and bottom (verticle) lines that you see from the 'Abstrct' page onwards. 

Methods .tex file - contains the image.

Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
To make your document look professionally produced, Word provides header, footer, cover page, and text box designs that complement each other. For example, you can add a matching cover page, header, and sidebar. Click Insert and then choose the elements you want from the different galleries.
Themes and styles also help keep your document coordinated. When you click Design and choose a new Theme, the pictures, charts, and SmartArt graphics change to match your new theme. When you apply styles, your headings change to match the new theme.
Save time in Word with new buttons that show up where you need them. To change the way a picture fits in your document, click it and a button for layout options appears next to it. When you work on a table, click where you want to add a row or a column, and then click the plus sign.
Reading is easier, too, in the new Reading view. You can collapse parts of the document and focus on the text you want. If you need to stop reading before you reach the end, Word remembers where you left off - even on another device.

    \includegraphics[width=1\textwidth]{Testimage}%Since we have identified the graohic location we just need the file name. 
    \caption{Test image}

Thanks in advance.

  • 1
    In your style file you set a graphics path. Here the / at the end is missing.
    – Mike
    May 13, 2018 at 21:48
  • Thanks @Mike. I amended my code as you suggested but there is still a problem when I compile the main document. The picture appears but I get the same error message as above. Do you know if \input and \graphicspath commands are compatible in the same document?
    – Kevin
    May 14, 2018 at 10:15
  • 1
    That's odd, I never heared of graphicx not finding an image and nevertheless including it. Are you testing with the real document? If so, are all images in the same folder? And if this is also the case, you may want to check for typos in the file names.
    – Mike
    May 14, 2018 at 22:09
  • I re-wrote the document and it worked. Not sure what the problem was but it was probably due to a typo or missing code somewhere. Thanks for the prompts @Mike!
    – Kevin
    May 16, 2018 at 16:06
  • 4
    I'm voting to close this question as off-topic because solved by the OP in a non-specified way.
    – CarLaTeX
    Jun 1, 2018 at 5:01


Browse other questions tagged or ask your own question.