> 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/xiang-xi-ji-shi/46-testing-display-and-link-template.md).

# 表示とリンクのテンプレートをテストする

## 表示とリンク用テンプレートのテスト

注: 継続的にテスト中のため、結果は「変動」する可能性があります

## LaTeX文書の一部または全体を表示するMediaWikiテンプレート

提案されたテンプレート [テンプレート:OpenLaTeXInOverleaf](https://github.com/ayaka-notes/overleaf-learn-wiki/tree/main/learn/Template:OpenLaTeXInOverleaf/README.md) インラインのLaTeXコードを表示できます *や*、Alfの作業を利用して、自動的に `Overleafで開く` インラインのLaTeXコードからリンクを生成します。コードを書くのは *一度だけ*。また、次のものだけを表示することもできます `本文` LaTeXの本文のみを、プリアンブル全体と \end{document} を省略して表示することも、文書全体を表示することもできますが、どちらの場合も完全な文書がOverleafで開かれます。

* 注: MediaWikiのパース上の理由により、 **使用する必要があります `{{!}}` TeXコード内で | 文字を生成するには**.

### LaTeXコードのインライン表示（および文書構築）を制御するためのパラメータ

* **`pre`**、これは `プリアンブル` 文書の先頭部分を設定します。既定値は

```
\documentclass{article}
\begin{document}
```

* **`本文`** これはLaTeX文書の中核となるコードです
* **`post`**、これは文書の末尾を設定します。既定値は

```
\end{document}
```

* **`show`** LaTeXコードの表示を制御し、 `本文` セクションまたは文書全体
  * `show=ALL` LaTeX文書全体を表示します---あなたの値を使用します `本文`, `pre` や `post`、または次のものを使用します *既定値* の `pre` または `post`.
  * `show=BODY` LaTeXコードの本文のみを表示します

いずれの場合も、自動の「Overleafで開く」リンクが次の設定を使用して作成されます **`pre`**, **`本文`** や **`post`**

### Overleaf API呼び出しを制御するためのパラメータ（Alfの作業を継承）

* **`エンジン`** コードに使用するコンパイラを設定します。次のいずれかにできます:
  * `pdflatex` （エンジンが選択されていない場合の既定値）
  * `xelatex`
  * `lualatex`
  * `latex_dvipdf`
* **`名前`** Overleaf文書のタイトルを設定します
* **`テキスト`** リンクの表示テキストを設定します

## 例

以下のセクションでは、テンプレートの使用例をいくつか示します。

### pre、postを定義し、show=ALLを設定する

```
{{OpenLaTeXInOverleaf|show=ALL|pre=
\documentclass{book}
\begin{document}
|body=

Hello

親愛なる

\LaTeX

|post=
\end{document}%ここで文書を終了します
|engine=lualatex|name=LuaLaTeXを使用したテスト|text=OverleafでLuaLaTeXの例を開く
}}
```

上記のコードは、次のインライン表示と「Overleafで開く」リンクを生成します

```latex
\documentclass{book}
\begin{document}
Hello

親愛なる

\LaTeX
\end{document}%ここで文書を終了します
```

&#x20;[OverleafでLuaLaTeXの例を開く](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Test+using+LuaLaTeX\&snip=%5Cdocumentclass%7Bbook%7D%0A%5Cbegin%7Bdocument%7D%0AHello+%0A%0Adear%0A%0A%5CLaTeX%0A%5Cend%7Bdocument%7D%25Here+we+end+the+document)

### pre、postを定義し、show=BODYを設定する

```
{{OpenLaTeXInOverleaf|show=BODY|pre=
\documentclass{book}
\begin{document}
|body=

Hello

親愛なる

\LaTeX

|post=
\end{document}%ここで文書を終了します
|engine=lualatex|name=LuaLaTeXを使用したテスト|text=OverleafでLuaLaTeXの例を開く
}}
```

上記のコードは、次のインライン表示と「Overleafで開く」リンクを生成します

```latex
Hello

親愛なる

\LaTeX
```

&#x20;[OverleafでLuaLaTeXの例を開く](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Test+using+LuaLaTeX\&snip=%5Cdocumentclass%7Bbook%7D%0A%5Cbegin%7Bdocument%7D%0AHello+%0A%0Adear%0A%0A%5CLaTeX%0A%5Cend%7Bdocument%7D%25Here+we+end+the+document)

### 空のpre、空のpostを定義し、より充実したbodyを指定する

```
{{OpenLaTeXInOverleaf|show=ALL|pre=|post=|body=

\documentclass{book}

\begin{document}

Hello

親愛なる

\LaTeX

\end{document}
|engine=lualatex|name=LuaLaTeXを使用したテスト|text=OverleafでLuaLaTeXの例を開く
}}
```

上記のコードは、次のインライン表示と「Overleafで開く」リンクを生成します

```latex
\documentclass{book}

\begin{document}

Hello

親愛なる

\LaTeX

\end{document}
```

&#x20;[OverleafでLuaLaTeXの例を開く](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Test+using+LuaLaTeX\&snip=%5Cdocumentclass%7Bbook%7D%0A%0A%0A%5Cbegin%7Bdocument%7D%0A%0A%0AHello+%0A%0Adear%0A%0A%5CLaTeX%0A%0A%0A%5Cend%7Bdocument%7D)

### preとpostには既定値を使い、bodyにはコードを指定する

```
{{OpenLaTeXInOverleaf|show=ALL|body=
Hello

親愛なる

\LaTeX
|engine=lualatex|name=LuaLaTeXを使用したテスト|text=OverleafでLuaLaTeXの例を開く
}}
```

上記のコードは、次のインライン表示と「Overleafで開く」リンクを生成します

```latex
\documentclass{article}
\begin{document}

Hello

親愛なる

\LaTeX

\end{document}
```

&#x20;[OverleafでLuaLaTeXの例を開く](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Test+using+LuaLaTeX\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%0AHello+%0A%0Adear%0A%0A%5CLaTeX%0A%0A%5Cend%7Bdocument%7D)

## テスト中のため、これらのリンクは無視してください

```latex
\documentclass{article}
\begin{document}

\LaTeX

\end{document}
```

&#x20;[Overleafで開く](https://www.overleaf.com/docs?engine=\&snip_name=\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5CLaTeX%0A%0A%5Cend%7Bdocument%7D)


---

# 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/xiang-xi-ji-shi/46-testing-display-and-link-template.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.
