summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx
blob: 54d302c2820766ef02578bac3c90a0b49d979f4d (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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
% \iffalse meta-comment
%
% Copyright (C) 2011 by Wolfgang Skala
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% 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.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<pgfgantt>\ProvidesPackage{pgfgantt}[2011/11/10 v2.1 Draw Gantt diagrams with TikZ]
%<pgfgantt>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%
%<*driver>
\documentclass[captions=tableheading,cleardoublepage=empty]{scrartcl}
\usepackage[english]{babel}
	\frenchspacing
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[hdivide={2cm,*,5cm}]{geometry}
\usepackage{url}
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}
	\lstset{
		language=[AlLaTeX]TeX,
		basicstyle=\ttfamily,
		texcsstyle=*\color{RoyalBlue},
		keywordstyle=\color{Maroon},
		commentstyle=\itshape\color{black!50},
		columns=fullflexible,
		backgroundcolor=\color{black!5},
		tabsize=2,
		gobble=2,
		frame=tlrb,
		framesep=.25em,
		xleftmargin=.25em,
		xrightmargin=.25em,
		rulecolor=\color{white},
		morekeywords={ganttchart,tikzpicture,tabular},
		moretexcs={
			gantttitle,gantttitlelist,ganttbar,ganttlink,
			ganttlinkedbar,ganttmilestone,ganttlinkedmilestone,ganttgroup,
			ganttset,ganttnewline,textcolor,foreach,
			pgfcalendarweekdayshortname,usetikzlibrary,
			color,rotatebox,definecolor,sfdefault,mddefault,bfdefault,fcolorbox
		},
		escapeinside=`',
		escapebegin=\begin{rmfamily},
		escapeend=\end{rmfamily},
		emph={
			anchor, bar, bulge, canvas, chart, font, group, height, hgrid,
			in, include, incomplete, inline, label, left, link, list, mid, milestone,
			modifier, name, options, peak, peaks, progress, right, rule, shift, slot, style,
			text, time, title, today, tolerance, top, type, unit, vgrid, width, x, xshift, y, yshift
		},
		emphstyle=\color{OliveGreen},
	}
	\lstnewenvironment{texcode}[1][]{\lstset{basicstyle=\small\ttfamily,#1}}{}
\usepackage{doc}
	\setlength\MacroIndent{0pt}
	\setlength\MacroTopsep\parskip
	\setlength\MacrocodeTopsep\medskipamount
	\def\MacroFont{\small\ttfamily}
	\def\theCodelineNo{\sffamily\scriptsize\color{black!50}\arabic{CodelineNo}}
	\setcounter{IndexColumns}{2}
	\def\pack#1{\texttt{#1}}
	\def\main#1{\textit{#1}}
	\def\usage#1{\textbf{#1}}
	\providecommand\marg[1]{{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
	\providecommand\oarg[1]{{\ttfamily[}\meta{#1}{\ttfamily]}}
	\def\PrintDescribeMacro#1{\strut\MacroFont\color{RoyalBlue}\string#1}
	\def\PrintDescribeEnv#1{\strut\MacroFont\color{Maroon}#1}
	\def\PrintDescribeOpt#1{\strut\MacroFont\color{OliveGreen}#1}
	\def\PrintMacroName#1{\strut\MacroFont\color{RoyalBlue}\string#1}
	\def\PrintEnvName#1{\strut\MacroFont\color{Maroon}#1}
	\def\PrintOptName#1{\strut\MacroFont\color{OliveGreen}#1}
	\def\PrintIntMacroName#1{\strut\MacroFont\string#1}

\makeatletter
\def\page@wrindex#1{\if@filesw
        \immediate\write\@indexfile
            {\string\indexentry{#1}%
            {\thepage}}\fi}

\def\SpecialUsageIndex#1{\@bsphack
   {\let\special@index\page@wrindex\SpecialIndex@{#1}{\encapchar usage}}%
   \@esphack}
\def\SpecialEnvIndex#1{\@bsphack\page@wrindex{%
                                      #1\actualchar
                                      {\string\ttfamily\space#1}
                                         (environment)%
                                      \encapchar usage}%
    \page@wrindex{environments:\levelchar#1\actualchar{%
                   \string\ttfamily\space#1}\encapchar
           usage}\@esphack}
\def\SpecialOptIndex#1{\@bsphack\page@wrindex{%
                                      #1\actualchar
                                      {\string\ttfamily\space#1}
                                         (option)%
                                      \encapchar usage}%
    \page@wrindex{options:\levelchar#1\actualchar{%
                   \string\ttfamily\space#1}\encapchar
           usage}\@esphack}
\def\SpecialMainOptIndex#1{\@bsphack\special@index{%
                                      #1\actualchar
                                      {\string\ttfamily\space#1}
                                         (option)%
                                      \encapchar main}%
    \special@index{options:\levelchar#1\actualchar{%
                   \string\ttfamily\space#1}\encapchar
           main}\@esphack}

\def\DescribeOpt{\Describe@Opt}
\def\Describe@Macro#1{\endgroup
              \marginpar{\rlap{\raggedright\PrintDescribeMacro{#1}}}%
              \SpecialUsageIndex{#1}\@esphack\ignorespaces}
\def\Describe@Env#1{\endgroup
              \marginpar{\rlap{\raggedright\PrintDescribeEnv{#1}}}%
              \SpecialEnvIndex{#1}\@esphack\ignorespaces}
\def\Describe@Opt#1{\SpecialOptIndex{#1}\ignorespaces}

\def\macro{\begingroup
   \catcode`\\12
   \MakePrivateLetters \m@cro@ 1}
\def\environment{\begingroup
   \catcode`\\12
   \MakePrivateLetters \m@cro@ 2}
\def\option{\begingroup
   \catcode`\\12
   \MakePrivateLetters \m@cro@ 3}
\def\intmacro{\begingroup
   \catcode`\\12
   \MakePrivateLetters \m@cro@ 4}
\long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist
   \edef\saved@macroname{\string#2}%
  \def\makelabel##1{\rlap{\hskip5pt\hskip\textwidth\hskip\marginparsep##1}}%
  \if@inlabel
    \let\@tempa\@empty \count@\macro@cnt
    \loop \ifnum\count@>\z@
      \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat
    \edef\makelabel##1{\rlap{\hskip5pt\hskip\textwidth\hskip\marginparsep\vtop to\baselineskip
                               {\@tempa\hbox{##1}\vss}}}%
    \advance \macro@cnt \@ne
  \else  \macro@cnt\@ne  \fi
  \edef\@tempa{\noexpand\item[%
     \ifcase #1\or%
       \noexpand\PrintMacroName
     \or
       \noexpand\PrintEnvName
     \or
       \noexpand\PrintOptName
     \or
       \noexpand\PrintIntMacroName
     \fi
     {\string#2}]}%
  \@tempa
  \global\advance\c@CodelineNo\@ne
   \ifcase #1\or%
      \SpecialMainIndex{#2}\nobreak
      \DoNotIndex{#2}%
   \or
      \SpecialMainEnvIndex{#2}\nobreak
   \or
      \SpecialMainOptIndex{#2}\nobreak
   \or
      \SpecialMainIndex{#2}\nobreak
      \DoNotIndex{#2}%
   \fi
  \global\advance\c@CodelineNo\m@ne
  \ignorespaces}
\let\endoption\endmacro
\let\endintmacro\endmacro
\makeatother

\AtBeginDocument{\lstMakeShortInline|}

\begingroup
  \makeatletter
  \def\x\begingroup#1\@nil{%
    \endgroup
    \def\DoNotIndex{%
      \begingroup
      \@makeother\#%
      \@makeother\$%
      \@makeother\%%
      \@makeother\^%
      \@makeother\_%
      \@makeother\~%
      \@makeother\ %
      \@makeother\&%
      #1%
    }%
  }%
\expandafter\x\DoNotIndex\@nil

\usepackage[
	hyperfootnotes=false,
	bookmarksnumbered,%
	bookmarksopen,%
	bookmarksopenlevel=1,%
	breaklinks,%
	linktocpage,%
	pdfborder={0 0 0},%
	pdfhighlight=/N%
]{hyperref}%

\newcommand\keyline[3]{\noindent\DescribeOpt{#1}\texttt{\color{OliveGreen}/pgfgantt/#1}#2\hfill#3\par\noindent\ignorespaces}
\newenvironment{key}[3]{%
	\bigskip%
	\keyline{#1}{#2}{#3}%
}{}
\def\TikZ{Ti\textit{k}Z}

\usepackage{pgfgantt}
\usepackage{pgfcalendar}
\usetikzlibrary{positioning,shadows,shadings}

\EnableCrossrefs
\CodelineIndex
\RecordChanges
\IndexPrologue{\section{Index}Numbers written in bold refer to the page where the corresponding entry is described; numbers in italic refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.}
\GlossaryPrologue{\section{Change History}}

\setkomafont{title}{\rmfamily\bfseries}
\addtokomafont{sectioning}{\rmfamily}
\normalmarginpar
\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>}

\begin{document}
	\DocInput{pgfgantt.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{1163}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \GetFileInfo{pgfgantt.sty}
%
% \DoNotIndex{\@empty,\@ifstar,\@ifundefined,\@tempa,\@tempb,\addtocounter,\anchor,\begin,\begingroup,\bfseries,\breakforeach,\clip,\csname,\def,\draw,\edef,\else,\end,\endcsname,\endgroup,\expandafter,\fi,\foreach,\gdef,\global,\i,\ifcase,\ifnum,\ifx,\itshape,\let,\newcommand,\newcounter,\newenvironment,\newif,\node,\normalcolor,\normalsize,\path,\pgf@x,\pgf@y,\pgfdeclareshape,\pgfkeys,\pgfkeysdef,\pgfkeysdefnargs,\pgfmathparse,\pgfmathresult,\pgfmathsetcounter,\pgfmathsetmacro,\pgfpoint,\pgfpointanchor,\pgfqkeys,\relax,\RequirePackage,\savedanchor,\scriptsize,\setcounter,\small,\stepcounter,\strut,\t,\the,\usetikzlibrary,\value,\x,\xdef}
%
% 
% \title{Drawing Gantt Charts in \LaTeX\\with \TikZ}
% \subtitle{The \texttt{pgfgantt} Package}
% \author{Wolfgang Skala\thanks{Division of Structural Biology, Department of Molecular Biology, University of Salzburg, Austria; \texttt{Wolfgang.Skala@stud.sbg.ac.at}}}
% \date{\fileversion\\\filedate}
% \maketitle
% \changes{v1.0}{2011/03/01}{Initial release}
%
% \begin{abstract}
% The \pack{pgfgantt} package provides the |ganttchart| environment, which draws a Gantt chart within a \TikZ\ picture. The user may add various elements to the chart, namely titles (|\gantttitle|, |\gantttitlelist|), bars (|\ganttbar|), milestones (|\ganttmilestone|), groups (|\ganttgroup|) and different links between these elements (|\ganttlink|). Furthermore, the appearance of the chart elements is highly customizable, owing to a number of keys.
% \end{abstract}
%
% \tableofcontents
%
%
% \section{Introduction}
%
% The \pack{pgfgantt} package allows you to draw Gantt charts in \LaTeX. Thus, you can describe simple project schedules without having to include images produced by external programs. Similar to Martin Kumm's \pack{gantt} package\footnote{\url{http://www.martin-kumm.de/tex_gantt_package.php}} (which inspired \pack{pgfgantt}'s fundamental aspects), \pack{pgfgantt} bases upon the \TikZ\ frontend of \textsc{pgf}\footnote{\url{http://ctan.org/tex-archive/graphics/pgf/}}. Besides, it provides a comprehensive (and portable) alternative to \pack{pst-gantt}\footnote{\url{http://ctan.org/tex-archive/graphics/pstricks/contrib/pst-gantt/}}.
%
% \changes{v1.1}{2011/04/18}{The introduction now clarifies what I mean by ``a current \textsc{pgf} installation''.}
% \pack{pgfgantt} requires a \textit{current} \textsc{pgf} installation. \textbf{\color{red}Note that the version number must at least be 2.10, dated October 25th, 2010.} If you get a lot of errors and \LaTeX\ complains that |\pgfkeysdefnargs| is undefined, your \textsc{pgf} installation is most likely too old. Furthermore, \textbf{\color{red}\pack{pgfgantt} 2.0 and above is not fully downwards compatible. In particular, the syntax of \texttt{\string\ganttlink} has changed.}
%
% \paragraph{Acknowledgements} I would like to thank Petr Po\v s\'ik (Czech Technical University in Prague), Rapha\"el Clifford (University of Bristol) and Holger Karl (Universität Paderborn) for their ideas concerning new features.
%
%
% \section{User Guide}
%
% \subsection{Overview}
%
% To load the package, simply put
% \begin{texcode}
% \usepackage{pgfgantt}
% \end{texcode}
% into the document preamble.
%
% Compare the following code, which demonstrates some commands provided by \pack{pgfgantt}, to the output it produces:
%
% \begin{texcode}
% \begin{ganttchart}{12}
% 	\gantttitle{2011}{12} \\
% 	\gantttitlelist{1,...,12}{1} \\
% 	\ganttgroup{Group 1}{1}{7} \\
% 	\ganttbar{Task 1}{1}{2} \\
% 	\ganttlinkedbar{Task 2}{3}{7} \ganttnewline
% 	\ganttmilestone{Milestone}{7} \ganttnewline
% 	\ganttbar{Final Task}{8}{12}
% 	\ganttlink{elem2}{elem3}
% 	\ganttlink{elem3}{elem4}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}{12}
% 	\gantttitle{2011}{12} \\
% 	\gantttitlelist{1,...,12}{1} \\
% 	\ganttgroup{Group 1}{1}{7} \\
% 	\ganttbar{Task 1}{1}{2} \\
% 	\ganttlinkedbar{Task 2}{3}{7} \ganttnewline
% 	\ganttmilestone{Milestone}{7} \ganttnewline
% 	\ganttbar{Final Task}{8}{12}
% 	\ganttlink{elem2}{elem3}
% 	\ganttlink{elem3}{elem4}
% \end{ganttchart}
% \end{center}
%
% 
% \subsection{Specifying Keys}
%
% \textit{Keys} (sometimes called \textit{options}) modify the output from \pack{pgfgantt}'s commands. You may specify a key in two ways: (1) Pass it to the optional argument present in each command, e.\,g.
% \begin{texcode}
% \ganttbar[bar label font=\bfseries]{Task 1}{1}{2}
% \end{texcode}
% This locally changes a key for the element(s) drawn by that command. (2) Alternatively, specify a key by the \DescribeMacro{\ganttset}|\ganttset|\marg{key=value list} macro, which sets its keys globally (or rather within the current \TeX\ group):
% \begin{texcode}
% \ganttset{bar label font=\bfseries}
% \end{texcode}
% Since \pack{pgfgantt} uses the \pack{pgfkeys} package for key management, all its keys reside in the |/pgfgantt/| path. However, if you set your keys by one of the methods explained above, this path is automatically prepended to each key.
%
% \subsection{The Canvas}
% 
% Let us have a look at the basic anatomy of a Gantt chart and define some common terms. Each \textit{chart} consists of several \textit{elements}, such as titles, bars and connections between bars. Commands that start with |\gantt|\dots\ draw these elements. When specifying start and end \textit{coordinates} for these commands, we use the dimensionless \textit{chart coordinate system}, whose origin lies in the top left corner. Along the $x$-axis, one unit corresponds to one \textit{time slot}; along the $y$-axis, one unit equals one \textit{line}.
%
% The \DescribeEnv{ganttchart}|ganttchart| environment groups several of the element-drawing macros into a single chart:
% \begin{texcode}
% \begin{ganttchart}`\oarg{options}\marg{number of time slots}'
%   `$\cdots$'
% \end{ganttchart}
% \end{texcode}
% The environment has one optional and one mandatory argument. The former specifies the \meta{options} for the chart, the latter indicates the \meta{number of time slots}.\par
% \changes{v2.1}{2011/11/10}{The \texttt{ganttchart} environment may now be used outside a \texttt{tikzpicture}.}
% Although you will often put a |ganttchart| into a |tikzpicture| environment, you may actually use the environment on its own. \pack{pgfgantt} checks whether the chart is surrounded by a |tikzpicture| and adds this environment if necessary.
% 
% \begin{key}{canvas}{=\meta{style}}{initial value: \texttt{fill=white}}
% The |canvas| key changes the appearance of the canvas. \meta{style} is a list of \TikZ\ keys such as |fill|, |draw| or |dashed|. By default, the canvas is a white rectangle with a black frame.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{tikzpicture} % optional
% 	\begin{ganttchart}%
% 			[canvas={fill=yellow!25, draw=blue, dashed, very thick}]{6}
% 		\gantttitle{Title}{6} \\
% 		\ganttbar{}{1}{2} \\
% 		\ganttbar{}{3}{6}
% 	\end{ganttchart}
% \end{tikzpicture} % optional
% \end{texcode}
% \begin{center}
% \begin{tikzpicture} % optional
% 	\begin{ganttchart}%
% 			[canvas={fill=yellow!25, draw=blue, dashed, very thick}]{6}
% 		\gantttitle{Title}{6} \\
% 		\ganttbar{}{1}{2} \\
% 		\ganttbar{}{3}{6}
% 	\end{ganttchart}
% \end{tikzpicture} % optional
% \end{center}
% \end{key}
%
% \begin{key}{x unit}{=\meta{dimension}}{\texttt{.5cm}}
% \keyline{y unit title}{=\meta{dimension}}{\texttt{1cm}}
% \keyline{y unit chart}{=\meta{dimension}}{\texttt{1cm}}
% These keys specify the width of a time slot and the height of title or chart lines, respectively. Typically, the $x/y$-dimension ratio approximates $1:2$, and the line height is equal over the whole chart. Other dimensions are well possible, but you might have to change several spacing-related keys in order to obtain a pleasing chart.
% \changes{v2.0}{2011/10/10}{Completely rewrote the calculation of coordinates.}
% \changes{v2.0}{2011/10/10}{The \texttt{x unit}, \texttt{y unit title} and \texttt{y unit chart} keys now specify the width of time slots and the height of title or chart lines, respectively. Thus, one can draw titles whose height differs from the rest of the chart. Furthermore, the $x$- and $y$-dimensions of the chart are independent of the dimensions of the surrounding \texttt{tikzpicture}.}
%
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[x unit=1cm, y unit title=.6cm, y unit chart=1.5cm]{6}
% 	\gantttitle{Title 1}{6} \\
% 	\gantttitle{Title 2}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[x unit=1cm, y unit title=.6cm, y unit chart=1.5cm]{6}
% 	\gantttitle{Title 1}{6} \\
% 	\gantttitle{Title 2}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{hgrid}{\texttt{[}=\texttt{false}/\texttt{true}/\meta{style list}\texttt{]}}{\texttt{false}}
% \keyline{hgrid style}{=\meta{style}}{\texttt{dotted}}
% \keyline{vgrid}{\texttt{[}=\texttt{false}/\texttt{true}/\meta{style list}\texttt{]}}{\texttt{false}}
% |hgrid| draws a horizontal grid which starts immediately below the last title element. The key can be specified in four different ways: Firstly, |hgrid=false| eliminates the horizontal grid. You may omit this declaration, since it is the default. Secondly, both |hgrid| and |hgrid=true| activate the horizontal grid, which is then drawn in the default style |dotted|. Finally, |hgrid=|\meta{style list} draws the horizontal grid in the given \meta{style list} (see below).
%
% |hgrid style| changes the style of single horizontal grid lines that are drawn with |\ganttnewline[grid]| (see section~\ref{ssc:newline}). The |vgrid| key governs the vertical grid; otherwise, use it exactly like |hgrid|.
% \changes{v2.0}{2011/10/10}{Added style lists for the horizontal and vertical grid.}
% \changes{v2.0}{2011/10/10}{Removed the \texttt{vgrid style} key.}
% 
% \textit{Style lists} allow you to draw the grid lines in different styles. Each style list consists of several \textit{style list items} separated by a comma. A style list item has the general syntax |*{|\meta{n}|}{|\meta{style}|}| and orders the package to repeat the \meta{style} \meta{n}-times. (This syntax is reminiscent of column specifications in a |tabular| environment.) Thus, the list |*2{red}, *1{green}, *{10}{blue, dashed}| instructs \pack{pgfgantt} to draw first two red vertical grid lines, then a green one and finally ten dashed blue lines. If any grid lines remain to be drawn at the end of the list, the package starts again at the beginning of the list.
% 
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[hgrid=true,
% 		vgrid={*2{red}, *1{green}, *{10}{blue, dashed}}]{20}
% 	\gantttitle{Title 1}{20} \\
% 	\ganttbar{}{1}{8} \\
% 	\ganttbar{}{9}{20}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}%
% 		[hgrid=true,
% 		vgrid={*2{red}, *1{green}, *{10}{blue, dashed}}]{20}
% 	\gantttitle{Title 1}{20} \\
% 	\ganttbar{}{1}{8} \\
% 	\ganttbar{}{9}{20}
% \end{ganttchart}
% \end{center}
% 
% In most situations, you can omit the multiplier |*1|. Hence, the following style lists are equal:\\
% |{*1{red}, *1{blue, dashed}}|\\
% |{{red}, {blue, dashed}}|\\
% |{red, {blue, dashed}}|\\
% However, if you wish to use a single style comprising two or more keys for all grid lines, e.\,g. |red, dotted|, you \textit{must} retain the multiplier (i.\,e., |{*1{red, dotted}}|).
%
% \par\bigskip\noindent
% \begin{minipage}[t]{.45\textwidth}
% \begin{texcode}
% % wrong code
% 
% \begin{ganttchart}%
% 		[hgrid=true,
% 		vgrid={{red, dotted}}]{6}
% 	\gantttitle{Title 1}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}\hfill
% \begin{minipage}[t]{.45\textwidth}
% \begin{texcode}
% % correct code
% 
% \begin{ganttchart}%
% 		[hgrid=true,
% 		vgrid={*1{red, dotted}}]{6}
% 	\gantttitle{Title 1}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
%
% \begin{center}
% \begin{ganttchart}%
% 		[hgrid=true,
% 		vgrid={{red, dotted}}]{6}
% 	\gantttitle{Title 1}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \hspace{1cm}
% \begin{ganttchart}%
% 		[hgrid=true,
% 		vgrid={*1{red, dotted}}]{6}
% 	\gantttitle{Title 1}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{center}
%
%
% In a chart with many time slots, drawing vertical grid lines between all of them will lead to a confusing appearance. In such a case, you can pass an appropriate \meta{style list} to |vgrid| in order to draw every second grid line, for example.
% \changes{v1.1}{2011/04/18}{The \texttt{vgrid lines list} key now determines the number of vertical grid lines drawn.}
% \changes{v2.0}{2011/10/10}{Removed the \texttt{vgrid lines list} key, as its behaviour can be simulated by an appropriate \meta{style list} for \texttt{vgrid}.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid={draw=none, dotted}]{12}
% 	\gantttitlelist{1,...,12}{1} \\
% 	\ganttbar{}{1}{4} \\
% 	\ganttbar{}{5}{11}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid={draw=none, dotted}]{12}
% 	\gantttitlelist{1,...,12}{1} \\
% 	\ganttbar{}{1}{4} \\
% 	\ganttbar{}{5}{11}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \changes{v2.0}{2011/10/10}{Removed the \texttt{hgrid shift} and \texttt{last line height} keys.}
% 
% \begin{key}{today}{=\meta{time slot}}{\texttt{none}}
% \keyline{today rule}{=\meta{style}}{\texttt{dashed, line width=1pt}}
% \keyline{today label}{=\meta{text}}{\texttt{TODAY}}
% Sometimes, you may wish to indicate the current day, month or the like on a Gantt chart. In order to do so, pass an integer value to the |today| key, which draws a vertical rule at the corresponding \meta{time slot}. This rule appears in the \meta{style} denoted by |today rule|, while |today label| contains the \meta{text} below the rule.
% \par\bigskip\noindent
% \begin{minipage}[t]{.44\textwidth}
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, today=2]{6}
% 	\gantttitle{Title}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}\hfill
% \begin{minipage}[t]{.54\textwidth}
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, today=3,
% 		today label=\textcolor{blue}%
% 			{Current Week},
% 		today rule={blue, ultra thick}]{6}
% 	\gantttitle{Title}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
%
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, today=2]{6}
% 	\gantttitle{Title}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \hspace{1cm}
% \begin{ganttchart}%
% 		[vgrid, today=3,
% 		today label=\textcolor{blue}%
% 			{Current Week},
% 		today rule={blue, ultra thick}]{6}
% 	\gantttitle{Title}{6} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{center}
% \end{key}
% 
% 
% \subsection{Line Breaks between Chart Elements}
% \label{ssc:newline}
%
% \pack{pgfgantt} does not automatically begin a new line after finishing a \DescribeMacro{\ganttnewline}chart element. Instead, you must insert an explicit line break with |\ganttnewline|. Within a |ganttchart| environment, \DescribeMacro{\\}|\\| is defined as a shortcut for |\ganttnewline|, so that the syntax is reminiscent of \LaTeX's |tabular| enviroment.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[hgrid, vgrid]{6}
% 	\gantttitle{Title 1}{3}
% 	\gantttitle{Title 2}{3} \\
% 	\ganttbar{}{1}{3} \ganttnewline
% 	\ganttbar{}{2}{3}
% 	\ganttbar{}{5}{6}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[hgrid, vgrid]{6}
% 	\gantttitle{Title 1}{3}
% 	\gantttitle{Title 2}{3} \\
% 	\ganttbar{}{1}{3} \ganttnewline
% 	\ganttbar{}{2}{3}
% 	\ganttbar{}{5}{6}
% \end{ganttchart}
% \end{center}
%
% Even if you prefer a canvas without a horizontal grid, you may nevertheless want to separate certain lines by a grid rule. For this purpose, specify the optional argument |[grid]| for |\ganttnewline| (or |\\|), which draws a grid rule in |hgrid style| between the current and the new line. Alternatively, directly give the desired style as optional argument.
% \changes{v2.0}{2011/10/10}{The optional argument of \texttt{\protect\string\ganttnewline} now also takes a style.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[hgrid style=red]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{}{1}{3} \ganttnewline[thick, blue]
% 	\ganttbar{}{4}{5} \\
% 	\ganttbar{}{6}{10} \\[grid]
% 	\ganttbar{}{11}{12}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[hgrid style=red]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{}{1}{3} \ganttnewline[thick, blue]
% 	\ganttbar{}{4}{5} \\
% 	\ganttbar{}{6}{10} \\[grid]
% 	\ganttbar{}{11}{12}
% \end{ganttchart}
% \end{center}
%
%
% \subsection{Titles}
%
% A \textit{title} (comprising one or more lines) at the top of a Gantt chart usually indicates the period of time covered by that chart. For example, the first line could span twelve time slots and display the current year, while the second line could contain twelve elements, each of which corresponds to one month. For these purposes, \pack{pgfgantt} implements two titling commands.
%
% \DescribeMacro{\gantttitle}|\gantttitle| draws a single title element:
% \begin{texcode}
% \gantttitle`\oarg{options}\marg{label}\marg{number of time slots}'
% \end{texcode}
% The \meta{label} appears in the center of the title element, which covers the \meta{number of time slots} starting from the right end of the last title element (or from the beginning of the line, if the title element is the first element in this line). Mostly, you will employ |\gantttitle| for titles that span several time slots.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[hgrid, vgrid]{12}
% 	\gantttitle{2011}{12} \\
% 	\ganttbar{}{1}{4}
% 	\ganttbar{}{6}{11}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[hgrid, vgrid]{12}
% 	\gantttitle{2011}{12} \\
% 	\ganttbar{}{1}{4}
% 	\ganttbar{}{6}{11}
% \end{ganttchart}
% \end{center}
%
% Whenever you want to draw a larger number of title elements that are equal in size and follow a common enumeration scheme, the \DescribeMacro{\gantttitlelist}|\gantttitlelist| macro provides a fast solution:
% \begin{texcode}
% \gantttitlelist`\oarg{options}\marg{pgffor list}\marg{length of each element}'
% \end{texcode}
% This macro generates one title element for each member of the \meta{pgffor list}. The second mandatory argument specifies the \meta{length of each element}. The \TikZ\ manual describes the syntax for the \meta{pgffor list} in more detail, but we will mention two of the most common applications:
% \begin{enumerate}\parskip0pt
% 	\item In order to draw twelve title elements that contain the numbers from 1 to 12 (indicating the months of a year), enter |1,...,12| as the \meta{pgffor} list.
% 	\par\bigskip\noindent
% 	\begin{texcode}
% \begin{ganttchart}[hgrid, vgrid]{12}
% 	\gantttitlelist{1,...,12}{1} \\
% 	\ganttbar{}{1}{3}
% 	\ganttbar{}{5}{12}
% \end{ganttchart}
% 	\end{texcode}
% 	\begin{center}
% \begin{ganttchart}[hgrid, vgrid]{12}
% 	\gantttitlelist{1,...,12}{1} \\
% 	\ganttbar{}{1}{3}
% 	\ganttbar{}{5}{12}
% \end{ganttchart}
% 	\end{center}
% 	Note that we would have obtained the same result if we had written
% 	\begin{texcode}
% \gantttitle{1}{1} \gantttitle{2}{1} `\dots' \gantttitle{12}{1} \\
% 	\end{texcode}
% 	\item In order to draw seven title elements containing the names of the weekdays (e.\,g., ``Mon'' to ``Sun''), we have to change the |title list options| key:\par
% 	\begin{key}{title list options}{=\meta{pgffor options}}{\texttt{var=\string\x, evaluate=\string\x}}
% 	This key changes the \meta{pgffor options} of the |\foreach| command called by |\gantttitlelist|. Again, the \TikZ\ manual is the definitive reference on possible \meta{pgffor options}. There is just one thing to keep in mind: The macro that yields the labels to be printed by |\gantttitlelist| must be called |\x|.
% 	\end{key}\par
% 	The following example shows how you can implement a title line enumerating the days of the week:
% 	\par\bigskip\noindent
% 	\begin{texcode}
% \usepackage{pgfcalendar}
%   `$\cdots$'
% \begin{ganttchart}[hgrid, vgrid, x unit=1cm]{7}
% 	\gantttitlelist[title list options={%
% 			var=\y, evaluate=\y as \x%
% 			using "\pgfcalendarweekdayshortname{\y}"%
% 		}]{0,...,6}{1} \\
% 	\ganttbar{}{1}{4}
% 	\ganttbar{}{6}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[hgrid, vgrid, x unit=1cm]{7}
% 	\gantttitlelist[title list options={%
% 			var=\y, evaluate=\y as \x%
% 			using "\pgfcalendarweekdayshortname{\y}"%
% 		}]{0,...,6}{1} \\
% 	\ganttbar{}{1}{4}
% 	\ganttbar{}{6}{7}
% \end{ganttchart}
% \end{center}
% \end{enumerate}
%
% \begin{key}{title}{=\meta{style}}{\texttt{fill=white}}
% Sets the appearance of a title element.
% \par\bigskip\noindent
% \begin{texcode}
% \usetikzlibrary{shadows}
% \usetikzlibrary{shadings}
%   `$\cdots$'
% \begin{ganttchart}%
% 		[vgrid, canvas={draw=none},
% 		title={fill=blue!20, rounded corners=2mm, drop shadow}]{7}
% 	\gantttitle{First week}{7} \\
% 	\gantttitlelist[title={draw=none, inner color=red}]{1,...,7}{1} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, canvas={draw=none},title={fill=blue!20, rounded corners=2mm, drop shadow}]{7}
% 	\gantttitle{First week}{7} \\
% 	\gantttitlelist[title={draw=none, inner color=red}]{1,...,7}{1} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{title label font}{=\meta{font commands}}{\texttt{\string\small}}
% Selects the font of the text inside a title element. In most cases, you can include font format commands directly in the first mandatory argument of |\gantttitle|. However, you \textit{must} use the |title label font| key if you intend to change the font size. Otherwise, the vertical alignment of the title label will be incorrect with the standard anchor.
% \par\bigskip\noindent
% \begin{minipage}[t]{.49\textwidth}
% \begin{texcode}
% % Wrong alignment
%
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		y unit title=1.3cm]{6}
% 	\gantttitle{%
% 		\LARGE\color{violet}%
% 		\scshape Title}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}\hfill
% \begin{minipage}[t]{.49\textwidth}
% \begin{texcode}
% % Correct alignment
%
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		y unit title=1.3cm,
% 		title label font={\LARGE,
% 		\color{violet},\scshape}]{6}
% 	\gantttitle{Title}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		y unit title=1.3cm]{6}
% 	\gantttitle{%
% 		\LARGE\color{violet}%
% 		\scshape Title}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \hspace{1cm}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		y unit title=1.3cm,
% 		title label font={\LARGE,
% 		\color{violet},\scshape}]{6}
% 	\gantttitle{Title}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{title label anchor}{=\meta{anchor}}{\texttt{anchor=mid}}
% By default, title labels are vertically centered at half their x-height. This yields a good alignment for labels whose letters have equal amounts of ascenders and descenders (e.\,g., lowercase numbers). However, when the letters contain mostly ascenders (e.\,g., uppercase numbers), the label position will appear too high. In this case, you should change the anchor:
% \par\bigskip\noindent
% \begin{minipage}[t]{.44\textwidth}
% \begin{texcode}
% % Badly centered label
%
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		title label font={\LARGE}%
% 		]{6}
% 	\gantttitle{2011}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}\hfill
% \begin{minipage}[t]{.54\textwidth}
% \begin{texcode}
% % Nicely centered label
%
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		title label font={\LARGE},
% 		title label anchor={below=-1.5ex}%
% 		]{6}
% 	\gantttitle{2011}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		title label font={\LARGE}%
% 		]{6}
% 	\gantttitle{2011}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \hspace{1cm}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		title label font={\LARGE},
% 		title label anchor={below=-1.5ex}%
% 		]{6}
% 	\gantttitle{2011}{6} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{6}
% \end{ganttchart}
% \end{center}
% \end{key}
% 
% \begin{key}{title left shift}{=\meta{factor}}{\texttt{0}}
% \keyline{title right shift}{=\meta{factor}}{\texttt{0}}
% \keyline{title top shift}{=\meta{factor}}{\texttt{0}}
% \keyline{title height}{=\meta{factor}}{\texttt{0.6}}
% The first three keys shift the coordinates of a title element's borders (or rather of its corners), while |title height| changes its height. By default, the left upper corner of a title element coincides with the origin of the start time slot; its right lower corner touches the right border of the end time slot $0.6$ units below the upper line border:
%
% \begin{center}
% \begin{tikzpicture}[x=.5cm, y=1cm]
% 	\begin{ganttchart}[vgrid, hgrid]{6}
% 		\gantttitle{2011}{6} \\
% 		\ganttbar{}{1}{2}
% 		\ganttbar{}{4}{6}
% 	\end{ganttchart}
% 	\small
% 	\draw[blue, line width=1.5pt, dashed] (0,0) rectangle (1,-1);
% 	\draw[teal, line width=1.5pt, dashed] (5,0) rectangle (6,-1);
% 	\fill[red] (0,0) circle (1.5pt) node[above left] {start: $(0, 0)$};
% 	\fill[black!75] (6,-1) circle (1.5pt) node[below right] {$(6, 1)$};
% 	\fill[red] (6,-0.6) circle (1.5pt) node[right] {$(6, 0+0.6)$: stop};
% 	\draw[-latex,blue] (.2,.6) node[above=-4pt] {Start time slot (1)} -- (.5,-.5);
% 	\draw[-latex,teal] (6.2,.1) node[above=-4pt] {End time slot (6)} -- (5.5,-.5);
% \end{tikzpicture}
% \end{center}
% The figure below shows a Gantt chart with two lines and one (large) time slot and indicates the distances modified by these keys.
% \begin{center}
% \begin{tikzpicture}[x=7cm, y=2cm]
% 	\begin{ganttchart}[x unit=7cm, y unit title=2cm, title={line width=1.5pt,fill=yellow!10},title left shift=.2,title right shift=-.3,title top shift=.25, title height=.5]{1}
% 		\gantttitle{}{1} \\
% 	\end{ganttchart}
% 	\small
% 	\draw[densely dashed] (0,-1) -- (1,-1);
% 	\draw[dashed,cyan,line width=1pt] (0,0) rectangle (1,-.6);
% 	\draw[cyan,-latex] (.8,.5) node[right,align=left] {Title element\\with standard values} -- (.75,0);
% 	\fill (0,0) circle (1.5pt) node[left] {$(0,0)$};
% 	\fill (0,-1) circle (1.5pt) node[left] {$(0,1)$};
% 	\fill (1,0) circle (1.5pt) node[right] {$(1,0)$};
% 	\fill (1,-1) circle (1.5pt) node[right] {$(1,1)$};
% 	\draw[-latex,line width=1pt,blue]
% 		(0, -.5) node[align=right,left] {\texttt{title left shift}\\(here: \texttt{0.2})} -- (.2,-.5);
% 	\draw[latex-,line width=1pt,blue]
% 		(.7, -.5) -- (1,-.5) node[align=left,right] {\texttt{title right shift}\\(here: \texttt{-0.3})};
% 	\draw[-latex,line width=1pt,red]
% 		(.45, 0) node[align=left,above] {\texttt{title top shift}\\(here: \texttt{0.25})} -- (.45,-.25);
% 	\draw[-latex,line width=1pt,red]
% 		(.6, -.25) -- (.6,-.75) node[align=left,below] {\texttt{title height}\\(here: \texttt{0.5})};
% \end{tikzpicture}
% \end{center}
% For example, you might devise a layout where the title element does not touch the borders of the start and end time slot.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, title={fill=teal, draw=none},
% 		title label font=\color{white}\bfseries,
% 		title left shift=.1, title right shift=-.1,
% 		title top shift=.05, title height=.75]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, title={fill=teal, draw=none},
% 		title label font=\color{white}\bfseries,
% 		title left shift=.1, title right shift=-.1,
% 		title top shift=.05, title height=.75]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{}{1}{2}
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{include title in canvas}{=\texttt{false}/\texttt{true}}{\texttt{true}}
% The canvas normally comprises all lines of the chart. However, you may wish that your title elements only consist of text lacking any frame or background. In this case, the canvas probably should exclude all lines containing title elements, which you achieve by |include title in canvas=false|.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[hgrid={*1{draw=red, thick}}, vgrid,
% 		title={draw=none, fill=none}, include title in canvas=false]{7}
% 	\gantttitlelist{1,...,7}{1} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}%
% 		[hgrid={*1{draw=red, thick}}, vgrid,
% 		title={draw=none, fill=none}, include title in canvas=false]{7}
% 	\gantttitlelist{1,...,7}{1} \\
% 	\ganttbar{}{1}{3} \\
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{center}
% \end{key}
%
%
% \subsection{Bars}
%
% On a Gantt chart, a \textit{bar} indicates the duration of a task or one of its parts.
% \begin{texcode}
% \ganttbar`\oarg{options}\marg{label}\marg{start time slot}\marg{end time slot}'
% \end{texcode}
% The \DescribeMacro{\ganttbar}|\ganttbar| macro draws a bar from the \meta{start time slot} to the \meta{end time slot} and adds a \meta{label} at the left of the chart.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{3} \\
% 	\ganttbar{Task 2}{4}{10} \\
% 	\ganttbar{Final task}{11}{12}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{3} \\
% 	\ganttbar{Task 2}{4}{10} \\
% 	\ganttbar{Final task}{11}{12}
% \end{ganttchart}
% \end{center}
%
% \begin{key}{time slot modifier}{=\meta{factor}}{\texttt{-1}}
% Note that a bar usually touches the left border of the \meta{start time slot} and not the right, as it would if the \meta{start time slot} were strictly interpreted as an $x$-coordinate. However, you may prefer to work with ``real'' $x$-coordinates instead of time slots. In this case, just set the |time slot modifier| key to zero. This will essentially eliminate the semi-intelligent behavior of \pack{pgfgantt} with respect to the conversion of $x$-coordinates. This feature may prove useful if you decide to use real numbers for some time slots. \changes{v1.1}{2011/04/18}{The \texttt{time slot modifier} key has been added. If set to zero, all $x$-coordinates are interpreted as given, without regarding them as time slots.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, time slot modifier=0]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{0}{3} \\
% 	\ganttbar{Task 2}{3}{10} \\
% 	\ganttbar{Final task}{10}{12}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, time slot modifier=0]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{0}{3} \\
% 	\ganttbar{Task 2}{3}{10} \\
% 	\ganttbar{Final task}{10}{12}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{bar}{=\meta{style}}{\texttt{fill=white}}
% Determines the appearance of the bar.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, bar={fill=red!50}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{3} \\
% 	\ganttbar[bar={fill=yellow, dashed}]{Task 2}{4}{10} \\
% 	\ganttbar[bar={fill=green, draw=none}]{Final task}{11}{12}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, bar={fill=red!50}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{3} \\
% 	\ganttbar[bar={fill=yellow, dashed}]{Task 2}{4}{10} \\
% 	\ganttbar[bar={fill=green, draw=none}]{Final task}{11}{12}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{bar label text}{=\meta{text}}{\texttt{\string\strut\#1}}
% \keyline{bar label font}{=\meta{font commands}}{\texttt{\string\normalsize}}
% \keyline{bar label anchor}{=\meta{anchor}}{\texttt{anchor=east}}
% The |bar label text| key configures the label \meta{text} next to each bar. This key should contain a single parameter token (|#1|), which is replaced by the first mandatory argument of |\ganttbar|. The |\strut| in the standard value ensures equal vertical spacing of the labels. |bar label font| selects the font for the bar label, |bar label anchor| determines its anchor. The last control sequence in \meta{font commands} may take a single argument (like |\textit|). \changes{v1.1}{2011/04/18}{\texttt{bar label text} configures the text of a bar label.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}
% 		[vgrid, hgrid, bar label font=\Large,
% 		bar label text={--#1$\rightarrow$}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar[bar label anchor={left=1cm}]{Task 1}{1}{3} \\
% 	\ganttbar[bar label font=\color{orange}]{Task 2}{4}{10} \\
% 	\ganttbar[bar label font=\MakeUppercase]{Final task}{11}{12}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}
% 		[vgrid, hgrid, bar label font=\Large,
% 		bar label text={--#1$\rightarrow$}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar[bar label anchor={left=1cm}]{Task 1}{1}{3} \\
% 	\ganttbar[bar label font=\color{orange}]{Task 2}{4}{10} \\
% 	\ganttbar[bar label font=\MakeUppercase]{Final task}{11}{12}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{inline}{=\texttt{false}/\texttt{true}}{\texttt{false}}
% \keyline{bar label inline anchor}{=\meta{anchor}}{\texttt{anchor=north}}
% If two or more chart elements appear in a single line, their labels will overlap at the left border of the chart. Thus, you can place the label adjacent to a bar by setting the boolean key |inline| to |true|. This key instructs the package to draw the label at the center of the chart element and use the anchor given by |bar label inline anchor| instead of |bar label anchor|.
% \changes{v2.1}{2011/11/10}{The \texttt{inline} key moves labels close to their respective chart elements.}
% \changes{v2.1}{2011/11/10}{Added three keys (\texttt{bar label inline anchor}, \texttt{group label inline anchor} and \texttt{milestone label inline anchor}) for placing inline labels.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, inline]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{3}
% 	\ganttbar[bar label inline anchor={above}]{Task 2}{5}{10} \\
% 	\ganttbar[inline=false]{Final task}{11}{12}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, inline]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{3}
% 	\ganttbar[bar label inline anchor={above}]{Task 2}{5}{10} \\
% 	\ganttbar[inline=false]{Final task}{11}{12}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{bar left shift}{=\meta{factor}}{\texttt{0}}
% \keyline{bar right shift}{=\meta{factor}}{\texttt{0}}
% \keyline{bar top shift}{=\meta{factor}}{\texttt{0.3}}
% \keyline{bar height}{=\meta{factor}}{\texttt{0.4}}
% The first three keys shift the coordinates of a bar's borders (or rather of its corners), while |bar height| changes its height. By default, the left upper corner of a bar is 0.3 units below the origin of the start time slot; its right lower corner touches the right border of the end time slot $0.4$ units below the upper line border:
%
% \begin{center}
% \begin{tikzpicture}[x=.5cm, y=1cm]
% 	\begin{ganttchart}[vgrid, hgrid]{8}
% 		\gantttitle{Title}{8} \\
% 		\ganttbar{}{2}{7} \\
% 		\ganttbar{}{8}{8}
% 	\end{ganttchart}
% 	\small
% 	\draw[blue, line width=1.5pt, dashed] (1,-1) rectangle (2,-2);
% 	\draw[teal, line width=1.5pt, dashed] (6,-1) rectangle (7,-2);
% 	\fill[black!75] (1,-1) circle (1.5pt) node[above left] {$(1, 1)$};
% 	\fill[black!75] (7,-2) circle (1.5pt) node[below left] {$(7, 2)$};
% 	\fill[red] (1,-1.3) circle (1.5pt) node[left=1pt] {start: $(1, 1+0.3)$};
% 	\fill[red] (7,-1.7) circle (1.5pt) node[right=-1pt] {$(7, 1+0.3+0.4)$: stop};
% 	\draw[-latex,blue] (.2,.2) node[above=-4pt] {Start time slot (2)} -- (1.5,-1.3);
% 	\draw[-latex,teal] (7.2,.1) node[above=-4pt] {End time slot (7)} -- (6.5,-1.3);
% \end{tikzpicture}
% \end{center}
% The figure below shows a Gantt chart with two lines and one (large) time slot and indicates the distances modified by these keys.
% \begin{center}
% \begin{tikzpicture}[x=8cm, y=2cm]
% 	\begin{ganttchart}[x unit=8cm,y unit chart=2cm,bar left shift=.2,bar right shift=-.3,bar top shift=.25, bar height=.5]{1}
% 		\ganttbar[bar={line width=1.5pt,fill=yellow!10}]{}{1}{1} \\
% 	\end{ganttchart}
% 	\small
% 	\draw[densely dashed] (0,-1) -- (1,-1);
% 	\draw[dashed,cyan,line width=1pt] (0,-.3) rectangle (1,-.7);
% 	\draw[cyan,-latex] (.8,.5) node[right,align=left] {Bar with standard values} -- (.75,-.3);
% 	\fill (0,0) circle (1.5pt) node[left] {$(0,0)$};
% 	\fill (0,-1) circle (1.5pt) node[left] {$(0,1)$};
% 	\fill (1,0) circle (1.5pt) node[right] {$(1,0)$};
% 	\fill (1,-1) circle (1.5pt) node[right] {$(1,1)$};
% 	\draw[-latex,line width=1pt,blue]
% 		(0, -.5) node[align=right,left] {\texttt{bar left shift}\\(here: \texttt{0.2})} -- (.2,-.5);
% 	\draw[latex-,line width=1pt,blue]
% 		(.7, -.5) -- (1,-.5) node[align=left,right] {\texttt{bar right shift}\\(here: \texttt{-0.3})};
% 	\draw[-latex,line width=1pt,red]
% 		(.45, 0) node[align=left,above] {\texttt{bar top shift}\\(here: \texttt{0.25})} -- (.45,-.25);
% 	\draw[-latex,line width=1pt,red]
% 		(.6, -.25) -- (.6,-.75) node[align=left,below] {\texttt{bar height}\\(here: \texttt{0.5})};
% \end{tikzpicture}
% \end{center}
% For example, you might devise a layout with small, rounded bars that do not touch the borders of their start and end time slots.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, bar={fill=red, rounded corners=3pt},
% 		bar left shift=.15, bar right shift=-.15,
% 		bar top shift=.4, bar height=.2]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{2} \\
% 	\ganttbar{Task 2}{3}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, bar={fill=red, rounded corners=3pt},
% 		bar left shift=.15, bar right shift=-.15,
% 		bar top shift=.4, bar height=.2]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{2} \\
% 	\ganttbar{Task 2}{3}{7}
% \end{ganttchart}
% \end{center}
% \end{key}
%
%
% \subsection{Groups}
%
% \textit{Groups} subsume several subtasks (represented by bars) into a single task.
% \begin{texcode}
% \ganttgroup`\oarg{options}\marg{label}\marg{start time slot}\marg{end time slot}'
% \end{texcode}
% The \DescribeMacro{\ganttgroup}|\ganttgroup| macro draws a group from the \meta{start time slot} to the \meta{end time slot} and adds a \meta{label} at the left of the chart. Note that a group will start at the left border of the \meta{start time slot} (and not at the right, as it would if the \meta{start time slot} were strictly interpreted as an $x$-coordinate).
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup{Group}{1}{10} \\
% 	\ganttbar{Subtask 1}{1}{3} \\
% 	\ganttbar{Subtask 2}{4}{10}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup{Group}{1}{10} \\
% 	\ganttbar{Subtask 1}{1}{3} \\
% 	\ganttbar{Subtask 2}{4}{10}
% \end{ganttchart}
% \end{center}
%
% \begin{key}{group}{=\meta{style}}{\texttt{fill=black}}
% Changes the appearance of a group.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, group={draw=black, fill=green!50}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup{Group}{1}{10} \\
% 	\ganttbar{Subtasks}{1}{3}
% 	\ganttbar{}{5}{10}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, group={draw=black, fill=green!50}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup{Group}{1}{10} \\
% 	\ganttbar{Subtasks}{1}{3}
% 	\ganttbar{}{5}{10}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{group label text}{=\meta{text}}{\texttt{\string\strut\#1}}
% \keyline{group label font}{=\meta{font commands}}{\texttt{\string\normalsize\string\bfseries}}
% \keyline{group label anchor}{=\meta{anchor}}{\texttt{anchor=east}}
% \keyline{group label inline anchor}{=\meta{anchor}}{\texttt{anchor=north}}
% The |group label text| key configures the label \meta{text} next to each group. This key should contain a single parameter token (|#1|), which is replaced by the first mandatory argument of |\ganttgroup|. The |\strut| in the standard value ensures equal vertical spacing of the labels. |group label font| selects the font of the group label, |group label anchor| determines its anchor. The last control sequence in \meta{font commands} may take a single argument (like |\textit|). The |inline| key moves the label to the center of the group, using the anchor given by |group label inline anchor|. \changes{v1.1}{2011/04/18}{\texttt{group label text} configures the text of a group label.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		group label font={\fcolorbox{brown}{brown!10}},
% 		group label anchor={left=1cm},
% 		group label text={+#1+}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup{Group}{1}{10} \\
% 	\ganttbar{Subtask 1}{1}{3}
% 	\ganttgroup[inline]{Subgroup}{5}{10} \\
% 	\ganttbar{More Subtasks}{5}{7}
% 	\ganttbar{}{9}{10}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		group label font={\fcolorbox{brown}{brown!10}},
% 		group label anchor={left=1cm},
% 		group label text={+#1+}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup{Group}{1}{10} \\
% 	\ganttbar{Subtask 1}{1}{3}
% 	\ganttgroup[inline]{Subgroup}{5}{10} \\
% 	\ganttbar{More Subtasks}{5}{7}
% 	\ganttbar{}{9}{10}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{group left shift}{=\meta{factor}}{\texttt{-0.1}}
% \keyline{group right shift}{=\meta{factor}}{\texttt{0.1}}
% \keyline{group top shift}{=\meta{factor}}{\texttt{0.4}}
% \keyline{group height}{=\meta{factor}}{\texttt{0.2}}
% The first three keys shift the coordinates of a group's borders (or rather of its corners), while |group height| changes its height. By default, the left upper corner of a group is 0.1 units left of and 0.4 units below the start time slot origin; its right lower corner (not counting the peak) lies 0.1 units right of and 0.3 units below the right border of the end time slot:
%
% \begin{center}
% \begin{tikzpicture}[x=.5cm, y=1cm]
% 	\begin{ganttchart}[vgrid, hgrid]{8}
% 		\gantttitle{Title}{8} \\
% 		\ganttgroup{}{2}{6} \\
% 		\ganttbar{}{2}{2}
% 		\ganttbar{}{4}{6}
% 	\end{ganttchart}
% 	\small
% 	\draw[blue, line width=1.5pt, dashed] (1,-1) rectangle (2,-2);
% 	\draw[teal, line width=1.5pt, dashed] (5,-1) rectangle (6,-2);
% 	\fill[black!75] (1,-1) circle (1.5pt) node[above left] {$(1, 1)$};
% 	\fill[black!75] (6,-2) circle (1.5pt) node[below right] {$(6, 2)$};
% 	\fill[red] (.9,-1.4) circle (1.5pt) node[left] {start: $(1-0.1, 1+0.4)$};
% 	\fill[red] (6.1,-1.6) circle (1.5pt) node[right] {$(6+0.1, 1+0.4+0.2)$: stop};
% 	\draw[-latex,blue] (.2,.2) node[above=-4pt] {Start time slot (2)} -- (1.5,-1);
% 	\draw[-latex,teal] (6.2,.1) node[above=-4pt] {End time slot (6)} -- (5.5,-1);
% \end{tikzpicture}
% \end{center}
% The figure below shows a Gantt chart with two lines and one (large) time slot and indicates the distances modified by these keys.
% \begin{center}
% \begin{tikzpicture}[x=7cm, y=2cm]
% 	\begin{ganttchart}[x unit=7cm,y unit chart=2cm,group left shift=.2,group right shift=-.3,group top shift=.25, group height=.3,group peaks={.05}{.1}{.2}]{1}
% 		\ganttgroup[group={draw=black,line width=1.5pt,fill=yellow!10}]{}{1}{1} \\
% 	\end{ganttchart}
% 	\small
% 	\draw[densely dashed] (0,-1) -- (1,-1);
% 	\draw[dashed,cyan,line width=1pt] (-.1,-.4) rectangle (1.1,-.6);
% 	\draw[cyan,-latex] (.8,.5) node[right,align=left] {Group with standard values\\(without peaks)} -- (.75,-.4);
% 	\fill (0,0) circle (1.5pt) node[left] {$(0,0)$};
% 	\fill (0,-1) circle (1.5pt) node[left] {$(0,1)$};
% 	\fill (1,0) circle (1.5pt) node[right] {$(1,0)$};
% 	\fill (1,-1) circle (1.5pt) node[right] {$(1,1)$};
% 	\draw[-latex,line width=1pt,blue]
% 		(0, -.5) node[align=right,left] {\texttt{group left shift}\\(here: \texttt{0.2})} -- (.2,-.5);
% 	\draw[latex-,line width=1pt,blue]
% 		(.7, -.5) -- (1,-.5) node[align=left,right] {\texttt{group right shift}\\(here: \texttt{-0.3})};
% 	\draw[-latex,line width=1pt,red]
% 		(.45, 0) node[align=left,above] {\texttt{group top shift}\\(here: \texttt{0.25})} -- (.45,-.25);
% 	\draw[-latex,line width=1pt,red]
% 		(.55, -.25) -- (.55,-.55) node[align=left,below left=0pt and -10pt] {\texttt{group height}\\(here: \texttt{0.3})};
% \end{tikzpicture}
% \end{center}
% \end{key}
%
% \begin{key}{group left peak}{=\marg{tip x}\marg{groove x}\marg{tip y}}{}
% \keyline{group right peak}{=\marg{tip x}\marg{groove x}\marg{tip y}}{}
% \keyline{group peaks}{=\marg{tip x}\marg{groove x}\marg{tip y}}{\texttt{0.2 0.4 0.1}}
% These keys govern the appearance of the peaks at both ends of a group. By default, the tip of each peak lies 0.2 units inward from a group's bottom corner and 0.1 units beneath, while the groove lies 0.4 units inward. While |group left peak| applies only to the left peak and |group right peak| affects only the right peak, |group peaks| sets the dimensions for both peaks simultaneously. You always have to specify three arguments for these keys. However, if you leave one of them blank, the corresponding space parameter retains its current value.
%
% The figure below exemplifies the space parameters as they apply to the left peak.
% \begin{center}
% \begin{tikzpicture}[x=8cm, y=2cm]
% 	\small
% 	\draw (0,0) rectangle (1,-1.3);
% 	\draw[line width=1.5pt, dashed] (.5,-.2) -- (.7,-.2);
% 	\draw[line width=1.5pt, solid] (.5,-.2) -- (.2,-.2) -- (.2,-.5) -- (.3,-.8) -- (.4,-.5) -- (.5,-.5);
% 	\draw[line width=1.5pt, dashed] (.5,-.5) -- (.7,-.5);
% 	\draw[densely dashed] (.2,-.5) -- (.2,-1.3);
% 	\draw[densely dashed] (.3,-.8) -- (.3,-1.3);
% 	\draw[densely dashed] (.3,-.8) -- (1,-.8);
% 	\fill (0,0) circle (1.5pt) node[left] {$(0,0)$};
% 	\fill (0,-1) circle (1.5pt) node[left] {$(0,1)$};
% 	\fill (1,0) circle (1.5pt) node[right] {$(1,0)$};
% 	\fill (1,-1) circle (1.5pt) node[right] {$(1,1)$};
% 	\draw[-latex,line width=1pt,blue]
% 		(.2, -.5) node[left=-3pt] {\meta{groove x}} -- (.4,-.5);
% 	\draw[-latex,line width=1pt,teal]
% 		(.2, -.9) node[left=-3pt] {\meta{tip x}} -- (.3,-.9);
% 	\draw[-latex,line width=1pt,red]
% 		(.5, -.5) node[below right] {\meta{tip y}} -- (.5,-.8);
% \end{tikzpicture}
% \end{center}
% \end{key}
%
% For example, you might prefer that your groups stay within the start and end time slot, and that the peaks are more acute:
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, group left shift=0, group right shift=0,
% 		group peaks={0}{}{.4}]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttgroup{Group}{1}{7} \\
% 	\ganttbar{Tasks}{1}{2}
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, group left shift=0, group right shift=0,
% 		group peaks={0}{}{.4}]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttgroup{Group}{1}{7} \\
% 	\ganttbar{Tasks}{1}{2}
% 	\ganttbar{}{4}{7}
% \end{ganttchart}
% \end{center}
%
%
% \subsection{Progress Bars and Progress Groups}
%
% \textit{Progress bars} and \textit{progress groups} illustrate the extent to which a (sub-)task has been completed. In order to draw a progress element, you simply specify the |progress| key in the optional argument to the respective standard macro.
% 
% \begin{key}{progress}{=\texttt{none}/\meta{number}}{\texttt{none}}
% \keyline{bar incomplete}{=\meta{style}}{}
% \keyline{group incomplete}{=\meta{style}}{}
% \keyline{incomplete}{=\meta{style}}{\texttt{fill=black!25}}
% The |progress| key specifies that a task (represented by a bar) or a group thereof is \meta{number} percent complete. Starting from the left, \meta{number} percent of the element's area appear in the basic style (i.\,e., |bar| or |group|), while the |bar incomplete| and |group incomplete| keys, respectively, determine the appearance of the remainder. For convenience, the |incomplete| key simultaneously sets the incomplete style for bars and groups.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, bar={fill=green}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup[progress=45]{Group 1}{1}{10} \\
% 	\ganttbar[progress=100]{Subtask 1}{1}{3} \\
% 	\ganttbar[progress=10, bar incomplete={fill=red}]{Subtask 2}{4}{10}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, bar={fill=green}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup[progress=45]{Group 1}{1}{10} \\
% 	\ganttbar[progress=100]{Subtask 1}{1}{3} \\
% 	\ganttbar[progress=10, bar incomplete={fill=red}]{Subtask 2}{4}{10}
% \end{ganttchart}
% \end{center}
% \end{key}
% 
% \begin{key}{progress label text}{=\meta{text}}{\texttt{\#1\string\% complete}}
% \keyline{progress label font}{=\meta{font commands}}{\texttt{\string\scriptsize}}
% \keyline{progress label anchor}{=\meta{anchor}}{\texttt{anchor=west}}
% The |progress label text| key sets the \meta{text} that appears beside each progress element in order to indicate its completeness. This key may contain a single parameter token (|#1|), which is replaced by the value of |progress|. The label is typeset in the |progress label font|. In addition, |progress label anchor| governs its placement. By changing the default value, you may prevent the label from overlapping with other elements of your chart.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, bar={fill=green}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup%
% 			[progress=45, progress label anchor={below=3pt}]%
% 		{Group 1}{1}{10} \\
% 	\ganttbar%
% 			[progress=100, progress label font=\color{green!25!black}\textsf]%
% 		{Subtask 1}{1}{3} \\
% 	\ganttbar%
% 			[progress=10, incomplete={fill=red},
% 			progress label text={$\displaystyle\frac{#1}{100}$}]%
% 		{Subtask 2}{4}{10}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, bar={fill=green}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttgroup%
% 			[progress=45, progress label anchor={below=3pt}]%
% 		{Group 1}{1}{10} \\
% 	\ganttbar%
% 			[progress=100, progress label font=\color{green!25!black}\textsf]%
% 		{Subtask 1}{1}{3} \\
% 	\ganttbar%
% 			[progress=10, incomplete={fill=red},
% 			progress label text={$\displaystyle\frac{#1}{100}$}]%
% 		{Subtask 2}{4}{10}
% \end{ganttchart}
% \end{center}
% \end{key}
%
%
% \subsection{Milestones}
%
% A \textit{milestone} signifies that an important task has been completed or that a crucial goal has been reached.
% \begin{texcode}
% \ganttmilestone`\oarg{options}\marg{label}\marg{time slot}'
% \end{texcode}
% The \DescribeMacro{\ganttmilestone}|\ganttmilestone| macro draws a milestone at the given \meta{time slot} and adds a \meta{label} at the left of the chart.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttmilestone{Milestone}{4} \\
% 	\ganttbar{Task 2}{5}{7}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttmilestone{Milestone}{4} \\
% 	\ganttbar{Task 2}{5}{7}
% \end{ganttchart}
% \end{center}
% Note that the milestone is usually centered on the vertical grid line between its \meta{time slot} and the following one.
%
% \begin{key}{milestone}{=\meta{style}}{\texttt{fill=black}}
% Determines the appearance of the milestone.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		milestone={fill=orange, draw=black, rounded corners=3pt}]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{5} \\
% 	\ganttmilestone{Milestone}{5}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, hgrid,
% 		milestone={fill=orange, draw=black, rounded corners=3pt}]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{5} \\
% 	\ganttmilestone{Milestone}{5}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{milestone label text}{=\meta{text}}{\texttt{\string\strut\#1}}
% \keyline{milestone label font}{=\meta{font commands}}{\texttt{\string\normalsize\string\itshape}}
% \keyline{milestone label anchor}{=\meta{anchor}}{\texttt{anchor=east}}
% \keyline{milestone label inline anchor}{=\meta{anchor}}{\texttt{anchor=north}}
% The |milestone label text| key configures the label \meta{text} next to each milestone. This key should contain a single parameter token (|#1|), which is replaced by the first mandatory argument of |\ganttmilestone|. The |\strut| in the standard value ensures equal vertical spacing of the labels. |milestone label font| sets the font of the milestone label, while |milestone label anchor| determines its placement. The last macro in \meta{font commands} may take a single argument, as we show in the following (somewhat silly) example. The |inline| key moves the label to the center of the group, using the anchor given by |milestone label inline anchor|. \changes{v1.1}{2011/04/18}{\texttt{milestone label text} configures the text of a milestone label.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid]{10}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{5} \\
% 	\ganttmilestone%
% 		[milestone label font=\color{magenta}\rotatebox{30},
% 		milestone label text={#1 !!!}]{Milestone}{5}
% 	\ganttmilestone[inline]{2nd}{7}
% 	\ganttmilestone%
% 		[inline, milestone label inline anchor={below}]{3rd}{9}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid]{10}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{5} \\
% 	\ganttmilestone%
% 		[milestone label font=\color{magenta}\rotatebox{30},
% 		milestone label text={#1 !!!}]{Milestone}{5}
% 	\ganttmilestone[inline]{2nd}{7}
% 	\ganttmilestone%
% 		[inline, milestone label inline anchor={below}]{3rd}{9}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{milestone width}{=\meta{factor}}{\texttt{0.8}}
% \keyline{milestone height}{=\meta{factor}}{\texttt{0.4}}
% \keyline{milestone xshift}{=\meta{factor}}{\texttt{0}}
% \keyline{milestone yshift}{=\meta{factor}}{\texttt{0.5}}
% These keys set the width and height of a milestone and shift the coordinates of its center. By default, a milestone is 0.8 units wide and 0.4 units high. Since the ideal $x$-vector/$y$-vector ratio is $1:2$, the milestone appears square with these settings. Its center lies on the right border and 0.5 units below the top border of its time slot.
%
% \begin{center}
% \begin{tikzpicture}[x=.5cm, y=1cm]
% 	\begin{ganttchart}[vgrid, hgrid]{7}
% 		\gantttitle{Title}{7} \\
% 		\ganttmilestone{}{4} \\
% 	\end{ganttchart}
% 	\small
% 	\draw[teal, line width=1.5pt, dashed] (3,-1) rectangle (4,-2);
% 	\fill[red] (4,-1.5) circle (1.5pt) node[right=7pt] {center: $(4+0, 1+0.5)$};
% 	\draw[-latex, teal] (1.8,.2) node[above=-4pt] {Time slot (4)} -- (3.5,-1);
% \end{tikzpicture}
% \end{center}
% The figure below shows a Gantt chart with a single milestone and two (large) time slots; it indicates the distances modified by the four keys explained above.
% \begin{center}
% \begin{tikzpicture}[x=4cm, y=2cm]
% 	\begin{ganttchart}[x unit=4cm,y unit chart=2cm,milestone width=0.4, milestone height=0.7, milestone xshift=-.2, milestone yshift=.5]{2}
% 		\ganttmilestone[milestone={draw=black,line width=1.5pt,fill=yellow!10}]{}{1} \\
% 	\end{ganttchart}
% 	\small
% 	\draw[densely dashed] (0,-1) -- (2,-1);
% 	\draw[densely dashed] (1,0) -- (1,-1.7);
% 	\draw[dashed, cyan, line width=1pt] (1,-.3) -- (1.4, -0.5) -- (1, -0.7) -- (0.6, -0.5) --cycle;
% 	\draw[cyan,-latex] (.8,.3) node[above] {Milestone with standard values} -- (.75,-.4);
% 	\draw[dashdotted] (.8, -.5) -- (.8, -1.5);
% 	\draw[dashdotted] (.8, -.5) -- (1.5, -.5);
% 	\fill[red] (.8,-.5) circle (1.5pt);
% 	\fill (0,0) circle (1.5pt) node[left] {$(0,0)$};
% 	\fill (0,-1) circle (1.5pt) node[left] {$(0,1)$};
% 	\fill (1,0) circle (1.5pt) node[above] {$(1,0)$};
% 	\fill (1,-1) circle (1.5pt) node[below right] {$(1,1)$};
% 	\fill (2,0) circle (1.5pt) node[above right] {$(2,0)$};
% 	\fill (2,-1) circle (1.5pt) node[right] {$(2,1)$};
% 	\draw[latex-, line width=1pt, blue]
% 		(0.8, -1.5) node[align=left, below] {\texttt{milestone xshift}\\(here: \texttt{-0.2})} -- (1,-1.5);
% 	\draw[-latex, line width=1pt, blue]
% 		(1.4, 0) -- (1.4,-.5) node[align=left, above right] {\texttt{milestone yshift}\\(here: \texttt{0.5})};
% 	\draw[latex-latex, line width=1pt, red]
% 		(.6, -.9) node[align=left, below=4pt] {\texttt{milestone width}\\(here: \texttt{0.4})} -- (1,-.9);
% 	\draw[latex-latex, line width=1pt, red]
% 		(.6, -.15) node[align=right, below left=5pt] {\texttt{milestone height}\\(here: \texttt{0.7})} -- (.6,-.85);
% \end{tikzpicture}
% \end{center}
% \end{key}
%
%
% \subsection{Links}
%
% \changes{v2.0}{2011/10/10}{The syntax of \texttt{\protect\string\ganttlink} was completely changed. The command now takes one optional and \textit{two} mandatory arguments. The latter specify the name of the chart elements to be linked. Consequently, the keys \texttt{b-b}, \texttt{b-m}, \texttt{m-b} and \texttt{m-m} were removed. The keys \texttt{s-s}, \texttt{s-f}, \texttt{f-s} and \texttt{f-f} are now values for the \texttt{link type} key.}
% So far, we have drawn charts whose elements were quite independent of each other. However, relations or \textit{links} between these elements frequently appear on real Gantt charts. For example, a task may only start if a previous one has been completed, or finishing a task may constitute a milestone.
% \begin{texcode}
% \ganttlink`\oarg{options}\marg{start element name}\marg{end element name}'
% \end{texcode}
% 
% \begin{key}{name}{=\meta{name}}{\texttt{}}
% The \DescribeMacro{\ganttlink}|\ganttlink| macro connects two elements, which are specified by their \meta{name}s. By default, chart elements are named automatically: The first one receives the name |elem0|, the second one is called |elem1| and so on. However, the |name| key allows you to assign a name to each chart element.
% \par\bigskip\noindent
% \begin{minipage}[t]{.44\textwidth}
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttbar{Task 2}{5}{7} \\
% 	\ganttbar{Task 3}{10}{12}
% 	\ganttlink{elem0}{elem1}
% 	\ganttlink{elem1}{elem2}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}\hfill
% \begin{minipage}[t]{.44\textwidth}
% \begin{texcode}
% \begin{ganttchart}%
% 		[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar[name=b1]%
% 		{Task 1}{1}{4} \\
% 	\ganttbar[name=b2]%
% 		{Task 2}{5}{7} \\
% 	\ganttbar[name=xyz]%
% 		{Task 3}{10}{12}
% 	\ganttlink{b1}{b2}
% 	\ganttlink{b2}{xyz}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar[name=b1]%
% 		{Task 1}{1}{4} \\
% 	\ganttbar[name=b2]%
% 		{Task 2}{5}{7} \\
% 	\ganttbar[name=xyz]%
% 		{Task 3}{10}{12}
% 	\ganttlink{b1}{b2}
% 	\ganttlink{b2}{xyz}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{link}{=\meta{style}}{\texttt{-latex, rounded corners=1pt}}
% Sets the appearance of the link.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, link={[-to, line width=1pt, blue}]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttbar{Task 2}{5}{7}
% 	\ganttlink{elem0}{elem1}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, link={[-to, line width=1pt, blue}]{7}
% 	\gantttitle{Title}{7} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttbar{Task 2}{5}{7}
% 	\ganttlink{elem0}{elem1}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% \begin{key}{link type}{=\meta{type}}{\texttt{arrow}}
% Link types fall into two categories:
% \begin{enumerate}\parskip0pt
% 	\item \textit{Arrow-like links} are the default. As you can see from the examples above, they consist of three segments (two horizontal, one vertical) if their start and end time slots are sufficiently separated. Otherwise, they comprise five segments (three horizontal, two vertical). Three keys further modify the appearance of arrow-like links:
%
% \begin{key}{link mid}{=\meta{factor}}{\texttt{0.5}}
% The |link mid| key changes the position of the single vertical segment (in three-part links) or of the middle horizontal segment (in five-part links). By default, these segments are horizontally centered between the left and the right vertical segment, or vertically centered between the upper and the lower horizontal segment, respectively.\par\bigskip
% \keyline{link bulge}{=\meta{factor}}{\texttt{0.4}}
% In five-part links, the upper and lower vertical segments are shifted along the $x$-axis by $+$|link bulge| and $-$|link bulge|, respectively.\par\bigskip
% \keyline{link tolerance}{=\meta{factor}}{\texttt{0.6}}
% This key governs whether \pack{pgfgantt} draws a five- or a three-part link. If the true $x$-coordinates of the link start and end differ by at least |link tolerance| (this is the case for the second link in the example below), the package draws a five-part link.\changes{v1.1}{2011/04/18}{\texttt{link tolerance} decides whether a five- or a three-part link is drawn.}
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, link mid=.25, link bulge=1.3]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttbar{Task 2}{5}{7} \\
% 	\ganttbar{Task 3}{10}{12}
% 	\ganttlink{elem0}{elem1}
% 	\ganttlink[link mid=.8]{elem1}{elem2}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, link mid=.25, link bulge=1.3]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttbar{Task 2}{5}{7} \\
% 	\ganttbar{Task 3}{10}{12}
% 	\ganttlink{elem0}{elem1}
% 	\ganttlink[link mid=.8]{elem1}{elem2}
% \end{ganttchart}
% \end{center}
% \end{key}
%
% 	\item \textit{Straight links} are only meant for connecting two bars in order to establish start-to-finish relations (|s-f|), start-to-start relations (|s-s|) etc. Their \meta{type} identifiers commemorate the syntax for specifying arrow tips in \TikZ: Each identifier is composed of two letters separated by a hyphen.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid, link={-latex, red}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{2}{3} \\
% 	\ganttbar{Task 2}{2}{5} \\
% 	\ganttbar{Task 3}{6}{11} \\
% 	\ganttbar{Task 4}{8}{11}
% 	\ganttlink[link type=s-s]{elem0}{elem1}
% 	\ganttlink[link type=f-s]{elem1}{elem2}
% 	\ganttlink[link type=f-f]{elem2}{elem3}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid, link={-latex, red}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{2}{3} \\
% 	\ganttbar{Task 2}{2}{5} \\
% 	\ganttbar{Task 3}{6}{11} \\
% 	\ganttbar{Task 4}{8}{11}
% 	\ganttlink[link type=s-s]{elem0}{elem1}
% 	\ganttlink[link type=f-s]{elem1}{elem2}
% 	\ganttlink[link type=f-f]{elem2}{elem3}
% \end{ganttchart}
% \end{center}
%
% \begin{key}{link label}{=\marg{link type key}\marg{label text}}{(miscellaneous)}
% \keyline{link label font}{=\meta{font}}{\texttt{\string\scriptsize\string\itshape\string\normalcolor}}
% \keyline{link label anchor}{=\meta{anchor}}{\texttt{anchor=west}}
% Since straight links all look the same, a label indicates the respective relationship. You can redefine these labels with the |link label| key, which changes the \meta{label text} for a \meta{link type key}.
% 
% The |link label font| key specifies the font for the label, |link label anchor| determines its placement (by default, the label appears to the right of the straight link's center).
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid,
% 		link label font=\small\color{purple}\textbf,
% 		link label={f-s}{f$\to$s}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{2}{3} \\
% 	\ganttbar{Task 2}{2}{5} \\
% 	\ganttbar{Task 3}{6}{11} \\
% 	\ganttbar{Task 4}{8}{11} \\
% 	\ganttbar{Task 5}{4}{7}
% 	\ganttlink[link type=s-s]{elem0}{elem1}
% 	\ganttlink[link type=f-s]{elem1}{elem2}
% 	\ganttlink[link type=f-f, link label anchor={anchor=east}]%
% 		{elem2}{elem3}
% 	\ganttlink[link type=s-f, link label anchor={anchor=base}]%
% 		{elem3}{elem4}
% \end{ganttchart}
% \end{texcode}
% \begin{center}
% \begin{ganttchart}[vgrid, hgrid,
% 		link label font=\small\color{purple}\textbf,
% 		link label={f-s}{f$\to$s}]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{2}{3} \\
% 	\ganttbar{Task 2}{2}{5} \\
% 	\ganttbar{Task 3}{6}{11} \\
% 	\ganttbar{Task 4}{8}{11} \\
% 	\ganttbar{Task 5}{4}{7}
% 	\ganttlink[link type=s-s]{elem0}{elem1}
% 	\ganttlink[link type=f-s]{elem1}{elem2}
% 	\ganttlink[link type=f-f, link label anchor={anchor=east}]%
% 		{elem2}{elem3}
% 	\ganttlink[link type=s-f, link label anchor={anchor=base}]%
% 		{elem3}{elem4}
% \end{ganttchart}
% \end{center}
% \end{key}
% \end{enumerate}
% \end{key}
%
%
% \subsection{Linked Bars and Linked Milestones}
%
% Since you'll most likely draw a lot of arrow-like links between bars and milestones, \pack{pgfgantt} provides two convenient shortcuts for these tasks:
% \begin{texcode}
% \ganttlinkedbar`\oarg{options}\marg{label}\marg{start time slot}\marg{end time slot}'
% \ganttlinkedmilestone`\oarg{options}\marg{label}\marg{time slot}'
% \end{texcode}
% These \DescribeMacro{\ganttlinkedbar}macros work exactly like the standard versions, but they additionally draw a link from the previous \DescribeMacro{\ganttlinkedmilestone}element to the bar or milestone. In the following example, the code on the left is equivalent to the code on the right.

% \begingroup\lstset{alsoletter={-}}
% \begin{minipage}[t]{.49\textwidth}
% \begin{texcode}
% % Short version
% 
% \begin{ganttchart}%
% 		[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttlinkedbar{Task 2}{5}{6} \\
% 	\ganttlinkedmilestone{M 1}{6} \\
% 	\ganttlinkedbar{Task 3}{7}{11}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}\hfill
% \begin{minipage}[t]{.47\textwidth}
% \begin{texcode}
% % Long version
% 
% \begin{ganttchart}%
% 		[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttbar{Task 2}{5}{6} \\
% 	\ganttmilestone{M 1}{6} \\
% 	\ganttbar{Task 3}{7}{11}
% 	\ganttlink{elem0}{elem1}
% 	\ganttlink{elem1}{elem2}
% 	\ganttlink{elem2}{elem3}
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
%
% \begin{center}
% \begin{ganttchart}%
% 		[vgrid, hgrid]{12}
% 	\gantttitle{Title}{12} \\
% 	\ganttbar{Task 1}{1}{4} \\
% 	\ganttlinkedbar{Task 2}{5}{6} \\
% 	\ganttlinkedmilestone{M 1}{6} \\
% 	\ganttlinkedbar{Task 3}{7}{11}
% \end{ganttchart}
% \end{center}
% \endgroup
%
%
% \subsection{Style Examples}
%
% The first example plays around with colors and notably uses equal $x$- and $y$-vectors.
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}%
% 		[y unit title=0.4cm,
% 		y unit chart=0.5cm,
% 		vgrid,
% 		title={draw=none, fill=RoyalBlue!50!black},
% 		title label font=\sffamily\bfseries\color{white},
% 		title label anchor={below=-1.6ex},
% 		title left shift=.05,
% 		title right shift=-.05,
% 		title height=1,
% 		bar={draw=none, fill=OliveGreen!75},
% 		bar height=.6,
% 		bar label font=\normalsize\color{black!50},
% 		group right shift=0,
% 		group top shift=.6,
% 		group height=.3,
% 		group peaks={}{}{.2},
% 		incomplete={fill=Maroon}]{16}
% 	\gantttitle{2010}{4}
% 	\gantttitle{2011}{12} \\
% 	\ganttbar%
% 			[progress=100, progress label font=\small\color{OliveGreen!75},
% 			progress label anchor={right=4pt},
% 			bar label font=\normalsize\color{OliveGreen},
% 			name=pp]%
% 		{Preliminary Project}{1}{4} \\
% 	\ganttset{progress label text={}, link={black, -to}}
% 	\ganttgroup{Objective 1}{5}{16} \\
% 	\ganttbar[progress=4, name=T1A]{Task A}{5}{10} \\
% 	\ganttlinkedbar[progress=0]{Task B}{11}{16} \\
% 	\ganttgroup{Objective 2}{5}{16} \\
% 	\ganttbar[progress=15, name=T2A]{Task A}{5}{13} \\
% 	\ganttlinkedbar[progress=0]{Task B}{14}{16} \\
% 	\ganttgroup{Objective 3}{9}{12} \\
% 	\ganttbar[progress=0]{Task A}{9}{12}
% 	\ganttset{link={OliveGreen}}
% 	\ganttlink[link mid=.4]{pp}{T1A}
% 	\ganttlink[link mid=.159]{pp}{T2A}
% \end{ganttchart}
% \end{texcode}
% 
% \begin{center}
% \begin{ganttchart}%
% 		[y unit title=0.4cm,
% 		y unit chart=0.5cm,
% 		vgrid,
% 		title={draw=none, fill=RoyalBlue!50!black},
% 		title label font=\sffamily\bfseries\color{white},
% 		title label anchor={below=-1.6ex},
% 		title left shift=.05,
% 		title right shift=-.05,
% 		title height=1,
% 		bar={draw=none, fill=OliveGreen!75},
% 		bar height=.6,
% 		bar label font=\normalsize\color{black!50},
% 		group right shift=0,
% 		group top shift=.6,
% 		group height=.3,
% 		group peaks={}{}{.2},
% 		incomplete={fill=Maroon}]{16}
% 	\gantttitle{2010}{4}
% 	\gantttitle{2011}{12} \\
% 	\ganttbar%
% 			[progress=100, progress label font=\small\color{OliveGreen!75},
% 			progress label anchor={right=4pt},
% 			bar label font=\normalsize\color{OliveGreen},
% 			name=pp]%
% 		{Preliminary Project}{1}{4} \\
% 	\ganttset{progress label text={}, link={black, -to}}
% 	\ganttgroup{Objective 1}{5}{16} \\
% 	\ganttbar[progress=4, name=T1A]{Task A}{5}{10} \\
% 	\ganttlinkedbar[progress=0]{Task B}{11}{16} \\
% 	\ganttgroup{Objective 2}{5}{16} \\
% 	\ganttbar[progress=15, name=T2A]{Task A}{5}{13} \\
% 	\ganttlinkedbar[progress=0]{Task B}{14}{16} \\
% 	\ganttgroup{Objective 3}{9}{12} \\
% 	\ganttbar[progress=0]{Task A}{9}{12}
% 	\ganttset{link={OliveGreen}}
% 	\ganttlink[link mid=.4]{pp}{T1A}
% 	\ganttlink[link mid=.159]{pp}{T2A}
% \end{ganttchart}
% \end{center}
%
% \bigskip
% The second example demonstrates that \pack{pgfgantt} is really flexible: Even an appearance quite different from the standard layout is possible. (More precisely, the code below tries to reproduce the Gantt chart from the English Wikipedia site, see \url{http://en.wikipedia.org/wiki/Gantt_chart}.)
% \par\bigskip\noindent
% \begin{texcode}
% \definecolor{barblue}{RGB}{153,204,254}
% \definecolor{groupblue}{RGB}{51,102,254}
% \definecolor{linkred}{RGB}{165,0,33}
% \renewcommand\sfdefault{phv}
% \renewcommand\mddefault{mc}
% \renewcommand\bfdefault{bc}
% \sffamily
% \begin{ganttchart}%
% 		[canvas={fill=none, draw=black!5, line width=.75pt},
% 		hgrid style={draw=black!5, line width=.75pt},
% 		vgrid={*1{draw=black!5, line width=.75pt}},
% 		today=7.1,
% 		today rule={draw=black!64,
% 			dash pattern=on 3.5pt off 4.5pt, line width=1.5pt},
% 		today label={\small\bfseries TODAY},
% 		title={draw=none, fill=none},
% 		title label font=\bfseries\footnotesize,
% 		title label anchor={below=7pt},
% 		include title in canvas=false,
% 		bar label font=\mdseries\small\color{black!70},
% 		bar label anchor={left=2cm},
% 		bar={draw=none, fill=black!63},
% 		bar incomplete={fill=barblue},
% 		progress label font=\mdseries\footnotesize\color{black!70},
% 		group incomplete={fill=groupblue},
% 		group left shift=0,
% 		group right shift=0,
% 		group height=.5,
% 		group peaks={0}{}{},
% 		group label anchor={left=.6cm},
% 		link={-latex, line width=1.5pt, linkred},
% 		link label font=\scriptsize\bfseries\color{linkred}\MakeUppercase,
% 		link label anchor={below left=-2pt and 0pt}
% 		]{13}
% 	\gantttitle[title label anchor={below left=7pt and -3pt}]%
% 		{WEEKS:\quad1}{1}
% 	\gantttitlelist{2,...,13}{1} \\
% 	\ganttgroup[progress=57, progress label font=\bfseries\small]%
% 		{WBS 1 Summary Element 1}{1}{10} \\
% 	\ganttbar[progress=75, name=WBS1A]%
% 		{\textbf{WBS 1.1} Activity A}{1}{8} \\
% 	\ganttbar[progress=67, name=WBS1B]%
% 		{\textbf{WBS 1.2} Activity B}{1}{3} \\
% 	\ganttbar[progress=50, name=WBS1C]%
% 		{\textbf{WBS 1.3} Activity C}{4}{10} \\
% 	\ganttbar[progress=0, name=WBS1D]%
% 		{\textbf{WBS 1.4} Activity D}{4}{10} \\[grid]
% 	\ganttgroup[progress=0, progress label font=\bfseries\small]%
% 		{WBS 2 Summary Element 2}{4}{10} \\
% 	\ganttbar[progress=0]{\textbf{WBS 2.1} Activity E}{4}{5} \\
% 	\ganttbar[progress=0]{\textbf{WBS 2.2} Activity F}{6}{8} \\
% 	\ganttbar[progress=0]{\textbf{WBS 2.3} Activity G}{9}{10}
% 	\ganttlink[link type=s-s]{WBS1A}{WBS1B}
% 	\ganttlink[link type=f-s]{WBS1B}{WBS1C}
% 	\ganttlink[link type=f-f, link label anchor={left}]{WBS1C}{WBS1D}
% \end{ganttchart}
% \end{texcode}
% 
% \begin{center}
% \definecolor{barblue}{RGB}{153,204,254}
% \definecolor{groupblue}{RGB}{51,102,254}
% \definecolor{linkred}{RGB}{165,0,33}
% \renewcommand\sfdefault{phv}
% \renewcommand\mddefault{mc}
% \renewcommand\bfdefault{bc}
% \sffamily
% \begin{ganttchart}%
% 		[canvas={fill=none, draw=black!5, line width=.75pt},
% 		hgrid style={draw=black!5, line width=.75pt},
% 		vgrid={*1{draw=black!5, line width=.75pt}},
% 		today=7.1,
% 		today rule={draw=black!64,
% 			dash pattern=on 3.5pt off 4.5pt, line width=1.5pt},
% 		today label={\small\bfseries TODAY},
% 		title={draw=none, fill=none},
% 		title label font=\bfseries\footnotesize,
% 		title label anchor={below=7pt},
% 		include title in canvas=false,
% 		bar label font=\mdseries\small\color{black!70},
% 		bar label anchor={left=2cm},
% 		bar={draw=none, fill=black!63},
% 		bar incomplete={fill=barblue},
% 		progress label font=\mdseries\footnotesize\color{black!70},
% 		group incomplete={fill=groupblue},
% 		group left shift=0,
% 		group right shift=0,
% 		group height=.5,
% 		group peaks={0}{}{},
% 		group label anchor={left=.6cm},
% 		link={-latex, line width=1.5pt, linkred},
% 		link label font=\scriptsize\bfseries\color{linkred}\MakeUppercase,
% 		link label anchor={below left=-2pt and 0pt}
% 		]{13}
% 	\gantttitle[title label anchor={below left=7pt and -3pt}]%
% 		{WEEKS:\quad1}{1}
% 	\gantttitlelist{2,...,13}{1} \\
% 	\ganttgroup[progress=57, progress label font=\bfseries\small]%
% 		{WBS 1 Summary Element 1}{1}{10} \\
% 	\ganttbar[progress=75, name=WBS1A]%
% 		{\textbf{WBS 1.1} Activity A}{1}{8} \\
% 	\ganttbar[progress=67, name=WBS1B]%
% 		{\textbf{WBS 1.2} Activity B}{1}{3} \\
% 	\ganttbar[progress=50, name=WBS1C]%
% 		{\textbf{WBS 1.3} Activity C}{4}{10} \\
% 	\ganttbar[progress=0, name=WBS1D]%
% 		{\textbf{WBS 1.4} Activity D}{4}{10} \\[grid]
% 	\ganttgroup[progress=0, progress label font=\bfseries\small]%
% 		{WBS 2 Summary Element 2}{4}{10} \\
% 	\ganttbar[progress=0]{\textbf{WBS 2.1} Activity E}{4}{5} \\
% 	\ganttbar[progress=0]{\textbf{WBS 2.2} Activity F}{6}{8} \\
% 	\ganttbar[progress=0]{\textbf{WBS 2.3} Activity G}{9}{10}
% 	\ganttlink[link type=s-s]{WBS1A}{WBS1B}
% 	\ganttlink[link type=f-s]{WBS1B}{WBS1C}
% 	\ganttlink[link type=f-f, link label anchor={left}]{WBS1C}{WBS1D}
% \end{ganttchart}
% \end{center}
%
% 
% \StopEventually{\PrintIndex\PrintChanges}
% \lstDeleteShortInline|
% \MakeShortVerb{\|}
% \clearpage\section{Implementation}
%
%
% \subsection{Packages}
%
% \pack{pgfgantt} is modest in terms of dependencies: It only requires the \TikZ\ package and some of its libraries.
%
% \iffalse
%<*pgfgantt>
% \fi
%    \begin{macrocode}
\RequirePackage{tikz}
  \usetikzlibrary{arrows,backgrounds,calc,patterns,positioning}

%    \end{macrocode}
%
% \subsection{Global Counters and Booleans}
%
% We define a number of global counters: |gtt@width| equals the number of time slots. |gtt@currentline| holds the current line; it starts from 0 and decreases. |gtt@lasttitleline| equals the line of the title element drawn last. Furthermore, |gtt@lasttitleslot| corresponds to the $x$-coordinate of its right border. |gtt@elementid| enumerates the automatic names of chart elements. |gtt@currgrid| is the index of the current grid line drawn.
%    \begin{macrocode}
\newcounter{gtt@width}
\newcounter{gtt@currentline}
\newcounter{gtt@lasttitleline}
\newcounter{gtt@lasttitleslot}
\newcounter{gtt@elementid}
\newcounter{gtt@currgrid}
%    \end{macrocode}
% \begin{intmacro}{\gtt@lastelement}\begin{intmacro}{\gtt@currentelement}\begin{intmacro}{\ifgtt@intitle}
% The macros |\gtt@lastelement| and |\gtt@currentelement| save the name of the current and last chart element drawn. Thereby, the |\ganttlinked...| macros can add a link connecting them.
%
% The boolean |\ifgtt@intitle| is true at the start of a |ganttchart| environment and set to false as soon as the first non-title element is encountered.
%    \begin{macrocode}
\def\gtt@lastelement{}
\def\gtt@currentelement{}
\newif\ifgtt@intitle

%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{intmacro}
%
%
% \subsection{Macros for Key Management}
%
% \begin{macro}{\ganttset}
% |\ganttset| changes the current key path to |/pgfgantt/| and then executes the keys in its mandatory argument.
%    \begin{macrocode}
\def\ganttset#1{\pgfqkeys{/pgfgantt}{#1}}

%    \end{macrocode}
% \end{macro}
% \begin{intmacro}{\@gtt@keydef}
% The following four auxiliary macros save us some code when we devise keys later on. Firstly, |\@gtt@keydef|\marg{key} declares the key |/pgfgantt/|\meta{key}, which saves its value in the macro |gtt@|\meta{key}.
%    \begin{macrocode}
\def\@gtt@keydef#1{%
  \pgfkeysdef{/pgfgantt/#1}{%
    \expandafter\def\csname gtt@#1\endcsname{##1}%
  }%
}
%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\@gtt@get}
% Secondly, |\@gtt@get|\marg{key} retrieves the value stored by a \meta{key}.
%    \begin{macrocode}
\def\@gtt@get#1{\csname gtt@#1\endcsname}
%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\@gtt@stylekeydef}
% Thirdly, |\@gtt@stylekeydef|\marg{key} declares a \meta{key} which saves its value as the internal style key |/pgfgantt/|\meta{key}|@style|.
%    \begin{macrocode}
\def\@gtt@stylekeydef#1{%
  \pgfkeysdef{/pgfgantt/#1}{%
    \pgfkeys{/pgfgantt/#1@style/.style={##1}}%
  }%
}
%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\@gtt@linkkeydef}\begin{intmacro}{\gtt@link@type}\begin{intmacro}{\gtt@link@startanchor}\begin{intmacro}{\gtt@link@endanchor}
% Finally, |\@gtt@linkkeydef|\marg{link type}\marg{label}\marg{start anchor}\marg{end anchor} declares the subkey \meta{link type} of the choice key |/pgfgantt/link type|. Such keys store the \meta{label} in |\gtt@link@type|, the \meta{start anchor} in |\gtt@link@startanchor| and the \meta{end anchor} in |\gtt@link@endanchor|.
%    \begin{macrocode}
\def\@gtt@linkkeydef#1#2#3#4{%
  \pgfkeysdef{/pgfgantt/link type/#1}{%
    \def\gtt@link@type{#1}%
    \def\gtt@link@startanchor{#3}%
    \def\gtt@link@endanchor{#4}%
  }%
  \ganttset{link label={#1}{#2}}%
}

%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{intmacro}\end{intmacro}
%
% \subsection{Option Declarations}
%
% \begin{option}{hgrid}\begin{option}{hgrid style}\begin{intmacro}{\ifgtt@hgrid}\begin{intmacro}{\gtt@hgridstyle}
% |hgrid| checks whether its value is |false| and sets the boolean |\ifgtt@hgrid| accordingly. If the value is |true| or missing, horizontal grid lines appear |dotted|.
%    \begin{macrocode}
\@gtt@stylekeydef{hgrid style}
\newif\ifgtt@hgrid
\pgfkeysdef{/pgfgantt/hgrid}{%
  \def\@tempa{#1}%
  \def\@tempb{false}%
  \ifx\@tempa\@tempb%
    \gtt@hgridfalse%
  \else%
    \gtt@hgridtrue%
    \def\@tempb{true}%
    \ifx\@tempa\@tempb%
      \def\gtt@hgridstyle{dotted}%
    \else%
      \def\gtt@hgridstyle{#1}%
    \fi%
  \fi%
}
\pgfkeys{/pgfgantt/hgrid/.default=dotted}

%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{option}\end{option}
% \begin{option}{vgrid}\begin{intmacro}{\ifgtt@vgrid}\begin{intmacro}{\gtt@vgridstyle}
% Analogously, we declare |vgrid|.
%    \begin{macrocode}
\newif\ifgtt@vgrid
\pgfkeysdef{/pgfgantt/vgrid}{%
  \def\@tempa{#1}%
  \def\@tempb{false}%
  \ifx\@tempa\@tempb%
    \gtt@vgridfalse%
  \else%
    \gtt@vgridtrue%
    \def\@tempb{true}%
    \ifx\@tempa\@tempb%
      \def\gtt@vgridstyle{dotted}%
    \else%
      \def\gtt@vgridstyle{#1}%
    \fi%
  \fi%
}
\pgfkeys{/pgfgantt/vgrid/.default=dotted}

%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{option}

% \begin{option}{x unit}\begin{option}{y unit title}\begin{option}{y unit chart}
% The following three keys store the basis vectors for the chart.
%    \begin{macrocode}
\@gtt@keydef{x unit}
\@gtt@keydef{y unit title}
\@gtt@keydef{y unit chart}

%    \end{macrocode}
% \end{option}\end{option}\end{option}
% \begin{option}{canvas}\begin{option}{today}\begin{option}{today rule}\begin{option}{today label}
% Here is a set of keys related to the canvas \dots
%    \begin{macrocode}
\@gtt@stylekeydef{canvas}
\@gtt@keydef{today}
\@gtt@stylekeydef{today rule}
\@gtt@keydef{today label}

%    \end{macrocode}
% \end{option}\end{option}\end{option}\end{option}
% \begin{option}{title}\begin{option}{title label font}\begin{option}{title label anchor}\begin{option}{title list options}\begin{option}{title left shift}\begin{option}{title right shift}\begin{option}{title top shift}\begin{option}{title height}\begin{intmacro}{\gtt@titlelistoptions}
% \dots\ and of keys that influence the title. Note that |\@gtt@keydef| cannot define |title list options|, since |\@gtt@titlelistoptions| is expanded after a |\foreach| statement, where |\@gtt@get| will not work.
%    \begin{macrocode}
\@gtt@stylekeydef{title}
\@gtt@keydef{title label font}
\@gtt@stylekeydef{title label anchor}
\pgfkeysdef{/pgfgantt/title list options}{%
  \def\gtt@titlelistoptions{[#1]}%
}
\@gtt@keydef{title left shift}
\@gtt@keydef{title right shift}
\@gtt@keydef{title top shift}
\@gtt@keydef{title height}

%    \end{macrocode}
% \end{intmacro}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}
% \begin{option}{include title in canvas}\begin{intmacro}{\ifgtt@includetitle}
% |include title in canvas| is one of two boolean keys in the package.
%    \begin{macrocode}
\newif\ifgtt@includetitle
\pgfkeys{/pgfgantt/include title in canvas/.is if=gtt@includetitle}

%    \end{macrocode}
% \end{intmacro}\end{option}
% \begin{option}{name}\begin{option}{time slot modifier}\begin{option}{inline}\begin{intmacro}{\ifgtt@inline}
% The |name| key saves unique names for chart elements. The |time slot modifier| option controls the semi-intelligent behaviour of the package regarding the conversion of title slots to $x$-coordinates. A value of |0| essentially means ``interpret all end time slots as $x$-coordinates''. The |inline| key moves labels close to their respective chart elements.
%    \begin{macrocode}
\@gtt@keydef{name}
\@gtt@keydef{time slot modifier}
\newif\ifgtt@inline
\pgfkeys{/pgfgantt/inline/.is if=gtt@inline}

%    \end{macrocode}
% \end{intmacro}\end{option}\end{option}\end{option}
% \begin{option}{bar}\begin{option}{bar label text}\begin{option}{bar label font}\begin{option}{bar label anchor}\begin{option}{bar label inline anchor}\begin{option}{bar left shift}\begin{option}{bar right shift}\begin{option}{bar top shift}\begin{option}{bar height}\begin{intmacro}{\gtt@barlabeltext}
% Some standard key declarations for bars \dots
%    \begin{macrocode}
\@gtt@stylekeydef{bar}
\pgfkeysdef{/pgfgantt/bar label text}{%
  \def\gtt@barlabeltext##1{#1}%
}
\@gtt@keydef{bar label font}
\@gtt@stylekeydef{bar label anchor}
\@gtt@stylekeydef{bar label inline anchor}
\@gtt@keydef{bar left shift}
\@gtt@keydef{bar right shift}
\@gtt@keydef{bar top shift}
\@gtt@keydef{bar height}

%    \end{macrocode}
% \end{intmacro}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}
% \begin{option}{group}\begin{option}{group label text}\begin{option}{group label font}\begin{option}{group label anchor}\begin{option}{group label inline anchor}\begin{option}{group left shift}\begin{option}{group right shift}\begin{option}{group top shift}\begin{option}{group height}\begin{intmacro}{\gtt@grouplabeltext}
% \dots\ and groups.
%    \begin{macrocode}
\@gtt@stylekeydef{group}
\pgfkeysdef{/pgfgantt/group label text}{%
  \def\gtt@grouplabeltext##1{#1}%
}
\@gtt@keydef{group label font}
\@gtt@stylekeydef{group label anchor}
\@gtt@stylekeydef{group label inline anchor}
\@gtt@keydef{group left shift}
\@gtt@keydef{group right shift}
\@gtt@keydef{group top shift}
\@gtt@keydef{group height}
%    \end{macrocode}
% \end{intmacro}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}
% \begin{option}{group left peak}\begin{intmacro}{\gtt@groupleftpeakmidx}\begin{intmacro}{\gtt@groupleftpeakinnerx}\begin{intmacro}{\gtt@groupleftpeaky}
% |gantt left peak| checks for each of its three values whether it is non-empty and only then changes the corresponding length macro.
%    \begin{macrocode}
\pgfkeysdefnargs{/pgfgantt/group left peak}{3}{%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty\else\def\gtt@groupleftpeakmidx{#1}\fi%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else\def\gtt@groupleftpeakinnerx{#2}\fi%
  \def\@tempa{#3}%
  \ifx\@tempa\@empty\else\def\gtt@groupleftpeaky{#3}\fi%
}
%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{intmacro}\end{option}
% \begin{option}{group right peak}\begin{intmacro}{\gtt@grouprightpeakmidx}\begin{intmacro}{\gtt@grouprightpeakinnerx}\begin{intmacro}{\gtt@grouprightpeaky}
% |group right peak| works similar, but a |-| also counts as an empty value (the reason for this will soon become apparent).
%    \begin{macrocode}
\pgfkeysdefnargs{/pgfgantt/group right peak}{3}{%
  \def\@tempa{#1}%
  \def\@tempb{-}%
  \ifx\@tempa\@empty\else%
    \ifx\@tempa\@tempb\else\def\gtt@grouprightpeakmidx{#1}\fi%
  \fi%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else%
    \ifx\@tempa\@tempb\else\def\gtt@grouprightpeakinnerx{#2}\fi%
  \fi%
  \def\@tempa{#3}%
  \ifx\@tempa\@empty\else\def\gtt@grouprightpeaky{#3}\fi%
}
%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{intmacro}\end{option}
% \begin{option}{group peaks}
% |group peaks| simultaneously sets |group left peak| and |group right peak|. In order to preserve the symmetry of the peaks, the key adds a negative sign (i.\,e., a hyphen in the source code) to \meta{groove x} and \meta{inner x} of |group right peak|. Therefore, the latter key must interpret its first and second value as ``empty'' even if they contain a single hyphen.
%    \begin{macrocode}
\pgfkeysdefnargs{/pgfgantt/group peaks}{3}{%
  \ganttset{group left peak={#1}{#2}{#3}, group right peak={-#1}{-#2}{#3}}%
}

%    \end{macrocode}
% \end{option}
% \begin{option}{progress}\begin{option}{bar incomplete}\begin{option}{group incomplete}\begin{option}{incomplete}\begin{option}{progress label text}\begin{option}{progress label font}\begin{option}{progress label anchor}\begin{intmacro}{\gtt@progresslabeltext}
% The keys below manage the progress elements. Note the way in which we declare |progress label text|, so that a |#1| in its value is replaced by the argument of |\gtt@progresslabeltext|.
%    \begin{macrocode}
\@gtt@keydef{progress}
\@gtt@stylekeydef{bar incomplete}
\@gtt@stylekeydef{group incomplete}
\pgfkeysdef{/pgfgantt/incomplete}{%
  \ganttset{bar incomplete={#1}, group incomplete={#1}}%
}
\pgfkeysdef{/pgfgantt/progress label text}{%
  \def\gtt@progresslabeltext##1{#1}%
}
\@gtt@keydef{progress label font}
\@gtt@stylekeydef{progress label anchor}

%    \end{macrocode}
% \end{intmacro}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}
% \begin{option}{milestone}\begin{option}{milestone label text}\begin{option}{milestone label font}\begin{option}{milestone label anchor}\begin{option}{milestone label inline anchor}\begin{option}{milestone width}\begin{option}{milestone height}\begin{option}{milestone xshift}\begin{option}{milestone yshift}\begin{intmacro}{\gtt@milestonelabeltext}
% Here are the declarations of the milestone-related keys.
%    \begin{macrocode}
\@gtt@stylekeydef{milestone}
\pgfkeysdef{/pgfgantt/milestone label text}{%
  \def\gtt@milestonelabeltext##1{#1}%
}
\@gtt@keydef{milestone label font}
\@gtt@stylekeydef{milestone label anchor}
\@gtt@stylekeydef{milestone label inline anchor}
\@gtt@keydef{milestone width}
\@gtt@keydef{milestone height}
\@gtt@keydef{milestone xshift}
\@gtt@keydef{milestone yshift}

%    \end{macrocode}
% \end{intmacro}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}
% \begin{option}{link}\begin{option}{link type}\begin{option}{link label}\begin{option}{link label font}\begin{option}{link label anchor}\begin{option}{link mid}\begin{option}{link bulge}\begin{option}{link tolerance}
% Next, we declare the keys that modify links and the five link types.
%    \begin{macrocode}
\@gtt@stylekeydef{link}
\pgfkeysdefnargs{/pgfgantt/link label}{2}{%
  \expandafter\def\csname gtt@link@#1@labeltext\endcsname{#2}%
}
\pgfkeys{/pgfgantt/link type/.is choice}
\@gtt@linkkeydef{arrow}{\relax}{}{}
\@gtt@linkkeydef{s-s}{start-to-start}{lower left}{upper left}
\@gtt@linkkeydef{s-f}{start-to-finish}{lower left}{upper right}
\@gtt@linkkeydef{f-s}{finish-to-start}{lower right}{upper left}
\@gtt@linkkeydef{f-f}{finish-to-finish}{lower right}{upper right}

\@gtt@keydef{link label font}
\@gtt@stylekeydef{link label anchor}
\@gtt@keydef{link mid}
\@gtt@keydef{link bulge}
\@gtt@keydef{link tolerance}

%    \end{macrocode}
% \end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}\end{option}
% Finally, we initialize all keys in order to define the commands that save their values.
%    \begin{macrocode}
\ganttset{
  canvas={fill=white},
  x unit=.5cm,
  y unit title=1cm,
  y unit chart=1cm,
  hgrid style=dotted,
  today=none,
  today rule={dashed, line width=1pt},
  today label=TODAY,
  title={fill=white},
  title label font=\small,
  title label anchor={anchor=mid},
  title left shift=0,
  title right shift=0,
  title top shift=0,
  title height=.6,
  title list options={var=\x, evaluate=\x},
  include title in canvas,
  name={},
  time slot modifier=-1,
  inline=false,
  bar={fill=white},
  bar label text={\strut#1},
  bar label font=\normalsize,
  bar label anchor={anchor=east},
  bar label inline anchor={anchor=center},
  bar left shift=0,
  bar right shift=0,
  bar top shift=.3,
  bar height=.4,
  group={fill=black},
  group label text={\strut#1},
  group label font=\normalsize\bfseries,
  group label anchor={anchor=east},
  group label inline anchor={anchor=south},
  group left shift=-.1,
  group right shift=.1,
  group top shift=.4,
  group height=.2,
  group peaks={.2}{.4}{.1},
  progress=none,
  incomplete={fill=black!25},
  progress label text={#1\% complete},
  progress label font=\scriptsize,
  progress label anchor={anchor=west},
  milestone={fill=black},
  milestone label text={\strut#1},
  milestone label font=\normalsize\itshape,
  milestone label anchor={anchor=east},
  milestone label inline anchor={anchor=south},
  milestone width=.8,
  milestone height=.4,
  milestone xshift=0,
  milestone yshift=.5,
  link={-latex, rounded corners=1pt},
  link type=arrow,
  link label font=\scriptsize\itshape\normalcolor,
  link label anchor={anchor=west},
  link mid=.5,
  link bulge=.4,
  link tolerance=0.6
}

%    \end{macrocode}
%
%
% \subsection{The Horizontal and Vertical Grid}
%
% \begin{intmacro}{\gtt@vgrid@do}
% The |\gtt@vgrid@do| macro decomposes the style list for the vertical grid into its comma-separated items. The item is analyzed (see below) only if some grid lines are still left to draw. Note the ``elegant'' quadruple |\expandafter| construction, which enables tail recursion.
%    \begin{macrocode}
\def\gtt@vgrid@do#1,{%
  \ifx\relax#1\else%
    \ifnum\value{gtt@currgrid}>\value{gtt@width}\else%
      \gtt@vgrid@analyze#1\relax%
      \expandafter\expandafter\expandafter\gtt@vgrid@do%
    \expandafter\fi%
  \fi%
}

%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\gtt@vgrid@analyze}
% In the absence of a star as the first token in a style list item, |\gtt@vgrid@analyze| adds the multiplier |1| to the input stream.
%    \begin{macrocode}
\def\gtt@vgrid@analyze{%
  \@ifstar{\gtt@vgrid@draw}{\gtt@vgrid@draw1}%
}

%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\gtt@vgrid@draw}
% |\gtt@vgrid@draw| draws as many grid lines as required by the multiplier. It increases |gtt@currgrid| after each line drawn and breaks the loop as soon as all grid rules have been drawn.
%    \begin{macrocode}
\def\gtt@vgrid@draw#1#2\relax{%
  \foreach \i in {1,...,#1} {%
    \draw[#2] (\value{gtt@currgrid} * \@gtt@get{x unit}, \y@upper pt) --%
      (\value{gtt@currgrid} * \@gtt@get{x unit}, \y@lower pt);%
    \stepcounter{gtt@currgrid}%
    \ifnum\value{gtt@currgrid}>\value{gtt@width}\breakforeach\fi%
  }%
}

%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\gtt@hgrid@do}\begin{intmacro}{\gtt@hgrid@analyze}\begin{intmacro}{\gtt@hgrid@draw}
% The corresponding macros for the horizontal grid work like their vertical grid analogues.
%    \begin{macrocode}
\def\gtt@hgrid@do#1,{%
  \ifx\relax#1\else
    \ifnum\value{gtt@currgrid}<\value{gtt@currentline}\else%
      \gtt@hgrid@analyze#1\relax%
      \expandafter\expandafter\expandafter\gtt@hgrid@do%
    \expandafter\fi%
  \fi%
}

\def\gtt@hgrid@analyze{%
  \@ifstar{\gtt@hgrid@draw}{\gtt@hgrid@draw1}%
}

\def\gtt@hgrid@draw#1#2\relax{%
  \foreach \i in {1,...,#1} {%
    \pgfmathsetmacro\y@upper{%
      \value{gtt@lasttitleline} * \@gtt@get{y unit title} +%
      (\value{gtt@currgrid} - \value{gtt@lasttitleline})%
      * \@gtt@get{y unit chart}%
    }%
    \draw[#2] (0pt, \y@upper pt) --
      (\value{gtt@width} * \@gtt@get{x unit}, \y@upper pt);%
    \addtocounter{gtt@currgrid}{-1}%
    \ifnum\value{gtt@currgrid}<\value{gtt@currentline}\breakforeach\fi%
  }%
}

%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{intmacro}
%
%
% \subsection{The Main Environment}
%
% \begin{environment}{ganttchart}\begin{intmacro}{\ifgtt@tikzpicture}\begin{macro}{\\}
% If a |ganttchart| appears outside of a |tikzpicture|, we implicitly start this environment. ``Within a |tikzpicture|'' means that |\useasboundingbox| is defined.\par
% At the beginning of a |ganttchart| environment, the keys in its optional argument are executed. |gtt@width| saves the environment's mandatory argument (i.\,e., the number of time slots). All counters are set to |0|. Since we expect a chart to start with at least one title element, |\ifgtt@intitle| is true. Within the environment, the control symbol |\\| is equivalent to |\ganttnewline| (similar to the syntax of a \LaTeX\ table).
%    \begin{macrocode}
\newif\ifgtt@tikzpicture

\newenvironment{ganttchart}[2][]{%
  \@ifundefined{useasboundingbox}%
    {\gtt@tikzpicturefalse\begin{tikzpicture}}%
    {\gtt@tikzpicturetrue}%
  \ganttset{#1}%
  \setcounter{gtt@width}{#2}%
  \setcounter{gtt@currentline}{0}%
  \setcounter{gtt@lasttitleline}{0}%
  \setcounter{gtt@elementid}{0}%
  \setcounter{gtt@currgrid}{1}%
  \gtt@intitletrue%
  \let\\\ganttnewline%
}{%
%    \end{macrocode}
% \end{macro}\end{intmacro}
% \begin{intmacro}{\x@left}\begin{intmacro}{\x@right}\begin{intmacro}{\y@upper}\begin{intmacro}{\y@lower}
% After the contents of the environment have been drawn, we add the canvas to the background layer. The |ganttchart| environment and all |\gantt...| macros save their $x$- and $y$-coordinates in local internal macros called |\x@left|, |\x@right|, |\y@upper| and |\y@lower|. The upper $y$-coordinate of the canvas is either zero or excludes the title lines if |include title in canvas| is false. The lower $y$-coordinate must take into account different $y$-units in the title and the rest of the chart.
%    \begin{macrocode}
  \begin{scope}[on background layer]%
    \ifgtt@includetitle%
      \def\y@upper{0}%
    \else%
      \pgfmathsetmacro\y@upper{%
        \value{gtt@lasttitleline} * \@gtt@get{y unit title}%
      }%
    \fi%
    \pgfmathsetmacro\y@lower{%
      \value{gtt@lasttitleline} * \@gtt@get{y unit title}%
      + (\value{gtt@currentline} - \value{gtt@lasttitleline} - 1)%
      * \@gtt@get{y unit chart}%
    }%
    \draw[/pgfgantt/canvas@style]
      (0pt, \y@upper pt) rectangle
      (\value{gtt@width} * \@gtt@get{x unit}, \y@lower pt);%
    \pgfmathsetmacro\y@upper{%
      \value{gtt@lasttitleline} * \@gtt@get{y unit title}%
    }%
%    \end{macrocode}
% \end{intmacro}\end{intmacro}\end{intmacro}\end{intmacro}
% The contents of the vertical grid style list are evaluated at most |gtt@width|-times, but the loop breaks as soon as all grid lines have been drawn.
%    \begin{macrocode}
    \ifgtt@vgrid
      \addtocounter{gtt@width}{-1}%
      \foreach \x in {1,...,\value{gtt@width}} {%
        \expandafter\gtt@vgrid@do\gtt@vgridstyle,\relax,%
        \ifnum\value{gtt@currgrid}>\value{gtt@width}\breakforeach\fi%
      }%
      \stepcounter{gtt@width}%
    \fi%
%    \end{macrocode}
% Now, we draw the horizontal grid. If we exclude the title from the canvas, we omit the uppermost horizontal grid line since it would coincide with the canvas border.
% \begin{intmacro}{\hgrid@upper}
%    \begin{macrocode}
    \ifgtt@hgrid%
      \ifgtt@includetitle%
        \setcounter{gtt@currgrid}{\value{gtt@lasttitleline}}%
      \else%
        \pgfmathsetcounter{gtt@currgrid}{\value{gtt@lasttitleline}-1}%
      \fi%
      \edef\hgrid@upper{\thegtt@currgrid}%
      \foreach \t in {\hgrid@upper,...,\value{gtt@currentline}} {%
        \expandafter\gtt@hgrid@do\gtt@hgridstyle,\relax,%
        \ifnum\value{gtt@currgrid}<\value{gtt@currentline}\breakforeach\fi%
      }%
    \fi%
%    \end{macrocode}
% \end{intmacro}
% The last task of |ganttchart| is to apply the |today| key if its value differs from |none|.
%    \begin{macrocode}
    \def\@tempa{none}%
    \ifx\gtt@today\@tempa\else%
      \draw[/pgfgantt/today rule@style]
        (\@gtt@get{today} * \@gtt@get{x unit}, \y@upper pt) --
        (\@gtt@get{today} * \@gtt@get{x unit}, \y@lower pt);%
      \node at (\@gtt@get{today} * \@gtt@get{x unit}, \y@lower pt)
        [anchor=north] {\@gtt@get{today label}};%
    \fi%
  \end{scope}%
%    \end{macrocode}
% At the end of a |ganttchart|, we also close the |tikzpicture| if we started it implicitly.
%    \begin{macrocode}
  \ifgtt@tikzpicture\else\end{tikzpicture}\fi%
}

%    \end{macrocode}
% \end{environment}
%
%
% \subsection{Starting a New Line}
%
% \begin{macro}{\ganttnewline}
% Unless the optional argument of |\ganttnewline| is empty, this macro adds a horizontal grid rule between the current and the new line. The style of this line is either |hgrid style| or the style specified in the optional argument. Anyway, |\ganttnewline| decreases |gtt@currentline| and, if we are still in the title, |gtt@lasttitleline|. Since the new line starts at time slot zero, |gtt@lasttitleslot| is reset.
%    \begin{macrocode}
\newcommand\ganttnewline[1][]{%
  \def\@tempa{#1}%
  \def\@tempb{grid}%
  \ifx\@tempa\@empty\else
    \ifx\@tempa\@tempb%
      \def\@tempa{/pgfgantt/hgrid style@style}%
    \fi%
    \pgfmathsetmacro\y@upper{%
      \value{gtt@lasttitleline} * \@gtt@get{y unit title}%
      + (\value{gtt@currentline} - \value{gtt@lasttitleline} - 1)%
      * \@gtt@get{y unit chart}%
    }
    \expandafter\draw\expandafter[\@tempa]
      (0pt, \y@upper pt) --
      (\value{gtt@width} * \@gtt@get{x unit}, \y@upper pt);%
  \fi%
  \addtocounter{gtt@currentline}{-1}%
  \ifgtt@intitle\addtocounter{gtt@lasttitleline}{-1}\fi%
  \setcounter{gtt@lasttitleslot}{0}%
}

%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Title Elements}
%
% \begin{macro}{\gantttitle}
% |\gantttitle| draws a title element (i.\,e., a rectangle with a single node at its center). For reasons that will become clear below, the rectangle essentially starts at the $x$-coordinate stored in |gtt@lasttitleslot|. This counter is updated at the end of the macro.
%
% Note that in order to keep key changes local, all macros that draw chart elements set the keys specified as their optional argument within a group.
%    \begin{macrocode}
\newcommand\gantttitle[3][]{%
  \begingroup%
  \ganttset{#1}%
  \pgfmathsetmacro\x@left{%
    (\value{gtt@lasttitleslot} + \@gtt@get{title left shift})%
    * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\x@right{%
    (\value{gtt@lasttitleslot} + #3 + \@gtt@get{title right shift})%
    * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\y@upper{%
    (\value{gtt@currentline} - \@gtt@get{title top shift})%
    * \@gtt@get{y unit title}%
  }%
  \pgfmathsetmacro\y@lower{%
    (\value{gtt@currentline} - \@gtt@get{title top shift}%
    - \@gtt@get{title height}) * \@gtt@get{y unit title}%
  }%
  \draw[/pgfgantt/title@style]
    (\x@left pt, \y@upper pt) rectangle
    (\x@right pt, \y@lower pt);%
  \@gtt@get{title label font}%
  \node at ($(\x@left pt,\y@upper pt)!.5!(\x@right pt,\y@lower pt)$)
    [/pgfgantt/title label anchor@style] {#2};%
  \addtocounter{gtt@lasttitleslot}{#3}%
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\gantttitlelist}
% |\gantttitlelist| generates title elements by repeatedly calling |\gantttitle|. Since the latter always starts after the last time slot occupied by the previous element, |\gantttitlelist| does not have to calculate the respective $x$-coordinates explicitly.
%    \begin{macrocode}
\newcommand\gantttitlelist[3][]{%
  \begingroup%
  \ganttset{#1}%
  \expandafter\foreach\gtt@titlelistoptions in {#2} {\gantttitle{\x}{#3}}%
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
% 
%
% \subsection{Chart Elements}
%
% All chart elements that can be linked (i.\,e. bars, groups and milestones) add a node of shape |chart element|, whose name equals the value of the |name| key (or ``|elem|\meta{number}'' if |name| is empty). A |chart element| node has an anchor in the center of the chart element (|center|) and six anchors at the top, middle and bottom of the element's sides. The |\ganttlink| macro relies on these anchors for calculating the link coordinates.
%    \begin{macrocode}
\pgfdeclareshape{chart element}{%
  \savedanchor\lowerleft{%
    \pgfpoint{\x@left pt}{\y@lower pt}%
  }%
  \savedanchor\leftcenter{%
    \pgfpoint{\x@left pt}{\y@upper pt / 2 + \y@lower pt / 2}%
  }%
  \savedanchor\upperleft{%
    \pgfpoint{\x@left pt}{\y@upper pt}%
  }%
  \savedanchor\lowerright{%
    \pgfpoint{\x@right pt}{\y@lower pt}%
  }%
  \savedanchor\rightcenter{%
    \pgfpoint{\x@right pt}{\y@upper pt / 2 + \y@lower pt / 2}%
  }%
  \savedanchor\upperright{%
    \pgfpoint{\x@right pt}{\y@upper pt}%
  }%
  \savedanchor\centerpoint{%
    \pgfpoint{\x@right pt / 2 + \x@left pt / 2}%
      {\y@upper pt / 2 + \y@lower pt / 2}%
  }%
  \anchor{lower left}{\lowerleft}%
  \anchor{left}{\leftcenter}%
  \anchor{upper left}{\upperleft}%
  \anchor{lower right}{\lowerright}%
  \anchor{right}{\rightcenter}%
  \anchor{upper right}{\upperright}%
  \anchor{center}{\centerpoint}%
}

%    \end{macrocode}
% 
%
% \subsection{Bars}
%
% \begin{macro}{\ganttbar}\begin{intmacro}{\gtt@name}
% |\ganttbar| first defines the usual coordinate macros and adds a |chart element| node. This node is called |elem|\meta{number} if the |name| key is empty.
%    \begin{macrocode}
\newcommand\ganttbar[4][]{%
  \begingroup%
  \ganttset{#1}%
  \pgfmathsetmacro\x@left{%
    (#3 + \@gtt@get{time slot modifier} + \@gtt@get{bar left shift})%
    * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\x@right{%
    (#4 + \@gtt@get{bar right shift}) * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\y@upper{%
    \value{gtt@lasttitleline} * \@gtt@get{y unit title}
    + (\value{gtt@currentline} - \value{gtt@lasttitleline}
    - \@gtt@get{bar top shift}) * \@gtt@get{y unit chart}%
  }%
  \pgfmathsetmacro\y@lower{%
    \y@upper - \@gtt@get{bar height} * \@gtt@get{y unit chart}%
  }%
  \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi%
  \node[shape=chart element] (\@gtt@get{name})
    at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {};
%    \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\gtt@pl@draw}
% |\gtt@pl@draw| saves the commands that will produce the progress label. This macro does nothing unless (a) the |progress| key differs from |none| and (b) |progress label text| differs from |\relax|. Otherwise, it creates a vertically centered node to the right of the bar.
%    \begin{macrocode}
  \def\@tempa{none}%
  \ifx\gtt@progress\@tempa%
    \def\gtt@progress{100}%
    \let\gtt@pl@draw\relax%
  \else
    \expandafter\ifx\gtt@progresslabeltext\relax\relax%
      \let\gtt@pl@draw\relax%
    \else%
      \def\gtt@pl@draw{%
        \node at ($(\x@right pt, \y@upper pt)!.5!
          (\x@right pt, \y@lower pt)$)
          [/pgfgantt/progress label anchor@style] {%
            \@gtt@get{progress label font}{%
              \@gtt@get{progresslabeltext}{\@gtt@get{progress}}%
            }%
          };%
      }%
    \fi%
  \fi%
%    \end{macrocode}
% \end{intmacro}
% In order to draw the left (complete) and right (incomplete) part of a progress bar, we clip the corresponding rectangles depending on the value of |progress|. Note that we turn off the border of these rectangles and draw it with an additional, third command.
%    \begin{macrocode}
  \begin{scope}%
    \clip (\x@left pt, \y@upper pt) rectangle
      ($(\x@left pt, \y@lower pt)!\gtt@progress/100!
        (\x@right pt, \y@lower pt)$);%
    \draw[/pgfgantt/bar@style, draw=none] (\x@left pt, \y@upper pt)
      rectangle (\x@right pt, \y@lower pt);%
  \end{scope}%
  \begin{scope}%
    \clip ($(\x@left pt, \y@upper pt)!\gtt@progress/100!
      (\x@right pt, \y@upper pt)$)
      rectangle (\x@right pt, \y@lower pt);%
    \draw[/pgfgantt/bar incomplete@style, draw=none]
      (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);%
  \end{scope}%
  \draw[/pgfgantt/bar@style, fill=none]
    (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);%
  \gtt@pl@draw%
%    \end{macrocode}
% If the first mandatory argument of |\ganttbar| is not empty, we print a label. Its anchor is either at the center of the previously defined |chart element| node (|inline=true|) or at the left canvas border halfway between the upper and lower $y$-coordinate of the bar (|inline=false|).
%    \begin{macrocode}
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else%
    \ifgtt@inline%
      \node at (\@gtt@get{name}.center)
        [/pgfgantt/bar label inline anchor@style]
        {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};%
    \else%
      \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$)
        [/pgfgantt/bar label anchor@style]
        {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};%
    \fi%
  \fi%
%    \end{macrocode}
% Since the first bar clearly appears after the last line containing a title element, we set the boolean |\ifgtt@intitle| to false.
%    \begin{macrocode}
  \xdef\gtt@lastelement{\gtt@currentelement}%
  \xdef\gtt@currentelement{\@gtt@get{name}}%
  \stepcounter{gtt@elementid}%
  \global\gtt@intitlefalse%
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ganttlinkedbar}
% The shortcut version |\ganttlinkedbar| calls both |\ganttbar| and |\ganttlink|.
%    \begin{macrocode}
\newcommand\ganttlinkedbar[4][]{%
  \begingroup%
  \ganttset{#1}%
  \ganttbar{#2}{#3}{#4}%
  \ganttlink{\gtt@lastelement}{\gtt@currentelement}
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
%
% \subsection{Links}
%
% \begin{macro}{\ganttlink}
% |\ganttlink| takes two completely different approaches to drawing links, depending on the link type. First, we recall the coordinates of the chart elements to be linked.
%    \begin{macrocode}
\newcommand\ganttlink[3][]{%
  \begingroup%
  \ganttset{#1}%
  \pgfpointanchor{#2}{right}
  \edef\x@left{\the\pgf@x}
  \edef\y@upper{\the\pgf@y}
  \pgfpointanchor{#3}{left}
  \edef\x@right{\the\pgf@x}
  \edef\y@lower{\the\pgf@y}
%    \end{macrocode}
% \textit{Arrow-like links:} The first and last coordinate of the link should touch the preceding or following element at the center of its right or left border, respectively. We check if the connected elements lie in the same row or not (i.\,e., their $y$-coordinates differ at most 1~pt). In the latter case, |\pgfmathparse| yields |0|.
%    \begin{macrocode}
  \def\@tempa{arrow}
  \ifx\@tempa\gtt@link@type%
    \pgfmathparse{abs(\y@upper - \y@lower) <= 1}
    \ifcase\pgfmathresult%
%    \end{macrocode}
% Once again, two possibilities arise: Either the elements to be connected are at least separated by |link tolerance| time slots, in which case we draw a three-part arrow. Alternatively, the elements lie in adjacent time slots or even overlap, in which case we draw a five-part arrow.
%    \begin{macrocode}
      \pgfmathparse{%
        (\x@right - \x@left)
        >= \@gtt@get{link tolerance} * \@gtt@get{x unit}%
      }%
      \ifcase\pgfmathresult%
        \draw[/pgfgantt/link@style]
          (#2.right) --
          (\x@left + \@gtt@get{link bulge} * \@gtt@get{x unit},
            \y@upper) --
          ($(\x@left + \@gtt@get{link bulge} * \@gtt@get{x unit},
            \y@upper)!%
            \@gtt@get{link mid}!%
            (\x@left + \@gtt@get{link bulge} * \@gtt@get{x unit},
            \y@lower)$) --
          ($(\x@right - \@gtt@get{link bulge} * \@gtt@get{x unit},
            \y@upper)!%
            \@gtt@get{link mid}!%
            (\x@right - \@gtt@get{link bulge} * \@gtt@get{x unit},
            \y@lower)$) --
          (\x@right - \@gtt@get{link bulge} * \@gtt@get{x unit},
            \y@lower) --
          (#3.left);%
      \else%
        \draw[/pgfgantt/link@style]
          (#2.right) --
          ($(\x@left, \y@upper)!\@gtt@get{link mid}!
            (\x@right, \y@upper)$) --
          ($(\x@left, \y@lower)!\@gtt@get{link mid}!
            (\x@right, \y@lower)$) --
          (#3.left);%
      \fi%
%    \end{macrocode}
% For elements that lie in the same row, we draw a simple arrow.
%    \begin{macrocode}
    \else
      \draw[/pgfgantt/link@style] (#2.right) -- (#3.left);
    \fi
%    \end{macrocode}
% \textit{Straight links:} A simple arrow connects the two elements. The label is anchored halfway between the start and end coordinates.
%    \begin{macrocode}
  \else%
    \draw[/pgfgantt/link@style]
      (#2.\gtt@link@startanchor) -- (#3.\gtt@link@endanchor)
      node [pos=.5, /pgfgantt/link label anchor@style] {%
        \@gtt@get{link label font}{%
          \csname gtt@link@\gtt@link@type @labeltext\endcsname%
        }%
      };%
  \fi%
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Groups}
%
% \begin{macro}{\ganttgroup}
% Groups and bars are quite similar. First, we define the usual coordinate macros and add a |chart element| node.
%    \begin{macrocode}
\newcommand\ganttgroup[4][]{%
  \begingroup%
  \ganttset{#1}%
  \pgfmathsetmacro\x@left{%
    (#3 + \@gtt@get{time slot modifier} + \@gtt@get{group left shift})%
    * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\x@right{%
    (#4 + \@gtt@get{group right shift}) * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\y@upper{%
    \value{gtt@lasttitleline} * \@gtt@get{y unit title}
    + (\value{gtt@currentline} - \value{gtt@lasttitleline}
    - \@gtt@get{group top shift}) * \@gtt@get{y unit chart}%
  }%
  \pgfmathsetmacro\y@lower{%
    \y@upper - \@gtt@get{group height} * \@gtt@get{y unit chart}%
  }%
  \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi%
  \node[shape=chart element] (\@gtt@get{name})
    at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {};
%    \end{macrocode}
% |\gtt@pl@draw| saves the commands that will produce the progress label. This macro does nothing unless (a) the |progress| key differs from none and (b) |progress label text| differs from |\relax|. Otherwise, it creates a vertically centered node to the right of the group.
%    \begin{macrocode}
  \def\@tempa{none}%
  \ifx\gtt@progress\@tempa%
    \def\gtt@progress{100}%
    \let\gtt@pl@draw\relax%
  \else
    \expandafter\ifx\gtt@progresslabeltext\relax\relax%
      \let\gtt@pl@draw\relax%
    \else%
      \def\gtt@pl@draw{%
        \node at ($(\x@right pt, \y@upper pt)!.5!
          (\x@right pt, \y@lower pt)$)
          [/pgfgantt/progress label anchor@style] {%
            \@gtt@get{progress label font}{%
              \@gtt@get{progresslabeltext}{\@gtt@get{progress}}%
            }%
          };%
      }%
    \fi%
  \fi%
%    \end{macrocode}
% \begin{intmacro}{\@maxpeak}
% In order to draw the left (complete) and right (incomplete) part of a progress group, we clip the corresponding polygons depending on the value of |progress|. Note that we turn off the border of these polygons and draw it with an additional, third command. The clipped area must include the highest peak, so we determine its height and store it in |\@maxpeak|.
%    \begin{macrocode}
  \pgfmathsetmacro\@maxpeak{%
    \gtt@grouprightpeaky > \gtt@groupleftpeaky ?%
    \gtt@grouprightpeaky * \@gtt@get{y unit chart} :%
    \gtt@groupleftpeaky * \@gtt@get{y unit chart}%
  }%
  \begin{scope}%
    \clip (\x@left pt, \y@upper pt) rectangle
      ($(\x@left pt, \y@lower pt - \@maxpeak pt)!%
        \gtt@progress/100!%
        (\x@right pt, \y@lower pt - \@maxpeak pt)$);%
    \path[/pgfgantt/group@style,draw=none]
      (\x@left pt, \y@upper pt) --
      (\x@right pt, \y@upper pt) --
      (\x@right pt, \y@lower pt) --
      (\x@right pt + \gtt@grouprightpeakmidx * \@gtt@get{x unit},
        \y@lower pt - \gtt@grouprightpeaky * \@gtt@get{y unit chart}) --
      (\x@right pt + \gtt@grouprightpeakinnerx * \@gtt@get{x unit},
        \y@lower pt) --
      (\x@left pt + \gtt@groupleftpeakinnerx * \@gtt@get{x unit},
        \y@lower pt) --
      (\x@left pt + \gtt@groupleftpeakmidx * \@gtt@get{x unit},
        \y@lower pt - \gtt@groupleftpeaky * \@gtt@get{y unit chart}) --
      (\x@left pt, \y@lower pt) --
      cycle;%
  \end{scope}%
  \begin{scope}%
    \clip ($(\x@left pt, \y@upper pt)!%
        \gtt@progress/100!%
        (\x@right pt, \y@upper pt)$)
      rectangle (\x@right pt, \y@lower pt - \@maxpeak pt);
    \path[/pgfgantt/group incomplete@style]
      (\x@left pt, \y@upper pt) --
      (\x@right pt, \y@upper pt) --
      (\x@right pt, \y@lower pt) --
      (\x@right pt + \gtt@grouprightpeakmidx * \@gtt@get{x unit},
        \y@lower pt - \gtt@grouprightpeaky * \@gtt@get{y unit chart}) --
      (\x@right pt + \gtt@grouprightpeakinnerx * \@gtt@get{x unit},
        \y@lower pt) --
      (\x@left pt + \gtt@groupleftpeakinnerx * \@gtt@get{x unit},
        \y@lower pt) --
      (\x@left pt + \gtt@groupleftpeakmidx * \@gtt@get{x unit},
        \y@lower pt - \gtt@groupleftpeaky * \@gtt@get{y unit chart}) --
      (\x@left pt, \y@lower pt) --
      cycle;%
  \end{scope}%
  \path[/pgfgantt/group@style,fill=none]
    (\x@left pt, \y@upper pt) --
    (\x@right pt, \y@upper pt) --
    (\x@right pt, \y@lower pt) --
    (\x@right pt + \gtt@grouprightpeakmidx * \@gtt@get{x unit},
      \y@lower pt - \gtt@grouprightpeaky * \@gtt@get{y unit chart}) --
    (\x@right pt + \gtt@grouprightpeakinnerx * \@gtt@get{x unit},
      \y@lower pt) --
    (\x@left pt + \gtt@groupleftpeakinnerx * \@gtt@get{x unit},
      \y@lower pt) --
    (\x@left pt + \gtt@groupleftpeakmidx * \@gtt@get{x unit},
      \y@lower pt - \gtt@groupleftpeaky * \@gtt@get{y unit chart}) --
    (\x@left pt, \y@lower pt) --
    cycle;%
  \gtt@pl@draw%
%    \end{macrocode}
% If the first mandatory argument of |\ganttgroup| is not empty, we print a label. Its anchor is either at the center of the previously defined |chart element| node (|inline=true|) or at the left canvas border halfway between the upper and lower $y$-coordinate of the group (|inline=false|).
%    \begin{macrocode}
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else%
    \ifgtt@inline%
      \node at (\@gtt@get{name}.center)
        [/pgfgantt/group label inline anchor@style]
        {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};%
    \else%
      \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$)
        [/pgfgantt/group label anchor@style]
        {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};%
    \fi%
  \fi%
%    \end{macrocode}
% Since the first group clearly appears after the last line containing a title element, we set the boolean |\ifgtt@intitle| to false.
%    \begin{macrocode}
  \xdef\gtt@lastelement{\gtt@currentelement}%
  \xdef\gtt@currentelement{\@gtt@get{name}}%
  \stepcounter{gtt@elementid}%
  \global\gtt@intitlefalse%
  \endgroup%
}

%    \end{macrocode}
% \end{intmacro}
% \end{macro}
% \begin{macro}{\ganttlinkedgroup}
% The shortcut version |\ganttlinkedgroup| calls both |\ganttgroup| and |\ganttlink|.
%    \begin{macrocode}
\newcommand\ganttlinkedgroup[4][]{%
  \begingroup%
  \ganttset{#1}%
  \ganttgroup{#2}{#3}{#4}%
  \ganttlink{\gtt@lastelement}{\gtt@currentelement}
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Milestones}
%
% \begin{macro}{\ganttmilestone}\begin{intmacro}{\x@mid}\begin{intmacro}{\y@mid}
% |\ganttmilestone| calculates some coordinates and adds a |chart element| node. We also need the coordinates of the center, which are saved in |\x@mid| and |\y@mid|.
%    \begin{macrocode}
\newcommand\ganttmilestone[3][]{%
  \begingroup%
  \ganttset{#1}%
  \pgfmathsetmacro\x@mid{%
    (#3 + \@gtt@get{milestone xshift}) * \@gtt@get{x unit}%
  }%
  \pgfmathsetmacro\x@left{%
    \x@mid - \@gtt@get{milestone width} / 2 * \@gtt@get{x unit}%
  }
  \pgfmathsetmacro\x@right{%
    \x@mid + \@gtt@get{milestone width} / 2 * \@gtt@get{x unit}%
  }
  \pgfmathsetmacro\y@mid{%
    \value{gtt@lasttitleline} * \@gtt@get{y unit title}%
    + (\value{gtt@currentline} - \value{gtt@lasttitleline}%
    - \@gtt@get{milestone yshift}) * \@gtt@get{y unit chart}%
  }%
  \pgfmathsetmacro\y@upper{%
    \y@mid + \@gtt@get{milestone height} / 2 * \@gtt@get{y unit chart}%
  }%
  \pgfmathsetmacro\y@lower{%
    \y@mid - \@gtt@get{milestone height} / 2 * \@gtt@get{y unit chart}%
  }%
  \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi%
  \node[shape=chart element] (\@gtt@get{name})
    at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {};
%    \end{macrocode}
% \end{intmacro}\end{intmacro}
% Drawing the milestone itself is quite simple, since the |progress| key is irrelevant.
%    \begin{macrocode}
  \path[/pgfgantt/milestone@style]
    (\x@left pt, \y@mid pt) --
    (\x@mid pt, \y@lower pt) --
    (\x@right pt, \y@mid pt) --
    (\x@mid pt, \y@upper pt) --
    cycle;%
%    \end{macrocode}
% If the first mandatory argument of |\ganttmilestone| is not empty, we print a label. Its anchor is either at the center of the previously defined |chart element| node (|inline=true|) or at the left canvas border at the height of the milestone's center.
%    \begin{macrocode}
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else%
    \ifgtt@inline%
      \node at (\@gtt@get{name}.center)
        [/pgfgantt/milestone label inline anchor@style]
        {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};%
    \else%
      \node at (0pt, \y@mid pt)
        [/pgfgantt/milestone label anchor@style]
        {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};%
    \fi%
  \fi%
%    \end{macrocode}
% Since the first milestone clearly appears after the last line containing a title element, we set the boolean |\ifgtt@intitle| to false.
%    \begin{macrocode}
  \xdef\gtt@lastelement{\gtt@currentelement}%
  \xdef\gtt@currentelement{\@gtt@get{name}}%
  \stepcounter{gtt@elementid}%
  \global\gtt@intitlefalse%
  \endgroup%
}

%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ganttlinkedmilestone}
% The shortcut version |\ganttlinkedmilestone| calls both |\ganttmilestone| and |\ganttlink|.
%    \begin{macrocode}
\newcommand\ganttlinkedmilestone[3][]{%
  \begingroup%
  \ganttset{#1}%
  \ganttmilestone{#2}{#3}%
  \ganttlink{\gtt@lastelement}{\gtt@currentelement}
  \endgroup%
}
%    \end{macrocode}
% \end{macro}
% \iffalse
%</pgfgantt>
% \fi
% \Finale
\endinput