-
Notifications
You must be signed in to change notification settings - Fork 7
/
example-2.19.tex
33 lines (25 loc) · 1022 Bytes
/
example-2.19.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
\documentclass{article}
%% Denote paragraphs with vertical space rather than indenting (not critical)
\usepackage{parskip}
%% Support for URL in introductory text (not needed for main example)
\usepackage{url}
%% *** Enable TikZ ***
\usepackage{tikz}
\begin{document}
%% Introductory Text
Example 2.19 from the book\\
\emph{Unlocking LaTeX Graphics: A Concise Guide to Ti$k$Z/PGF and PGFPLOTS}.\\
For more information, visit \url{https://latex-graphics.com}.
\par\bigskip
%% *** START OF EXAMPLE CODE ***
\begin{tikzpicture}[thick]
\draw[fill=yellow] (0,0) -- (0:2) -- (1,4) coordinate (A) -- cycle;
\fill[radius=2pt] (A) circle
+(10:-1.5) circle coordinate (B)
+(10:1.5) circle coordinate (C);
\draw[black] (B) -- (C) coordinate[pos=0.1] (L) coordinate[pos=0.9] (R);
\draw[fill=red] (L) -- ++(10:0.75) -- ([turn]90:1) -- ([turn]90:0.75) -- cycle;
\draw[fill=blue] (R) -- ++(10:-0.8) -- ([turn]270:0.5) -- ([turn]270:0.8) -- cycle;
\end{tikzpicture}
%% *** END OF EXAMPLE CODE ***
\end{document}