Skip to content

Instantly share code, notes, and snippets.

@dfeng
Created May 15, 2015 20:48
Show Gist options
  • Select an option

  • Save dfeng/028b24d991abc04da3b1 to your computer and use it in GitHub Desktop.

Select an option

Save dfeng/028b24d991abc04da3b1 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usetikzlibrary{positioning, calc}
% \usepackage[minionint, loosequotes, swash]{MinionPro}
% \usepackage{lmodern}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\definecolor{red}{RGB}{205,85,85}
\definecolor{green}{RGB}{34,139,34}
\begin{preview}
\begin{tikzpicture}[scale=0.8]
% draw the background
% \draw [line width=1.5pt, fill=gray!2] (0,0) -- (60:4) -- (4,0) -- cycle;
\coordinate[label=left:Friend $A$] (B) at (0,0);
\coordinate[label=right:Friend $B$] (C) at (4,0);
\coordinate[label=above:You] (A) at (2,3.464);
\coordinate[label=left:{\color{green} friend}](c) at ($ (A)!.5!(B) $);
\coordinate[label=right:{\color{green} friend}] (b) at ($ (A)!.5!(C) $);
\coordinate[label=below:{\color{red} enemy}](a) at ($ (B)!.5!(C) $);
% the triangle
\draw [line width=1.5pt, color=green] (A) -- (B);
\draw [line width=1.5pt, color=red] (B) -- (C);
\draw [line width=1.5pt, color=green] (C) -- (A);
\draw [line width=.5pt] (B) -- (A) -- (C) -- (B);
% label of triad
\node at (barycentric cs:A=1,B=1,C=1) {$t_1$};
\end{tikzpicture}
\end{preview}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment