latex-wochenende/slides/chapter-11.en.md

109 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@slide(layout=chapter-slide)
@title
Graphics
@slide(layout=content-only)
@title
Including graphics <span class="emoji">🖼️</span>
@content
To display graphics, we need the `graphicx` package.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<file path>}
\caption[<short caption>]
{<full caption>}
\end{figure}
```
Specifying the size:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<file path>}
```
@slide(layout=content-only)
@title
Layout on the page
@content
``` {.lang-tex .hljs}
\begin{figure}[<position code>]
```
LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined, as well).
<table>
<tr>
<th style="min-width:4em">code</th>
<th>position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>here, if you dont mind</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>top of the page</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>bottom of the page</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>on its own page</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Here, for Gods sake! <br />(`float` package required)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Centered alignment
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<dateipfad>}
\end{center}
\end{figure}
```
Alternatively:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<dateipfad>}
\end{figure}
```
@slide(layout=task)
@task-number
10
@title
Inserting graphics
@content
* Include the file `bilder.tex`.
* Section 5 contains a small **image.** Use this image and embed it once more in a larger size (width: `\textwidth`) at the end of the section.