summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/harveyballs/harveyballs.sty
blob: fba6ac5d11e0f8f94e0375dfe88a1c19264da7af (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%%	Harvey Balls for LaTeX
%%	Copyright (C) 2013 Sascha Roth, Technical University Munich
%%
%%	This program is free software: you can redistribute it and/or modify
%%	it under the terms of the GNU General Public License as published by
%%	the Free Software Foundation, either version 3 of the License, or
%%	(at your option) any later version.
%%
%%	This program is distributed in the hope that it will be useful,
%%	but WITHOUT ANY WARRANTY; without even the implied warranty of
%%	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%%	GNU General Public License for more details.
%%
%%	You should have received a copy of the GNU General Public License
%%	along with this program.  If not, see <http://www.gnu.org/licenses/>.
%%


\NeedsTeXFormat{LaTeX2e}[2001/06/01]
\ProvidesPackage{harveyballs}[2013/10/22 Harvey Balls for LaTeX by Sascha Roth, Technical University Munich, sascha.roth@mytum.de]
\RequirePackage{tikz}
%user variables
\def\harveyBallsSize{0.85ex}%size of the harvey balls
\def\harveyBallsLineWidth{0.2pt}%line width of the harvey balls
\def\harveyBallsColor{black}
\def\harveyBallsLineColor{black}

%
\DeclareRobustCommand{\harveyBallNone}[1][\harveyBallsSize]{%
\begin{tikzpicture}%
\draw[draw=\harveyBallsLineColor,line width=\harveyBallsLineWidth] (0,0) circle (#1);%
\end{tikzpicture}%
}%
\DeclareRobustCommand{\harveyBallQuarter}[1][\harveyBallsSize]{%
\begin{tikzpicture}%
\draw[draw=\harveyBallsLineColor,line width=\harveyBallsLineWidth](0,0) circle (#1);%
\fill[fill=\harveyBallsColor] (0,0) -- (#1,0mm) arc (0:90:#1) -- cycle;%
\end{tikzpicture}%
}%
\DeclareRobustCommand{\harveyBallHalf}[1][\harveyBallsSize]{%
\begin{tikzpicture}%
\draw[draw=\harveyBallsLineColor,line width=\harveyBallsLineWidth](0,0) circle (#1);%
 \fill [fill=\harveyBallsColor] (0,0) -- (0mm,#1) arc (90:-90:#1) -- cycle;%
\end{tikzpicture}%
}%
\DeclareRobustCommand{\harveyBallThreeQuarter}[1][\harveyBallsSize]{%
\begin{tikzpicture}%
\draw[draw=\harveyBallsLineColor,line width=\harveyBallsLineWidth](0,0) circle (#1);%
 \fill [fill=\harveyBallsColor] (0,0) -- (0mm,#1) arc (90:-180:#1) -- cycle;%
\end{tikzpicture}%
}%
\DeclareRobustCommand{\harveyBallFull}[1][\harveyBallsSize]{%
\begin{tikzpicture}%
\filldraw[draw=\harveyBallsLineColor,fill=\harveyBallsColor,line width=\harveyBallsLineWidth] (0,0) circle (#1);%
\end{tikzpicture}%
}%