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

# Overleafプロジェクト内を検索する方法

この記事では、Overleaf プロジェクト内のテキストを検索する 2 つの方法を説明します。

* [**現在のファイル内の検索と置換**](#search-and-replace-within-the-current-file) 現在エディタで開いている編集可能なファイル内のテキストを検索して置換できます。
* [**プロジェクト全体検索**](#project-wide-search) プロジェクト内のすべてのテキストファイルを対象に検索できます。

## 現在のファイル内の検索と置換

この機能では、エディタに表示されている編集可能なファイル内のテキストを検索して置換できます。この機能は、次のような読み取り専用ファイルでは利用できません。

* テキストファイル [外部 URL からアップロードされた](/latex/ja/narejjibsu/081-how-to-upload-a-file-using-an-external-url.md)、Google ドライブに保存されているファイルを含むファイル、および `.bib` からインポートされたファイル（参考文献ライブラリ） [Papers](/latex/ja/narejjibsu/071-how-to-link-papers-to-your-overleaf-account.md), [Mendeley](/latex/ja/narejjibsu/070-how-to-link-mendeley-to-your-overleaf-account.md)または [Zotero](/latex/ja/narejjibsu/073-how-to-link-zotero-to-your-overleaf-account.md)
* サイズが 2MB を超えるテキストファイル。エディタはそれらを読み取り専用として扱うためです

### 検索と置換にアクセスする方法

この機能には、次のいずれかの方法でアクセスできます。

1. キーボードショートカット：

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

3. を選択します **検索の切り替え** エディタの上にあるアイコン：

![ファイル検索の位置を示す画像](/files/7766121bf61d3556d908062010bc3a7b88bf6d16)

どちらの方法でも、エディタの下部にある検索パネルが表示されます。

![ファイル検索パネルの位置を示す画像](/files/edf0151f870a862249aea138ba89ad33e07891ac)

検索パネルには次の操作が用意されています。

![ファイル検索パネルに用意された操作を示す画像](/files/ba41a038da46447729bdc83c64c652662eea43ef)

### 検索または検索と置換の使い方

1. 次のオプションの 1 つ以上を選択して検索を設定することも、何も選択せずにそのまま検索することもできます。

* ![Icon for case sensitive search](/files/1f6e06b5476f33c857c028a91a1dae807e65fb03)：大文字と小文字を区別して検索する
* ![Icon for searching using regular expressions](/files/123ac3472206427f49850edcccf662f43ecfd612)：正規表現を使用する
* ![Icon for whole word search](/files/fc0a7fa1905ce5ca064e86b01f8184992c9bcf35)：完全一致する単語のみを検索する
* ![Icon for searching within selected text](/files/81fea88e7a266c13c923dd5795072b1c4133b01a)：エディタでハイライトされたテキスト内のみを検索する

3. 検索オプションを選択した後、ラベル付きのボックスに検索語を入力します **検索対象**。入力すると Overleaf が検索を開始し、最初に見つかった結果をハイライトします。
4. 前へ/次へボタンを使って、ほかの検索結果を見つけます。

![前後の検索結果を切り替える操作を示す画像](/files/5c6fecb2fd4d9a675eb385ffe2ac22cd964eb220)

6. 検索結果のテキストを置換するには、 **置換後の文字列** に置換テキストを入力し、次のいずれかの方法を使います。

* *手動置換*： **置換** を選択して個々の一致箇所を更新すると、Overleaf は次の一致箇所をハイライトします。前へ/次へボタンを使って結果を順に移動し続け、 **置換** をクリックして他の一致箇所を更新します。
* *自動置換*： **すべて置換** を選択すると、すべての一致箇所を一度に置換できます。

8. **注**：検索ボタン（![A button to access project-wide search](/files/f9c0e5d1bd7b20da15934ce529b36f7733f3a8b9)）を選択すると、プロジェクト全体検索に切り替わります。

## プロジェクト全体検索

この機能では、2MB 未満のファイルを対象に、プロジェクト内のすべてのファイルからテキストを検索できます。2MB を超えるファイルは検索結果から除外されます（その例については、 [動画](#video-demonstrating-project-wide-search) をご覧ください）。

### プロジェクト全体検索にアクセスする方法

この機能には、次のいずれかの方法でアクセスできます。

1. キーボードショートカット：

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

3. を選択します **検索** ファイルツリーの上にあるアイコン：

![プロジェクト全体検索アイコンの位置を示す画像](/files/c022cc3b969d3c9c4b8f23c88f7643b814126d0c)

5. 検索ボタン（![A button to access project-wide search](/files/f9c0e5d1bd7b20da15934ce529b36f7733f3a8b9)）を [検索パネル](#how-to-access-search-and-replace).

の上で選択します。これらの方法のいずれでも、ファイルツリーを一時的に非表示にする検索ボックスが表示されます。

![プロジェクト全体検索ボックスを示す画像](/files/3aa6fd1eabe4b83b6446e9737df392fd5391324f)

### プロジェクト全体検索の使い方

1. 次のオプションの 1 つ以上を選択して検索を設定することも、何も選択せずにそのまま検索することもできます。

![プロジェクト全体検索を設定する操作を示す画像](/files/6c1173942635b40731b105ab46f12097c5e076ad)

* ![Icon for case sensitive search](/files/1f6e06b5476f33c857c028a91a1dae807e65fb03)：大文字と小文字を区別して検索する
* ![Icon for searching using regular expressions](/files/123ac3472206427f49850edcccf662f43ecfd612)：正規表現を使用する
* ![Icon for whole word search](/files/fc0a7fa1905ce5ca064e86b01f8184992c9bcf35)：完全一致する単語のみを検索する

4. 用意されたボックスに検索語を入力し、検索アイコン（![Image showing project-wide search icon](/files/762fe7b2f8506d32872a3b49db47093277e67609)）を選択するか、Return キーを押します。
5. 検索結果は一覧表示され、ファイルごとにグループ化されます。
6. 検索結果を選択すると、対応するファイルの位置に移動します。

### プロジェクト全体検索のデモ動画

次の動画では、Overleaf プロジェクトを使用したプロジェクト全体検索をデモンストレーションします [TeX、e-TeX、または pdfTeX のソースコードドキュメントである Typeset](https://www.overleaf.com/latex/examples/typeset-the-source-code-documentation-for-tex-e-tex-or-pdftex/qkgfgyspnhcv)。このプロジェクトが選ばれたのは、大きな `.tex` ファイルを含んでおり、その中には `pdftex.tex`が含まれ、これは 2MB のサイズ上限を超えているため検索結果から除外されるからです。

{% 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/ja/narejjibsu/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.
