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

1.8 KiB
Raw Blame History

@slide(layout=chapter-slide)

@title Graphics

@slide(layout=content-only)

@title Including graphics 🖼️

@content To display graphics, we need the graphicx package.

\begin{figure}
    \includegraphics{<file path>}
    \caption[<short caption>]
            {<full caption>}
\end{figure}

Specifying the size:

\includegraphics[width=0.5\textwidth,
height=5cm]{<file path>}

@slide(layout=content-only)

@title Layout on the page

@content

\begin{figure}[<position code>]

LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well).

code position
h here, if you dont mind
t top of the page
b bottom of the page
p on its own page
H Here, for Gods sake!
(`float` package required)

@slide(layout=content-only)

@title Centred alignment

@content

\begin{figure}[<position>]
    \begin{center}
        \includegraphics{<path-to-file>}
    \end{center}
\end{figure}

Alternatively:

\begin{figure}[<position>]
    \centering
    \includegraphics{<path-to-file>}
\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 increased to a larger size (width: \textwidth) at the end of the section.