-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagd-doorsched.sty
63 lines (54 loc) · 1.8 KB
/
agd-doorsched.sty
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
\ProvidesPackage{agd-doorsched}
% Copyright (C) 2013 Andrew Gainer-Dewar <[email protected]>
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.2 of this license or (at your option) any later
% version. The latest version of this license is in:
% http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of
% LaTeX version 1999/12/01 or later.
\usepackage[american]{babel}
\usepackage[margin=1in,letterpaper,landscape]{geometry}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{microtype}
\usepackage{tikz}
% These set the width of a day and the height of an hour.
\newcommand*\daywidth{3.5cm}
\newcommand*\hourheight{3em}
% The entry style will have two options:
% * the first option sets how many hours the entry will be (i.e. its height);
% * the second option sets how many overlapping entries there are (thus
% determining the width).
\tikzset{entry/.style 2 args={
xshift=(0.5334em+0.8pt)/2,
draw,
line width=0.8pt,
font=\sffamily,
rectangle,
rounded corners,
fill=gray!20,
anchor=north west,
inner sep=0.3333em,
text width={\daywidth/#2-1.2em-1.6pt},
minimum height=#1*\hourheight,
align=center
}}
\tikzset{schedule/.style={
y=-\hourheight,
x=\daywidth,
execute at begin picture={
% First print a list of times.
\foreach \time/\ustime in {8/8am,9/9am,10/10am,11/11am,12/12pm,13/1pm,14/2pm,15/3pm,16/4pm,17/5pm}
\node[anchor=north east] at (1,\time) {\ustime};
% Draw some day dividers.
\draw (1,7) -- (1,18);
\draw (2,7) -- (2,18);
\draw (3,7) -- (3,18);
\draw (4,7) -- (4,18);
\draw (5,7) -- (5,18);
\draw (6,7) -- (6,18);
}
}
}