> 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/to-2/15-how-can-i-get-my-table-or-figure-to-stay-where-they-are-instead-of-going-to-the-next-page.md).

# 表や図を次のページに送らず、その場所にとどめるにはどうすればよいですか？

通常は `\begin{figure}` または `\begin{table}` つまり *フロート*、デフォルトの配置指定子は `[btp]`、つまり LaTeX は図を \*\*`b`\*\*ページ/段の下部; \*\*`t`\*\*ページ/段の上部; あるいは、フロートがかなり高い場合（キャプションを含む）、単独のフロート \*\*`p`\*\*ページ\*\* にテキストなしで配置されます。これは、プロの組版・出版の慣例（つまり TeX が作られた目的）に従ったものであり、図や表のような「フローティング要素」はそのような位置にのみ配置できます。ページの途中に置かれると、読みの流れを妨げると見なされるためです。

とはいえ、図をどこに表示したいかはまだある程度指定できます。 `[hbt!]` を `\begin{figure}`次のようにします：

```latex
\begin{figure}[hbt!]
```

これにより、LaTeX は画像をここに（ソースコード上の位置にできるだけ近く）配置するようになります。もしそれが不可能なら（たとえば現在のページに収まらないほど大きい場合）、次のページの上部、あるいは次のページの下部に配置します。感嘆符 **`!`** は重要です。これは LaTeX に「ここでは本当にこちらの指定を尊重してください」と伝えます。

ただし、図がかなり高く、現在のページに十分な空きがない場合（たとえば、すでに現在のページの終わり近くにある場合）、それでも図は次のページの上部へ移動されます。この場合は、 `\begin{figure}[hbt!]...\end{figure}` コード中の数段落前に移動してみるとよいでしょう。その時点では、現在のページにまだ余裕があるからです。

それでもうまくいかず、図や表が先へ流れて次の `\section` 見出しの後に出てしまうなら、現在の節の末尾に表示されるほうがよいかもしれません。その場合は、 `\clearpage` 次の `\section` の前に改ページを挿入するために、またキュー内のすべてのフロートも出力されます。次の `\section` 見出しは新しいページに出力されます。

別の方法として、 [`placeins` パッケージを](http://texdoc.net/pkg/placeins)を見てみてください。そこでは `\FloatBarrier` 次の `\section`—あるいは、 `section` パッケージオプションを使って自動化できます。つまり、次のように書きます。 `\usepackage[section]{placeins}` をプリアンブルに記述します。


---

# 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/to-2/15-how-can-i-get-my-table-or-figure-to-stay-where-they-are-instead-of-going-to-the-next-page.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.
