\documentclass{beamer} \usepackage{array} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage[dutch]{babel} \usepackage{minted} \usepackage{booktabs} \setbeamertemplate{caption}[numbered] \newcommand{\lmint}[1]{\mintinline{latex}{#1}} % This ensures that the figures % are numbered \begin{document} \begin{frame}[fragile] \frametitle{TikZ environment} Om tikz te importeren: \mintinline{latex}{\usepackage{tikz}}. Een TikZ environment wordt gestart met \mintinline{latex}{\begin{tikzpicture}} of \mintinline{latex}{\tikz} en bestaat uit instructies. Een instructie moet altijd eindigen met een \mintinline{latex}{;}. \newline \newline \begin{tabular}{m{5cm} | m{5cm}} \hline \mintinline{latex}{\begin{tikzpicture}} & \mintinline{latex}{\tikz}\\ \hline \begin{minted}[fontsize=\footnotesize]{latex} Dit zijn twee cirkels \begin{tikzpicture} \draw (0,0) circle (.2); \draw (.1,0) circle (.2); \end{tikzpicture} \end{minted} & \begin{minted}[fontsize=\footnotesize]{latex} Dit is een cirkel \tikz \draw (0,0) circle (0.2); en dit zijn twee cirkels \tikz { \draw (0,0) circle (0.2); \draw (.1,0) circle (.2); } \end{minted} \\ \hline Dit zijn twee cirkels \begin{tikzpicture} \draw (0,0) circle (.2); \draw (.1,0) circle (.2); \end{tikzpicture} & Dit is een cirkel \tikz \draw (0,0) circle (0.2); en dit zijn twee cirkels \tikz { \draw (0,0) circle (0.2); \draw (.1,0) circle (.2); } \end{tabular} \end{frame} \begin{frame}[fragile] \frametitle{Figuren} Met de Figure environment kun je een onderschrift toevoegen aan je plaatje en heb je meer controle over de positie. \begin{tabular}{m{5cm} | m{5cm}} \begin{figure}[h] \begin{tikzpicture} \draw (0,0) circle (2); \draw (1,0.8) circle (0.5); \draw (-1,0.8) circle (0.5); \draw (-1,0) .. controls (-1,-1) and (1,-1) .. (1,0); \end{tikzpicture} \caption{Smiley} \label{fig:smiley} \end{figure} & \begin{minted}{latex} \begin{figure}[h] \begin{tikzpicture} \draw (0,0) circle (2); \draw (1,0.8) circle (0.5); \draw (-1,0.8) circle (0.5); \draw (-1,0) .. controls (-1,-1) and (1,-1) .. (1,0); \end{tikzpicture} \caption{Smiley} \label{fig:smiley} \end{figure} \end{minted} \end{tabular} \end{frame} \begin{frame}[fragile] \frametitle{Figuren} Tussen de blokhaken vul je in waar het plaatje geplaatst moet worden. Hierbij zijn er de volgende opties. \begin{itemize} \item h \textsc{(here)}: Figuur mag hier \item t \textsc{(top)}: Figuur mag bovenaan een pagina \item b \textsc{(bottom)}: Figuur mag onderaan een pagina., \item p \textsc{(page)}:Figuur mag op aparte pagina voor figuren., \item !: Override interne parameters voor floats., \item H \textsc{(here)}: Geen floating, altijd hier. (\mintinline{tex}{\usepackage{float}}) \end{itemize} \end{frame} \begin{frame}[fragile] \frametitle{Vormen} \begin{tabular}{m{8cm} m{2cm}} \textbf{Rechte Lijnen:} \begin{minted}{latex} \draw (0,0) -- (1,1) -- (1,0) -- cycle; \end{minted} & \begin{tikzpicture} \draw (0,0) -- (1,1) -- (1,0) -- cycle; \end{tikzpicture} \pause \\ \textbf{Kromme Lijnen:} \begin{minted}{latex} \draw (0,0) .. controls (0,1) .. (1,1) -- (2,0) -- (1,-1) .. controls (0.5,0.5) .. cycle; \end{minted} & \begin{tikzpicture} \draw (0,0) .. controls (0,1) .. (1,1) -- (2,0) -- (1,-1) .. controls (0.5,0.5) .. cycle; \end{tikzpicture} \end{tabular} \end{frame} \begin{frame}[fragile] \frametitle{Vormen} \begin{tabular}{m{8cm} m{2cm}} \textbf{Cirkel:} \begin{minted}{latex} \draw (0,0) circle (1); \end{minted} & \begin{tikzpicture} \draw (0,0) circle (0.5); \end{tikzpicture} \\ \pause \textbf{Ovaal:} \begin{minted}{latex} \draw (0,0) ellipse [x radius=1, y radius=0.5] ; \end{minted} & \begin{tikzpicture} \draw (0,0) ellipse [x radius=1, y radius=0.5] ; \end{tikzpicture} \\ \pause \textbf{Rechthoek:} \begin{minted}{latex} \draw (0,0) rectangle (1,1); \end{minted} & % \begin{figure} \begin{tikzpicture} \draw (0,0) rectangle (1,1); \end{tikzpicture} % \caption{Rechthoek} % \end{figure} \\ \pause \textbf{Rooster:} \begin{minted}{latex} \draw [step=.1cm] (0,0) grid (1,1); \end{minted} & \begin{tikzpicture} \draw [step=.2cm] (0,0) grid (1,1); \end{tikzpicture} \end{tabular} \end{frame} \begin{frame}[fragile] \frametitle{Lijndikte, kleur, Gestippeld patroon} In een teken commando kunnen blokhaken gebruikt worden om extra parameters mee te geven. \begin{description} \item[\mintinline{latex}{color=}] Vervang hier de \mintinline{latex}{} met de naam van de kleur. Het is ook mogelijk om je eigen kleur te definieren met het \mintinline{latex}{\definecolor} commando. \item[\mintinline{latex}{}] Vervang \mintinline{latex}{} met \lmint{ultra thin}, \lmint{very thin}, \lmint{thin} (standaard), \lmint{semithick}, \lmint{thick}, \lmint{very thick} of \lmint{ultra thick} \item[\lmint{}] Vervang patroon met \lmint{solid} (standaard), \lmint{dotted} of \lmint{dashed}. Zie 15.3.2 van de handleiding voor nog meer opties. \end{description} \textbf{Voorbeeld:} \begin{minted}{latex} \definecolor{rgb}{mijnRood}{0.9,0.1,0.1} \draw [color=mijnRood, ultra thick, dashed] (0,0) -- (1,0) \end{minted} \end{frame} \begin{frame}[fragile] \frametitle{Vulling} Voor een vulling kan het \lmint{\filldraw} commando gebruikt worden. \begin{tabular}{m{8cm} m{2cm}} \begin{minted}{latex} \filldraw [color=red] (0,0) -- (2,0) -- (2,1) -- cycle; \end{minted} & \begin{tikzpicture} \filldraw [color=red] (0,0) -- (2,0) -- (2,1) -- cycle; \end{tikzpicture} \end{tabular} \pause De \lmint{fill=} parameter kan gebruikt worden om de vulling een andere kleur te geven dan de rand. \begin{tabular}{m{8cm} m{2cm}} \begin{minted}{latex} \filldraw [color=red,fill=orange,ultra thick] (0,0) -- (2,0) -- (2,1) -- cycle; \end{minted} & \begin{tikzpicture} \filldraw [color=red,fill=orange,ultra thick] (0,0) -- (2,0) -- (2,1) -- cycle; \end{tikzpicture} \end{tabular} \pause Om de patterns library te importeren moet \lmint{\usetikzlibrary{patterns}} in de preamble gezet worden. Met \lmint{pattern=} kies je het patroon en met \lmint{pattern color=} kies je de kleur van het patroon. Zie hoofdstuk 62 voor de patronen waar je uit kunt kiezen \begin{tabular}{m{8cm} m{2cm}} \begin{minted}{latex} \filldraw [pattern=bricks, pattern color = orange] (0,0) -- (2,0) -- (2,1) -- cycle; \end{minted} & \begin{tikzpicture} \filldraw [pattern=bricks, pattern color = orange] (0,0) -- (2,0) -- (2,1) -- cycle; \end{tikzpicture} \end{tabular} \end{frame} \begin{frame} \frametitle{Tekst} \begin{tikzpicture}[scale=3,thick] \draw (0,0) -- ({sqrt(3)},0) -- ({sqrt(3)},1) -- cycle; \fill (0,0) circle (0.05); \fill ({sqrt(3)},0) circle (0.05); \fill ({sqrt(3)},1) circle (0.05); \draw (0.5,0) arc [start angle = 0,end angle = 30, radius=0.5]; \draw (0.5,0) arc [start angle = 0,end angle = 30, radius=0.5]; \end{tikzpicture} \end{frame} \end{document}