> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/latex-errors/09-file-xxx-not-found-on-input-line-xxx.md).

# File XXX not found on input line XXX

This error is related to a file which cannot be found by LaTeX. This error usually appears when either

* The file path contains forbidden characters
* You have forgotten to upload the file
* The file path is spelled incorrectly.

For all information on how to correctly include images in your project, see our [tutorial](/latex/more-topics/27-inserting-images.md). Also note that whenever you are including images, you must include the **`graphicx`** package in your preamble by writing **`\usepackage{graphicx}`**. If you make any of the mistakes outlined above, you will get an error which looks like

main.tex, line 5

LaTeX Error: File \`image3' not found.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.8 \includegraphics{image3} I could not locate the file with any of these extensions: .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps Try typing to proceed. If that doesn't work, type X to quit.

## Common Causes of Error

**Forbidden characters in the file path**

LaTeX has issues with certain characters in file paths, which you should avoid. In some cases the usage of such characters results in a file not found error. Characters you should avoid include:

* space ( )
* percent symbol (`%`)
* backslash (`\`)
* characters which are made active, by default this is only the tilde, which expands to an unbreakable space (`~`)

**Forgetting to upload file:**

When you want to include a file in your project, you must upload it to the project so that LaTeX is able to find it. This is done by clicking the 'upload' button as shown below

![Uploadimage.PNG](/files/TUU7VZsYFI8puQGuaUq6)

After this, the file should appear in the left hand menu.

**File path incorrect:**

When including a file, you must always write the file path *from the root directory*. This is true even if the main document which you are compiling is stored in a folder in the root directory instead of the root directory itself. An example of this is shown below

![Imagefolder.PNG](/files/5kLiA66vcV3XcT3yc34n)

Here, the image you want to use, **`image.PNG`** is stored inside **`folder2`**, which itself is stored inside **`folder`**. Therefore, to tell LaTeX where to find the image, you should write the path as **`folder/folder2/image`**. This is shown below

```latex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}

\begin{figure}
    \centering
    \includegraphics{ {folder/folder2/image} }
    \caption{This is your image}
    \label{fig:my_label}
\end{figure}
\end{document}
```

![Imageexample.PNG](/files/gOrkMibMZYNHK1YreOR0)

**Using `\graphicspath{...}` incorrectly:**

If you decide to tell LaTeX where your images are stored in the preamble so that you don't have to keep writing out the file path, then you must remember to include a forward slash at the end of the file path, and to write the entire file path inside a set of braces, as shown below

```latex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\graphicspath{ {folder/folder2/} } %This is where you have saved the images

\begin{document}

\begin{figure}
    \centering
    \includegraphics{image}
    \caption{This is your image}
    \label{fig:my_label}
\end{figure}
\end{document}
```

![Imageexample.PNG](/files/gOrkMibMZYNHK1YreOR0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/latex-errors/09-file-xxx-not-found-on-input-line-xxx.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
