> 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/068-how-to-insert-figures-in-overleaf.md).

# Overleafで図を挿入する方法

Overleafでは、LaTeXの図を作成する方法が3つあります:

1. 次の [**図を挿入** ボタン](#using-insert-figure-to-add-a-figure-to-your-project) (![The Insert Figure button on the editor toolbar](/files/78c6fd0c89f8b2a19a1fa58c2b212ec64fabbd37)）を使って図を挿入します **ビジュアルエディタ** または **コードエディタ**.
2. [画像をコピーして貼り付ける](/latex/ja/narejjibsu/075-how-to-paste-formatted-content-into-overleaf.md#pasting-images-into-your-overleaf-project) に **ビジュアルエディタ** または **コードエディタ**.
3. 使用 **コードエディタ** LaTeXコードを記述して、 [グラフィックを挿入し、それを図環境内に配置します](/latex/ja/sononotopikku/27-inserting-images.md).

オプション1と2では、図を作成するために必要なLaTeXコードが自動生成されますが、LaTeXに慣れているなら、最も柔軟性の高いオプション3のほうを好むかもしれません。LaTeXを初めて使うなら、オプション1の **図を挿入** ボタン（このページの主題）は、始めるのに最適な方法です。

これらの図作成方法を使う前に、メインのLaTeXファイルで次のパッケージが読み込まれていることを確認してください `graphicx` と記述して `\usepackage{graphicx}` その [プリアンブル内で](/latex/ja/latexno/01-learn-latex-in-30-minutes.md#the-preamble-of-a-document).

## Visual Editor と Code Editor の使用

図を挿入する方法を説明する前に、注目しておく価値があります **ビジュアルエディタ**図のプレビュー機能です。

図は挿入できます **ビジュアルエディタ** または **コードエディタ**、ただし **ビジュアルエディタ** 図のプレビューと、変更を加えられるモーダルウィンドウを開くボタンが表示されます。以下の短い動画クリップでは **ビジュアルエディタ**図のプレビュー機能です。

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/4ohFnejYVn89OUj2fAbJ6F/18ad3cd10b0b3ceb7955cc651c92eedb/VisualEditorDemo.mp4>" %}

## Insert Figure を使ってプロジェクトに図を追加する

以下の手順で、OverleafのLaTeX文書に図を挿入します。

1. 使用するエディタを選択します: **ビジュアルエディタ** または **コードエディタ**.
2. 次の **図を挿入** ボタン（![The Insert Figure button on the editor toolbar](/files/78c6fd0c89f8b2a19a1fa58c2b212ec64fabbd37)）を選択すると、図の挿入オプションの一覧が表示されます:

   ![図の挿入オプション一覧](/files/1220ea46b4bad86e1c86cc153576c1674795e557)
3. 次のドキュメントリンクを使って、目的のオプションへ移動してください:

* [コンピュータからアップロード](#upload-from-computer)
* [プロジェクトファイルから](#from-project-files)
* [別のプロジェクトから（動画デモ）](#from-another-project)
* [URLから（動画デモ）](#from-url)

### コンピュータからアップロード

このオプションでは、デバイスからアップロードしたグラフィックファイルを使って図を作成します。

![ファイルをアップロードしたときに表示される「コンピュータからアップロード」モーダル](/files/9c59eb949f97682839799b6e52772bcab7804547)

このオプションを使用するには:

1. 以下のいずれかの方法でグラフィックをアップロードします:

* グラフィックファイルをモーダルウィンドウの所定の領域にドラッグ＆ドロップする
* 画像をモーダルウィンドウの所定の領域に貼り付ける
* デバイス上のファイルを手動で選択する

3. グラフィックファイルに名前を付けます。
4. （任意）ファイルを保存するプロジェクトフォルダを選択します。
5. 図のキャプションを使うかどうかを決めます。
6. ラベルを含めるかどうかを決めます（ [図を参照するための](/latex/ja/sononotopikku/27-inserting-images.md#labels-and-cross-references)).
7. 画像の幅を（次の割合として `\linewidth`).
8. 選択 **図を挿入** をクリックしてグラフィックをアップロードし、選択内容に基づいてLaTeXの `図` 環境を自動生成します。

### プロジェクトファイルから

このオプションでは、現在のプロジェクトに以前アップロードされたグラフィックファイルの1つを使って図を作成します。

![図の作成に使うプロジェクトファイルを選択するための「プロジェクトファイルから挿入」モーダル](/files/8a0d65a89f83492da6993fff574c83ebab4a23ee)

このオプションを使用するには:

1. プロジェクトに含まれているグラフィックを選択します。
2. 図のキャプションを使うかどうかを決めます。
3. ラベルを含めるかどうかを決めます（ [図を参照するための](/latex/ja/sononotopikku/27-inserting-images.md#labels-and-cross-references)).
4. 画像の幅を（次の割合として `\linewidth`).
5. 選択 **図を挿入** をクリックしてLaTeXの `図` 環境を自動生成します。

### 別のプロジェクトから

このオプションでは、Overleaf の別のプロジェクトに含まれるグラフィックファイルを使って図を作成できます。下のアニメーション付きスクリーンショットに示すように、まずプロジェクトを選び、次に以前に *アップロードされた* そのプロジェクトにアップロードされたファイル、または *出力* （生成された）ファイル—たとえば、次によって生成されたPDFグラフィック [TikZグラフィックの外部化](https://learn.overleaf.com/learn/Questions/I_have_a_lot_of_tikz,_matlab2tikz_or_pgfplots_figures,_so_I%27m_getting_a_compilation_timeout._Can_I_externalise_my_figures%3F#How_to_externalize_TikZ_graphics)。詳しくは次のセクションを参照してください [出力ファイルから選択](#select-from-output-files) 別のプロジェクトで作成された出力ファイルの使い方を示す動画クリップについて。

![別のプロジェクトで生成されたファイルの選び方を示すアニメーションGIF](/files/da2637d3c8ab682c004e411eb30c5a1f4391e689)

このオプションを使用するには:

1. 現在のプロジェクトで使いたいグラフィックファイルを含むプロジェクトを選択します。
2. そのプロジェクトのグラフィックの1つを選択します:
   * 1つの **画像ファイル** *がアップロードされた* そのプロジェクト、または
   * 1つの [**出力ファイル**](#select-from-output-files) *によって生成された* そのプロジェクト。
3. グラフィックファイルに名前を付けます。
4. （任意）ファイルを保存するプロジェクトフォルダを選択します。
5. 図のキャプションを使うかどうかを決めます。
6. ラベルを含めるかどうかを決めます（ [図を参照するための](/latex/ja/sononotopikku/27-inserting-images.md#labels-and-cross-references)).
7. 画像の幅を（次の割合として `\linewidth`).
8. 選択 **図を挿入** をクリックしてLaTeXの `図` 環境を自動生成します。

#### 出力ファイルから選択

以下の動画クリップでは、別のプロジェクトで生成されたファイルを利用して、現在のプロジェクトに図を組み込む手順を説明します。これは [外部化されたTikZグラフィック](/latex/ja/to-2/60-i-have-a-lot-of-tikz-matlab2tikz-or-pgfplots-figures-so-i-m-getting-a-compilation-timeout.-can-i.md#how-to-externalize-tikz-graphics).

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/1hcdCRW7PFioG58vexEMpf/60b86288419fea290ad4b43a633afda3/FigureFromExternalProjectFile.mp4>" %}

### URLから

このオプションでは、URLを介してプロジェクトに追加（ダウンロード）したグラフィックを使って図を作成できます。

![URL経由でファイルをダウンロードするためのモーダルウィンドウを示す画像](/files/039d7d18a989d0acb50173ecc374a437ffccb254)

このオプションを使用するには:

1. 次を貼り付けます [直接ダウンロードリンク](https://en.wikipedia.org/wiki/Direct_download_link) （URL）を **Image URL** フィールドに。
2. グラフィックファイルに名前を付けます。
3. （任意）保存先のプロジェクトフォルダを選択します。
4. 図のキャプションを含めるかどうかを決めます。
5. ラベルを含めるかどうかを決めます（ [図を参照するための](/latex/ja/sononotopikku/27-inserting-images.md#labels-and-cross-references)).
6. 画像の幅を（次の割合として `\linewidth`).
7. 選択 **図を挿入** をクリックしてLaTeXの `図` 環境を自動生成します。

以下の動画クリップでは、 [Google DriveのダウンロードURL](/latex/ja/narejjibsu/051-how-can-i-upload-files-from-google-drive.md)の使い方を示します。また、図のサイズを変更し、キャプションを付ける方法も説明しています。

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/29hcjGmsEQewhuCVQaWkSr/2cef229050a36a87b86dc0aabdde2858/InsertFigureURL.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/068-how-to-insert-figures-in-overleaf.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.
