> 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/knowledge-base/077-how-to-search-in-an-overleaf-project.md).

# How to search in an Overleaf project

This article explains two ways to search for text within your Overleaf project.

* [**Search and replace within the current file**](#search-and-replace-within-the-current-file) lets you find and replace text within an editable file currently open in the editor.
* [**Project-wide search**](#project-wide-search) enables you to search across all text files in your project.

## Search and replace within the current file

This feature lets you find and replace text within an editable file displayed in the editor. This feature is not available for read-only files such as:

* text files [uploaded from an external URL](/latex/knowledge-base/081-how-to-upload-a-file-using-an-external-url.md), including files stored on Google Drive, and `.bib` files (reference libraries) imported from [Papers](/latex/knowledge-base/071-how-to-link-papers-to-your-overleaf-account.md), [Mendeley](/latex/knowledge-base/070-how-to-link-mendeley-to-your-overleaf-account.md), or [Zotero](/latex/knowledge-base/073-how-to-link-zotero-to-your-overleaf-account.md)
* text files that exceed 2MB in size because the editor treats them as read-only

### How to access search and replace

Use either of the following methods to access this feature:

1. Keyboard shortcuts:

* Windows/Linux: Ctrl+f
* Mac OS: Cmd+f

3. Select the **Toggle Search** icon located above the editor:

![Image showing location of file search](/files/2x2pYVggUmrVLdckbCsc)

Either method displays a search panel located at the bottom of the editor.

![Image showing the location of the file search panel](/files/GuPBFsC8pXponKxZJQMS)

The search panel provides the following controls.

![Image showing controls provided on the file search panel](/files/H40rPOjh8in0vkvNHwW4)

### How to use search or search and replace

1. You can configure your search by selecting one or more of the following options, or proceed to search without selecting any.

* ![Icon for case sensitive search](/files/eJir5CA9BQ75xZ1QMEpS): use a case-sensitive search
* ![Icon for searching using regular expressions](/files/cBD61EoV1KOTbPEG3sB9): use regular expressions
* ![Icon for whole word search](/files/voLUL09PEjzpzCttb40X): search for whole words only
* ![Icon for searching within selected text](/files/mlRJYmirovysQlX6GB6W): search only within text highlighted in the editor

3. After selecting search options, type a search term in the box labeled **Search for**. Overleaf will start to search as you type and highlight the first successful result.
4. Use the next and previous buttons to find any additional search results.

![Image showing control for previous and next search result](/files/W1CinloSFPoafDNFWoCh)

6. To replace the text of search results, enter the replacement text in **Replace with** and use one of the following methods:

* *Manual replacement*: select **Replace** to update an individual match and cause Overleaf to highlight the next match. Continue to navigate through the results using the previous/next buttons and click **Replace** to update additional matches.
* *Automatic replacement*: select **Replace All** to replace all matches at once.

8. **Note**: Selecting the search button (![A button to access project-wide search](/files/1AyHXLARkKjh2QPouTDI)) switches to project-wide search.

## Project-wide search

This feature allows you to search for text across all files in your project, provided they are under 2MB. Files larger than 2MB are excluded from the search results (see the [video](#video-demonstrating-project-wide-search) for an example of that).

### How to access project-wide search

Use any of the following methods to access this feature:

1. Keyboard shortcuts:

* Windows/Linux: Ctrl+Shift+f
* Mac OS: Cmd+Shift+f

3. Select the **Search** icon located above the file tree:

![Image showing location of project-wide search icon](/files/GoFCwGclnEn8NcCRB9yf)

5. Select the search button (![A button to access project-wide search](/files/1AyHXLARkKjh2QPouTDI)) located on the [search panel](#how-to-access-search-and-replace).

Each of these methods displays a search box that temporarily hides the file tree.

![Image showing the project-wide search box](/files/cY8l9JOwVmFZ7hEdFhV4)

### How to use project-wide search

1. You can configure your search by selecting one or more of the following options, or proceed to search without selecting any.

![Image showing the controls to configure project-wide search](/files/miVjfYgnqQ4ctKMz5ScK)

* ![Icon for case sensitive search](/files/eJir5CA9BQ75xZ1QMEpS): use a case-sensitive search
* ![Icon for searching using regular expressions](/files/cBD61EoV1KOTbPEG3sB9): use regular expressions
* ![Icon for whole word search](/files/voLUL09PEjzpzCttb40X): search for whole words only

4. Type your search term in the box provided and select the search icon (![Image showing project-wide search icon](/files/SZoDOajgjSJEiSsBYR0r)), or press return.
5. Any search results are listed and grouped by file.
6. Select a search result to jump to the corresponding file location.

### Video demonstrating project-wide search

The following video demonstrates project-wide searching using the Overleaf project [Typeset, the source code documentation for TeX, e-TeX, or pdfTeX](https://www.overleaf.com/latex/examples/typeset-the-source-code-documentation-for-tex-e-tex-or-pdftex/qkgfgyspnhcv). That project was selected because it contains large `.tex` files including `pdftex.tex`, which exceeds the 2MB size limit and is excluded from the search results.

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/21dsGfzi4yynX5beA2eBz3/4bd76333ece5ae522e09bb9745b8d6ca/NewSearch.mp4>" %}


---

# 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/knowledge-base/077-how-to-search-in-an-overleaf-project.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.
