> 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/pl/artykuly-szczegolowe/46-testing-display-and-link-template.md).

# Testowanie szablonu wyświetlania i linku

## Testowanie szablonu wyświetlania i linku

UWAGA: TESTY TRWAJĄ, WIĘC WYNIKI MOGĄ SIĘ „WAHAĆ”

## Szablon MediaWiki do pokazania części lub całości dokumentu LaTeX

Proponowany szablon [Szablon:OpenLaTeXInOverleaf](https://github.com/ayaka-notes/overleaf-learn-wiki/tree/main/learn/Template:OpenLaTeXInOverleaf/README.md) umożliwia wyświetlanie kodu LaTeX w treści *i*, korzystając z pracy Alfa, automatycznie generuje `Otwórz w Overleaf` link z kodu LaTeX w treści — kod wpisujesz tylko *raz*. Umożliwia też wyświetlenie tylko `treść` części swojego LaTeX-a, pomijając całą preambułę i \end{document}, albo wyświetli cały dokument, ale w obu przypadkach w Overleaf zostanie otwarty w pełni gotowy dokument.

* Uwaga: ze względu na sposób analizowania przez MediaWiki, **musisz użyć `{{!}}` w swoim kodzie TeX, aby wygenerować znak |**.

### Parametry kontrolujące wyświetlanie kodu LaTeX w treści (i tworzenie dokumentu)

* **`pre`**, które ustawia `preambuły` twojego dokumentu. Domyślnie ma wartość

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

* **`treść`** który jest podstawowym kodem Twojego dokumentu LaTeX
* **`post`**, które ustawia koniec twojego dokumentu. Domyślnie ma wartość

```
\end{document}
```

* **`show`** który kontroluje sposób wyświetlania kodu LaTeX: albo `treść` sekcję, albo cały dokument
  * `show=ALL` wyświetla cały dokument LaTeX — używa Twoich wartości `treść`, `pre` i `post`, albo używa *domyślnych wartości* dla `pre` lub `post`.
  * `show=BODY` wyświetla tylko treść twojego kodu LaTeX

We wszystkich przypadkach automatyczny link „Otwórz w Overleaf” jest tworzony przy użyciu ustawień dla **`pre`**, **`treść`** i **`post`**

### Parametry kontrolujące wywołanie API Overleaf (odziedziczone dzięki pracy Alfa)

* **`silnik`** ustawia kompilator używany dla kodu, może być jednym z:
  * `pdflatex` (domyślna, jeśli nie wybrano silnika)
  * `xelatex`
  * `lualatex`
  * `latex_dvipdf`
* **`nazwa`** ustawia tytuł dokumentu Overleaf
* **`tekst`** ustawia tekst używany do wyświetlania linku

## Przykłady

Poniższa sekcja zawiera kilka przykładów użycia szablonu.

### Zdefiniuj pre, post i ustaw show=ALL

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

Witaj

drogi

\LaTeX

|post=
\end{document}%Tutaj kończymy dokument
|engine=lualatex|name=Test z użyciem LuaLaTeX|text=Otwórz przykład LuaLaTeX w Overleaf
}}
```

Powyższy kod generuje następujące wyświetlenie w treści oraz link „Otwórz w Overleaf”

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

drogi

\LaTeX
\end{document}%Tutaj kończymy dokument
```

&#x20;[Otwórz przykład LuaLaTeX w Overleaf](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)

### Zdefiniuj pre, post i show=BODY

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

Witaj

drogi

\LaTeX

|post=
\end{document}%Tutaj kończymy dokument
|engine=lualatex|name=Test z użyciem LuaLaTeX|text=Otwórz przykład LuaLaTeX w Overleaf
}}
```

Powyższy kod generuje następujące wyświetlenie w treści oraz link „Otwórz w Overleaf”

```latex
Witaj

drogi

\LaTeX
```

&#x20;[Otwórz przykład LuaLaTeX w Overleaf](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)

### Zdefiniuj pusty pre, pusty post, ale pełniejszą treść

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

\documentclass{book}

\begin{document}

Witaj

drogi

\LaTeX

\end{document}
|engine=lualatex|name=Test z użyciem LuaLaTeX|text=Otwórz przykład LuaLaTeX w Overleaf
}}
```

Powyższy kod generuje następujące wyświetlenie w treści oraz link „Otwórz w Overleaf”

```latex
\documentclass{book}

\begin{document}

Witaj

drogi

\LaTeX

\end{document}
```

&#x20;[Otwórz przykład LuaLaTeX w Overleaf](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)

### Użyj domyślnych wartości dla pre i post, ale podaj kod dla treści

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

drogi

\LaTeX
|engine=lualatex|name=Test z użyciem LuaLaTeX|text=Otwórz przykład LuaLaTeX w Overleaf
}}
```

Powyższy kod generuje następujące wyświetlenie w treści oraz link „Otwórz w Overleaf”

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

Witaj

drogi

\LaTeX

\end{document}
```

&#x20;[Otwórz przykład LuaLaTeX w Overleaf](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)

## TESTOWANIE: ZIGNORUJ TE LINKI

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

\LaTeX

\end{document}
```

&#x20;[Otwórz w 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/pl/artykuly-szczegolowe/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.
