-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanning.sty
More file actions
86 lines (68 loc) · 2.26 KB
/
planning.sty
File metadata and controls
86 lines (68 loc) · 2.26 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% This file is part of eclecTeX, a multi-purpose LaTeX library.
%
% © 2009-2013 Sebastián González Montesinos.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License version 1.3 or later.
%
% This work has the LPPL maintenance status `maintained'.
% The Current Maintainer of this work is Sebastián González.
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{eclectex/planning}
[2014/01/24 v0.0 Planning of activities.]
\ProcessOptions\relax
% ---[ Packages ]---
\RequirePackage{tikz}
% ---[ Configuration ]---
% Package `tikz'
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathreplacing}
% ---[ Commands ]---
\newlength{\weeklen}
\tikzstyle{activity}=
[draw]
\tikzstyle{activitygroup}=
[draw, dashed]
\tikzstyle{timebox}=
[draw, fill=white, inner xsep=0pt, font={\scriptsize}]
\newcommand{\totalactivityunits}{14}
\newcommand{\activitybox}[2]
{\node
[timebox, minimum width=#2*\weeklen,
right=0pt of \prevactbox, anchor=west]
(#1)
%{\pgfmathparse{int(round(#2))}{\pgfmathresult}};
{\pgfmathparse{#2}{\pgfmathresult}};
\node
[below=1pt of #1.south, anchor=north,
font={\scriptsize}]
(#1label)
%{\ref{#1}};
{};
\xdef\prevactbox{#1}}
\newcommand{\activities}[1]
{\xdef\prevactbox{start}%
\xdef\totalduration{0}%
\foreach \activity/\duration/\dependencies in {#1}
{\ifdefvoid{\activity}{}
{\xdef\totalduration{\totalduration+\duration}%
\activitybox{\activity}{\duration}%
\foreach \dependency in \dependencies
{\draw[-latex] (\activity label.south)
.. controls ($(\activity label)+(-1ex,-3ex)$)
and ($(\dependency label)+(1ex,-3ex)$)
.. (\dependency label.south);}}}}
\newcommand{\activitybar}[3][]
{\noindent%
\def\totalunits{#2}%
\deflength{\weeklen}{\linewidth/(\totalunits)}%
\begin{tikzpicture}[x=\linewidth]
\coordinate (start) at (0,0);
\coordinate (end) at (1,0);
\activities{#3}
#1
\end{tikzpicture}}
\newcommand{\drawcategorylabel}[3]
{\draw [decorate, decoration={brace, amplitude=5pt, mirror}]
(#1.west |- #1label.south) -- (#2.east |- #2label.south)
node [midway, yshift=-1em, font=\scriptsize\sffamily] {#3};}