> 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/latexer/01-h-float-specifier-changed-to-ht.md).

# 浮動体指定子 !h' は !ht' に変更されました

これは、LaTeXが、指定した位置にフロート（画像や図など）を配置するのに問題があるときです。 [フロート指定子](/latex/ja/to/02-positioning-images-and-tables.md) すなわち **`ht`** を **`\begin{figure}[ht]`** 。LaTeXは、大きな空白や段落の塊を避けるため、テキストの流れに合うように図を配置しようとします。配置指定子のパラメータを使うと、図をどこに配置するかをより細かく制御できます。利用できる配置オプションは以下のとおりです：

| 指定子 | 許可                                                                               |
| --- | -------------------------------------------------------------------------------- |
| h   | フロートを配置 *こちら*、すなわち、 *ほぼ* ソーステキスト中で現れるのと同じ位置に（ただし、 *正確に* その位置そのものではなく）            |
| t   | ページの *上部* に配置。                                                                   |
| b   | ページの *下部* に配置。                                                                   |
| p   | フロート専用の特別な *page* フロート専用の特別なページに配置する。                                            |
| !   | LaTeXが「適切な」フロート位置を決めるために使う内部パラメータを上書きする。                                         |
| H   | フロートをLaTeXコード内のその位置に正確に配置します。必要なのは *float* （*\usepackage{float}*）。これはある程度、 *h!*. |

LaTeXは指定した配置に従うよう最善を尽くしますが、常にそれに従えるとは限りません。LaTeXがフロートを望ましい位置に配置するのに苦労すると、テキストの流れを妨げない新しい配置指定子を優先して、元の配置指定子を上書きすることがあります。これが起こると、以下のようなエラーメッセージが表示されます。

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

\begin{document}

\section{導入}
\vspace{10cm}

\begin{figure}[h]
    \centering
    \includegraphics{image.PNG}
\end{figure}

\end{document}
```

これにより、次のようなエラーメッセージが生成されます。

main.tex、12行目

\`h' のフロート指定子が \`ht' に変更されました。

フロート指定子 **`h`** 単独では、通常 LaTeX にとっては厳しすぎる指定です。このエラーを解決するには、この要求を次のように緩めるのが最善です。 **`ht`** つまり、フロートを次のいずれかに配置することです。 *こちら* または *上部* ページの。必要なら、要求をさらに次のように緩めることもできます。 **`htbp`** または **`!htbp`** 必要に応じて。もしこの置き換えを無効にして、図をページ内の特定の場所に配置したい場合は、以下にいくつか便利な方法を示します。

**floatパッケージを使う方法：**

次の **`float`** パッケージをプリアンブルに含めると、 **`h`** を指定する代わりに *こちら* フロート指定オプションで、より強力な **`H`**&#x3092;使うことができ、図をその場に固定できます。

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

\begin{document}

\section{導入}

\begin{figure}[H]
    \centering
    \includegraphics{image.PNG}
\end{figure}

\end{document}
```

**placeinsパッケージを使う方法：**

を使うと **`placeins`** パッケージを使うと、 **`\FloatBarrier`** コマンドを使えます。どこに **`\FloatBarrier`** コマンドを置いても、図が通過できない境界が設けられます。つまり、もし **`\FloatBarrier`** コマンドを図の前後の両側に置けば、その図はその位置に固定されます

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

\begin{document}

\section{導入}

\FloatBarrier
\begin{figure}
    \centering
    \includegraphics{image.PNG}
\end{figure}

\FloatBarrier
\end{document}
```

**パラメータを調整する方法：**

章の末尾ではなく本文中に図を配置するようLaTeXに指示するには、文書のプリアンブルで 'float placement' パラメータを調整します。便利な値を以下に示します。

```latex
\renewcommand\topfraction{.9}
\renewcommand\textfraction{0.35}
\renewcommand\floatpagefraction{0.8}
```


---

# 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/latexer/01-h-float-specifier-changed-to-ht.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.
