summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/heria/heria.dtx
blob: 5c6b5e96916b67c038f72c7775db675a1b503422 (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
% \iffalse meta-comment
%
% Copyright 2023 Tristan Miller
% -----------------------------
%
% 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
%   https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{heria.dtx}
%</driver>
%<*class>
%% Copyright 2023 Tristan Miller
%% Copyright 2016 John Kormylo
%%
%% 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
%%   https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%%
%</class>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{heria}
%<*class>
[2023-12-04 v3.2.1.0 Class for Horizon Europe (R)IA proposals]
%</class>
%
%<*driver>
\documentclass{ltxdoc}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\addtolength\marginparwidth{5ex}
\addtolength\oddsidemargin{6ex}
\addtolength\evensidemargin{6ex}
\begin{document}
\DocInput{heria.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{1506}
%
% \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{heria.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \title{\textsf{heria}: A \LaTeX\ class for\\ Horizon Europe RIA and
% IA grant proposals\thanks{This document corresponds to
% \textsf{heria}~\fileversion, dated \filedate. See §\ref{sec:version}
% for an explanation of the versioning scheme.}}
%
% \author{Tristan Miller\\
% Austrian Research Institute for Artificial Intelligence\\
% \texttt{tristan.miller@ofai.at}}
%
% \maketitle
% \tableofcontents
%
% \section{Introduction}\label{sec:introduction}
%
% This document describes the usage of \textsf{heria}, a \LaTeX\ class
% that facilitates the preparation of Research and Innovation Action
% (RIA) and Innovation Action (IA) funding proposals for the European
% Commission's~(EC) Horizon Europe program.  The Commission prescribes
% a detailed, structured format for the technical description
% (``Part~B'') of these proposals, but provides templates only in Rich
% Text Format (RTF), a format that does not lend itself well to
% collaborative authorship and \mbox{(cross-)}reference management.
% The \textsf{heria} class is a conversion of the official Part~B
% template into \LaTeX; it preserves the formatting and most of the
% instructions of the original version, and has the additional feature
% that tables (listing the participants, work packages, deliverables,
% etc.)\ are programmatically generated according to data supplied by
% the user.  The advantage of this becomes clear when one considers
% that much of the data is reused across multiple tables.
%
% At the time of writing (2023-12-04), open calls to the RIA and IA
% calls require proposals to be submitted according to either
% Version~3.2 (2022-11-15) or Version~3.3 (2023-09-27) of the Part~B
% template.  The \textsf{heria} package was developed with reference
% to the Version~3.2 template; however, according to the changelog for
% the Version~3.3 template, the only difference from the previous
% version is the addition of some instructions concerning the use of
% generative AI tools for the preparation of the proposal.
%
% \section{Usage}
%
% The EC's official template is structured in such a way that form and
% content cannot be entirely separated. The best way of starting a new
% proposal is therefore to make a copy of \texttt{heria-proposal.tex},
% the skeleton proposal distributed with this package, and then adapt
% it to your project.  The following subsections describe the various
% macros and environments provided by \textsf{heria}, roughly in the
% same order presented in the skeleton proposal.
%
% \subsection{Preamble}
%
% Your proposal document should begin with the following line if you
% want the template instructions to be included in the output:
% \begin{quote}\verb|\documentclass[showinstructions]{heria}|\end{quote}
% Otherwise you can omit the \verb|showinstructions| option:
% \begin{quote}\verb|\documentclass{heria}|\end{quote}
% 
% The \verb|heria| class is based on the default \LaTeX\
% \verb|article| class, and so all of the macros and environments from
% the latter are available for you to use.  The class automatically
% sets the font, margins, etc.\ mandated by the official instructions,
% and redefines some of the \verb|article| macros as described later
% in this document.
%
% \medskip
%
% \noindent Following \cs{documentclass} you should provide the
% proposal metadata using the following macros:
%
% \DescribeMacro{\title} This macro takes the title of the proposal as
% its sole argument.  This title will be printed by the \cs{maketitle}
% macro (see below) and used for the PDF metadata.
%
% \DescribeMacro{\callname} This macro takes as its sole argument the
% official natural-language description of the call to which the
% proposal is being submitted.  It will be printed in the page header.
%
% \DescribeMacro{\callidentifier} This macro takes as its sole
% argument the identifier of the call to which the proposal is being
% submitted, which will be printed in the page header.  Call
% identifiers normally have the format
% \texttt{HORIZON-XX0-0000-XXXXX-00-XXXXX}.
%
% \DescribeMacro{\calltopic} This macro takes as its sole argument the
% identifier of the specific topic within the call to which the
% proposal is being submitted.  Such identifiers normally have the
% format \texttt{HORIZON-XX0-0000-XXXXX-00-00}.  The official template
% does not require proposals to mention the call topic, so you are
% free to omit the \cs{calltopic} macro.  If you do use it, it will be
% printed by \cs{maketitle} below the proposal title.
%
% \subsection{Title}
%
% \DescribeMacro{\maketitle} This is generally the first macro that
% should be called in the main body of the document.  As with the
% standard \verb|article| class, it typesets the title.
%
% \subsection{Section headings, tags, and instructions}
%
% \DescribeMacro{\heinstructions} When the \verb|showinstructions|
% options is passed to the document class, the \cs{heinstructions}
% macro prints instructions from the official EC template.  These
% instructions are contained in files distributed with the
% \textsf{heria} class; the macro's sole argument is used to construct
% the name of one of these files.  To suppress printing of individual
% instructions, you can simply remove or comment out the corresponding
% \cs{heinstructions} macro.
%
% \DescribeMacro{\opentag}\DescribeMacro{\closetag} The official
% template includes a number of ``tags'' that are used for the EC's
% ``internal processing of information, mostly for statistical
% gathering.''  The \cs{opentag} and \cs{closetag} macros are used to
% emit the tags at the appropriate places in the proposal, and so
% should be left in their original positions in the skeleton template.
% The EC asks that proposal authors ``not move, delete, re-order, or
% alter tags in any way''.
%
% \DescribeMacro{\section}\DescribeMacro{\subsection}\DescribeMacro{\subsubsection}
% These three macros take a mandatory argument specifying the title of
% the corresponding section, subsection, or subsubsection,
% respectively.  These document subdivisions are fixed by the official
% template and so generally should not be renamed or reordered, though
% it is probably safe to add additional ones where it does not disrupt
% the numbering of the existing ones.  Many sections and subsections
% \emph{must} be preceded or followed by certain tags, which are
% specified in the first and second optional arguments, respectively.
% The third optional argument contains the recommended page limit,
% when specified by the official template.  The page limit will be
% printed only when the \verb|showinstructions| option is passed to
% the document class.
%
% \subsection{Participants}
%
% \DescribeMacro{\participant} Participants should be listed in the
% same order as in Part~A of the proposal, which is completed using an
% online form.  Use one invocation of \cs{participant} for each
% participant, with the following three mandatory arguments, in order:
% the participant's full name, the participant's short name, and the
% participant's two-letter country code.  The first participant will
% be marked in the participant table as the project coordinator.  Note
% that while the short name is typeset in the proposal, it is also
% used internally by the \verb|heria| class as part of a \LaTeX\
% counter name, and so should generally consist only of ASCII letters.
%
% \DescribeMacro{\makeparticipantstable} This macro emits the table of
% participants using the data from the \cs{participant} macro.
% Participants are automatically numbered according to the order of
% the \cs{participant} macros.
%
% \subsection{Summary tableau}
%
% \DescribeEnv{summarycanvas} \DescribeEnv{summarybox} Proposals must
% include a summary tableau of six boxes that briefly describe the
% project's specific needs; expected results; dissemination,
% exploitation, and communication measures; target groups; outcomes;
% and impacts.  The \verb|summarycanvas| and \verb|summaryenv|
% environments are provided for this purpose.  Each \verb|summarybox|
% environment typesets a shaded box headed by its mandatory argument.
% Three such boxes can be grouped side by side into a single
% \verb|summarycanvas| environment.  The skeleton proposal
% demonstrates how all six boxes can be placed in a floating figure on
% a single landscape page, though other arrangements seem to be
% permissible.
%
% \subsection{Work packages and deliverables}
%
% \DescribeMacro{\makeworkpackagestable} This macro emits the table of
% work packages, using the data from the \cs{workpackage} macros. Work
% packages are automatically numbered according to the order of the
% \cs{workpackage} macros.
%
% \DescribeMacro{\workpackage} This macro declares a work package, and
% takes five mandatory arguments: a unique identifier (used only
% internally by \verb|heria| for cross-referencing purposes), the work
% package title, the short name of the lead participant (as specified
% in the corresponding \cs{participant} macro), the numeric starting
% month (measured from the start of the project), and the numeric
% ending month.  Since the unique identifier is used as part of a
% \LaTeX\ counter name, you should generally use only ASCII letters.
% Work packages are automatically numbered.  You should use one
% \cs{workpackage} macro for each work package in your project.
%
% \DescribeEnv{objectives} This environment typesets a box containing
% an enumerated list of objectives for the most recently declared work
% package.  Use the \cs{item} macro to begin each objective.
%
% \DescribeEnv{descriptionofwork} This environment typesets a box
% where you can describe the work program of the most recently
% declared work package.  You can enter this information in free-form
% and\slash or use the \cs{task} macro to enumerate individual tasks.
%
% \DescribeMacro{\task} This macro typesets basic information about a
% work package task. The format used by this macro is not strictly
% mandated by the official template, but you may nonetheless find it
% useful.  The macro takes three mandatory arguments: the task name,
% the short name of the lead participant (as specified in the
% corresponding \cs{participant} macro), a list of other participants
% (as free-form text, but advisedly using short names of participants
% where appropriate), and the starting and ending months for the task
% (as free-form text). You should use one \cs{task} macro for each
% task in your work package.  You can, if you wish, follow each
% \cs{task} macro with a free-form description of the task.
%
% \DescribeMacro{\deliverable} This macro declares a deliverable for
% the most recently declared work package.  There are six mandatory
% arguments: the deliverable name, a short description of the
% deliverable, the short name of the lead participant (as specified in
% the corresponding \cs{participant} macro), the deliverable type, the
% dissemination level, and the numeric delivery month (in months from
% the beginning of the project).  The type and dissemination level
% arguments must be selected from the identifiers given in the
% template instructions.
%
% \DescribeMacro{\makedeliverablestable} This macro emits the table of
% deliverables, using the data from the \cs{deliverable}
% macros. Deliverables are automatically numbered according to the
% order of the \cs{deliverable} macros.
%
% \subsection{Milestones}
%
% \DescribeMacro{\milestone} This macro declares a project milestone.
% It takes four mandatory arguments: the milestone name, a free-form
% list of related work packages, the due date (in number of months
% from the start of the project), and a free-form means of
% verification. You should use one \cs{milestone} macro for each
% milestone in your project.
%
% \DescribeMacro{\makemilestonestable} This macro emits the table of
% milestones, using the data from the \cs{milestone}
% macros. Milestones are automatically numbered according to the order
% of the \cs{milestone} macros.
%
% \subsection{Critical risks}
%
% \DescribeMacro{\criticalrisk} This macro declares a critical risk
% for the project.  It takes five mandatory arguments: a free-form
% description of the risk, the likelihood of the risk, the severity of
% the risk, and a free-form description of proposed mitigation
% measures. The likelihood and severity arguments must be selected
% from the identifiers given in the template instructions.  You should
% use one \cs{criticalrisk} macro for each critical risk in your
% project.
%
% \DescribeMacro{\makecriticalriskstable} This macro emits the table
% of critical risks, using the data from the \cs{criticalrisk}
% macros. Critical risks are output in the order of the
% \cs{criticalrisk} macros.
%
% \subsection{Summary of staff effort}
%
% \DescribeMacro{\staffeffort} This macro declares the number of
% person-months a given project participant will spend on a given work
% package.  It takes three mandatory arguments: the short name of the
% participant (as specified in the corresponding \cs{participant}
% macro), the short name of the work package (as specified in the
% corresponding \cs{workpackage} macro), and the number of months.
% You must provide one and only one \cs{staffeffort} macro for every
% possible combination of participant and work package in your project.
% 
% \DescribeMacro{\makestaffefforttable} This macro emits the summary
% of staff effort table, using the data from the \cs{staffeffort}
% macros. The table rows and columns are automatically ordered
% according to the order of the \cs{participant} and \cs{workpackage}
% macros, respectively, and the total person-months per participant
% and total person-months per work package are automatically
% calculated.
%
% \subsection{Costs}
%
% \DescribeMacro{\subcontractingcost} This macro declares a
% subcontracting cost. It takes three mandatory arguments: the short
% name of a participant (as specified in the corresponding
% \cs{participant} macro), the amount of the subcontracting cost in
% euros, and a free-form description of the tasks and justification
% for the subcontracting cost.  You should use one
% \cs{subcontractingcost} macro for each subcontracting cost in your
% project.
%
% \DescribeMacro{\makesubcontractingcoststable} This macro emits the
% tables of subcontracting costs, using the data from the
% \cs{subcontractingcost} macros.  Subcontracting costs are
% automatically grouped by participant and then output according to
% the order of the \cs{participant} and \cs{subcontractingcost}
% macros.
%
% \DescribeMacro{\purchasecost} This macro declares the purchase costs
% for a participant.  It takes eight mandatory arguments:
% \begin{quote}\cs{purchasecost}\marg{participant}\verb|%|\\
% \hspace*{5ex}\marg{goodscost}\marg{justification}\verb|%|\\
% \hspace*{5ex}\marg{travelcost}\marg{justification}\verb|%|\\
% \hspace*{5ex}\marg{equipmentcost}\marg{justification}\verb|%|\\
% \hspace*{5ex}\marg{remainingcosts}\end{quote}
% Here \meta{participant} is the short name of a participant (as
% specified in the corresponding \cs{participant} macro);
% \meta{goodscost}, \meta{travelcost}, \meta{equipmentcost}, and
% \meta{remainingcost} are the amount of the ``other goods, works and
% services'', ``travel and subsistence'', ``equipment'', and
% ``remaining purchase costs'', respectively, in euros; and the
% \meta{justification} arguments are free-form justifications for the
% immediately preceding cost.  (According to the official template,
% the remaining purchase costs do not require a justification.)  You
% should use one \cs{purchasecost} macro for each participant with
% purchase costs in your project.
%
% \DescribeMacro{\makepurchasecoststable} This macro emits the tables
% of purchase costs, using the data from the \cs{purchasecost} macros.
% Purchase costs are output according to the order of the
% \cs{participant} macros, and then in reverse order of the largest
% costs, with the ``remaining purchase costs'' output last.
%
% \DescribeMacro{\othercost} This macro declares an ``other'' cost
% (i.e.,\ in the ``other costs'' category). It takes three mandatory
% arguments: the short name of a participant (as specified in the
% corresponding \cs{participant} macro), the amount of the ``other''
% cost in euros, and a free-form justification for the cost.  You
% should use one \cs{othercost} macro for each ``other'' cost in your
% project.
%
% \DescribeMacro{\makeothercoststable} This macro emits the tables of
% ``other'' costs, using the data from the \cs{othercost} macros.
% ``Other'' costs are automatically grouped by participant and then
% output according to the order of the \cs{participant} and
% \cs{othercost} macros.
%
% \DescribeMacro{\inkindcontribution} This macro declares an in-kind
% contribution. It takes five mandatory arguments: the short name of a
% participant (as specified in the corresponding \cs{participant}
% macro), the third party name, the category of the contribution
% (selected from \texttt{Seconded personnel}, \texttt{Travel and
% subsistence}, \texttt{Equipment}, \texttt{Other goods, works and
% services}, and \texttt{Internally invoiced goods and services}), the
% amount of the cost in euros, and a free-form justification for the
% in-kind contribution.  You should use one \cs{inkindcontribution}
% macro for each in-kind contribution in your project.
%
% \DescribeMacro{\makeinkindcontributionstable} This macro emits the
% tables of in-kind contributions, using the data from the
% \cs{inkindcontribution} macros.  In-kind contributions are
% automatically grouped by participant and then output according to
% the order of the \cs{participant} and \cs{inkindcontribution}
% macros.
%
% \section{Hints and tips}
%
% \paragraph{Part A.} Some proposal data---in particular, the list of
% participants and the costs---must be entered not just in Part~B of
% the proposal, but also in the online Part~A form.  It is your
% responsibility to ensure that this data is consistent across the two
% parts of the proposal.
%
% \paragraph{File structure.} Rather than putting all the work package
% data into your main proposal document, you may find it convenient to
% put the \cs{workpackage} macro, the \verb|objectives| environment,
% the \verb|descriptionofwork| environment, and the \cs{deliverable}
% macros corresponding to a single work package into a dedicated file,
% which you can then include in your main proposal document with the
% \cs{input} macro.  This will make it easier for you to shuffle the
% order of work packages as you write your proposal.  (You may wish to
% split off other sections of the proposal into their own files,
% though the official template gives considerably less freedom to
% reorder them.)
% 
% \paragraph{Vertical spacing.} The \textsf{heria} class applies the
% same vertical spacing as the \textsf{article} class; this is
% particularly generous around section headings.  If you find yourself
% running up against the page limit, you may wish to add some
% \cs{vspace} commands, with a negative length as the argument, to
% tighten up the spaces before section headings, and perhaps also the
% tables.
%
% \section{Limitations and caveats}
%
% \paragraph{No backward compatibility.} This version of the
% \textsf{heria} class implements a specific version of the official
% Horizon Europe template as described in §\ref{sec:introduction}. It
% is intended that \textsf{heria}, over the course of its development,
% will track changes made to the official template. Since these
% changes may be incompatible with previous versions, you are advised
% to retain a copy of the version of \textsf{heria} you used to
% produce a proposal; this way you will still be able to build the
% proposal even if you later install a new version of \textsf{heria}.
% See §\ref{sec:version} for further information on \textsf{heria}'s
% versioning scheme and when to expect breaking changes.
%
% \paragraph{Table 3.1h.} The instructions in the official template
% are ambiguous about the construction of the tables for purchase
% costs.  In particular, it's not clear whether each individual cost
% exceeding 15\% of the personnel costs must be listed in a separate
% row, or whether all costs in each category (``travel and
% subsistence'', ``equipment'', etc.)\ should be combined into a
% single row.  The \textsf{heria} class takes the latter
% interpretation; this may or may not be the same interpretation
% adopted by the funding agency and its reviewers.
%
% \paragraph{Error handling.} The class currently does very little
% error checking on its input.  Usually invalid input (e.g., mistyping
% the short name of a participant or work package in a macro argument,
% or neglecting to provide a macro necessary to generate a table)
% \emph{will} result in an error that prevents the document from
% compiling, though the diagnostic message emitted by \LaTeX\ may be
% somewhat cryptic.
%
% \paragraph{Coverage of instructions.}  The class reproduces most,
% but not all, of the instructions from the official template.  In
% particular, it omits all the instructions occurring before the title
% of the proposal, including three pages of introductory material and
% definitions.  You should not rely solely on the instructions emitted
% by the class, which are provided only as a convenience; be sure to
% also read the instructions in the official template (and in the text
% of the call to which you are applying).
%
% \section{Package development}
%
% \subsection{Source repository and bug tracker}
%
% For now, the package's source code is hosted on GitHub at
% \url{https://github.com/logological/heria}.  There you will also
% find an issue tracker for reporting bugs and feature requests.
%
% \subsection{Versioning scheme}\label{sec:version}
%
% Each release of the \textsf{heria} class carries a version number in
% the format \textit{omaj.\allowbreak omin.\allowbreak maj.\allowbreak
% min}. Here \textit{omaj.omin} is the version number of the official
% Horizon Europe RIA template that the class implements, and
% \textit{maj} and \textit{min} represent, respectively, major and
% minor revisions to the class (including any ancillary files, such as
% the skeleton proposal and documentation).  A major revision is one
% that includes breaking changes or significant new features; minor
% revisions are for all other changes. You should generally assume
% that any change to \textit{omaj.omin} introduces breaking changes to
% the class interface and\slash or significant changes to the official
% proposal preparation instructions.
%
% \subsection{Version history}
%
% \begin{description}
%   \item[v3.2.1.0 (2023-12-04)] Initial release.
% \end{description}
%
% \section{Disclaimer}
%
% The \textsf{heria} package is distributed in the hope that it will
% be useful, but WITHOUT ANY WARRANTY; without even the implied
% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
% PURPOSE. (See the \LaTeX\ Project Public License for further
% details.)  In particular, users should understand that the
% \textsf{heria} proposal template is wholly unofficial, and its
% author(s) accept no responsibility for any omissions, errors, or
% discrepancies with respect to the requirements set forth in the
% official Horizon Europe templates and associated documentation.  If
% you produce a proposal with this template, then you alone are
% responsible for ensuring that it matches all the official
% requirements before submitting it to the funding body.
%
% \appendix
%
% \section{Implementation}
%
% \StopEventually{}
%
% \subsection*{Basic setup}
%
% Import the \verb|article| class and set up some basic features
% (margins, hyperlinks, etc.)
%
%\iffalse
%<*class>
%\fi
%    \begin{macrocode}
\LoadClass[11pt,a4paper]{article}
\RequirePackage[T1]{fontenc} % T1 font encoding
\RequirePackage[left=15mm,
                top=15mm,
                bottom=15mm,
                right=15mm,
                includehead,
                includefoot,
                headheight=10pt,
                headsep=5mm,
                footskip=18pt,
               ]{geometry}
\RequirePackage[pdftex]{graphicx} % For graphics

\RequirePackage[pdftex,pdfusetitle]{hyperref} % Hyperlinks
\hypersetup{%
    colorlinks=true,
    breaklinks=true,
    urlcolor=black,
    linkcolor=black,
    citecolor=black,
    pdfsubject={},
    pdfkeywords={},
}

\RequirePackage{xfp} % Floating point numbers

%    \end{macrocode}
%
% A helper function to display variables
%
%    \begin{macrocode}
\newcommand{\disptoken}[1]{%
  \csname#1\endcsname
}
%    \end{macrocode}
%
% \subsection*{Tables and framed boxes}
%
%    \begin{macrocode}
\RequirePackage{colortbl} % for shaded table rows
\RequirePackage{xltabular} % for breakable tables with var-width columns
\RequirePackage[table]{xcolor} % for colours and shaded table cells
\RequirePackage[breakable,raster]{tcolorbox} % for framed boxes
%    \end{macrocode}
%
% \subsection*{Colours}
%
%    \begin{macrocode}
\definecolor{taggrey}{HTML}{B5B5B5}
\definecolor{footergrey}{HTML}{D8D8D8}
\definecolor{tablegrey}{HTML}{F2F2F2}
\definecolor{summaryblue}{HTML}{00B0F0}
%    \end{macrocode}
%
% \subsection*{Basic proposal variables}
%
%    \begin{macrocode}
\newcommand{\callname}[1]{\gdef\@callname{#1}}%
\newcommand{\callidentifier}[1]{\gdef\@callidentifier{#1}}%
\newcommand{\calltopic}[1]{\gdef\@calltopic{#1}}%
%    \end{macrocode}
%
% \subsection*{Participants}
%
%    \begin{macrocode}
\newcounter{@pcount} % Participant counter
\newcommand{\participant}[3]{%
  \stepcounter{@pcount}%
  \newcounter{@p#2num}% 
  \setcounter{@p#2num}{\value{@pcount}}%
  \expandafter\xdef\csname @pFullName\arabic{@p#2num}\endcsname{#1}%
  \expandafter\xdef\csname @pShortName\arabic{@p#2num}\endcsname{#2}%
  \expandafter\xdef\csname @pCountry\arabic{@p#2num}\endcsname{#3}%
  \newcounter{@pSubcontractingCosts\arabic{@p#2num}}%
  \newcounter{@pPurchaseCosts\arabic{@p#2num}}%
  \newcounter{@pOtherCosts\arabic{@p#2num}}%
  \newcounter{@pInkindContributions\arabic{@p#2num}}%
}
%    \end{macrocode}
%
% Get participant number from short name
%
%    \begin{macrocode}
\newcommand{\getPnum}[1]{%
  \@ifundefined{c@@p#1num}{}{\arabic{@p#1num}}%
}
%    \end{macrocode}
%
% Participants table row
%
%    \begin{macrocode}
\newcommand{\ptablerow}[1]{%
  \stepcounter{#1}
  \the\value{#1}
  \ifthenelse{\value{#1}=1}{ (Coordinator) &}{&}%
  \disptoken{@pFullName\arabic{#1}} (\disptoken{@pShortName\arabic{#1}}) & 
  \disptoken{@pCountry\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Participants table
%
%    \begin{macrocode}
\newcommand{\makeparticipantstable}{%
  \newcounter{@ptable}
  \begin{center}
    \begin{xltabular}{0.9\textwidth}{|l|X|l|}
      \hline
      \textbf{Participant No.} & 
      \textbf{Participant organisation name} &
      \textbf{Country} \\ 
      \hline
      \whiledo%
        {\value{@ptable}<\numexpr\value{@pcount}-1}%
        {\ptablerow{@ptable}}%
      \ptablerow{@ptable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Work packages}
%
%    \begin{macrocode}
\RequirePackage{atveryend}
\newcounter{@wpcount} % Work package counter
\newcommand{\workpackage}[5]{%
  \stepcounter{@wpcount}%
  \newcounter{@wp\arabic{@wpcount}deliverable}%
  \newcounter{@wp\arabic{@wpcount}task}%
  \newcounter{@wp#1num}% 
  \setcounter{@wp#1num}{\value{@wpcount}}%
  \expandafter\xdef\csname %
    @wpPersonMonths\arabic{@wp#1num}\endcsname{0}%
  \expandafter\xdef\csname @wpShortName\arabic{@wp#1num}\endcsname{#1}%
  \expandafter\xdef\csname @wpTitle\arabic{@wp#1num}\endcsname{#2}%
  \expandafter\xdef\csname %
    @wpLeadParticipantShortName\arabic{@wp#1num}\endcsname{#3}%
  \expandafter\xdef\csname @wpStartMonth\arabic{@wp#1num}\endcsname{#4}%
  \expandafter\xdef\csname @wpEndMonth\arabic{@wp#1num}\endcsname{#5}%
  \@bsphack
  \protected@write\@auxout{}%
    {\string\makeworkpackagestable@data{\arabic{@wp#1num}
    & #2 & \getPnum{#3} & #3 & %
    \@ifundefined{@wpTotalPersonMonths\arabic{@wp#1num}}%
    {\textbf{??}}%
    {\disptoken{@wpTotalPersonMonths\arabic{@wp#1num}}}%
    & #4 & #5}}%
  \@esphack
  \ifthenelse{\arabic{@wp#1num}=1}{}{\bigskip}
  \noindent\begin{tabularx}%
    {1.0\linewidth}{|>{\columncolor{tablegrey}}l|X|}
    \hline
    \bfseries Work package number & \arabic{@wp#1num} \\
    \hline
    \bfseries Work package title & #2 \\
      \hline
  \end{tabularx}
}
\newcommand{\makeworkpackagestable@data}[1]{%
  \g@addto@macro\makeworkpackagestable@body{#1 \\ \hline}%
}
\def\makeworkpackagestable@body{}% initialize
\AtBeginDocument{\global\let\makeworkpackagestable@body@startup%
  \makeworkpackagestable@body}
\AtEndDocument{%
  \global\let\makeworkpackagestable@body@end\@empty
  \def\makeworkpackagestable@data#1%
    {\g@addto@macro\makeworkpackagestable@body@end{#1 \\ \hline}}%
}
\AtVeryEndDocument{%
  \ifx\makeworkpackagestable@body@startup%
    \makeworkpackagestable@body@end\else
    \@latex@warning{Rerun for \string\makeworkpackagestable}%
  \fi
}
%    \end{macrocode}
% 
% Work packages table
%
%    \begin{macrocode}
\RequirePackage{makecell}
\newcommand{\makeworkpackagestable}{%
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}{|c|X|c|c|c|c|c|}
      \hline
      \rowcolor{tablegrey}%
      \thead{Work\\ package\\ No.} &
      \thead{Work package title} &
      \thead{Lead\\ participant\\ No.} &
      \thead{Lead\\ participant\\ short name} &
      \thead{Person-\\months} &
      \thead{Start\\ month} &
      \thead{End\\ month} \\
      \hline
      \makeworkpackagestable@body
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% Get work package number from short name
%
%    \begin{macrocode}
\newcommand{\getWPnum}[1]{%
  \@ifundefined{c@@wp#1num}{}{\arabic{@wp#1num}}%
}
%    \end{macrocode}
%
% Work package objectives
%
%    \begin{macrocode}
\newenvironment{objectives}{%
  \begin{tcolorbox}[colback=white,
                    parbox=false,
                    boxrule=0.75pt,
                    boxsep=0mm,
                    breakable
  ]%
  \textsf{\textbf{Objectives}~~~}%
  \begin{enumerate*}[nolistsep,noitemsep,itemjoin={~---~},%
    label=\textbf{O\arabic{@wpcount}.\arabic*}]%
  }{%
  \end{enumerate*}%
  \end{tcolorbox}%
  }
%    \end{macrocode}
%
% Work package description
%
%    \begin{macrocode}
\newenvironment{descriptionofwork}{%
  \begin{tcolorbox}[colback=white,
                    parbox=false,
                    boxrule=0.75pt,
                    boxsep=0mm,
                    breakable
  ]%
  \textsf{\textbf{Description of work}~~~}
  }{%
  \end{tcolorbox}%
  }
%    \end{macrocode}
%
% Tasks
%
%    \begin{macrocode}
\NewDocumentCommand{\task}{mmmm}{%
  \stepcounter{@wp\arabic{@wpcount}task}
  \par\medskip\noindent\textbf{Task %
  \arabic{@wpcount}.\arabic{@wp\arabic{@wpcount}task}: #1}
  \textit{(Lead: #2; Participants: #3; Month: #4)}\hspace{1em}%
}
%    \end{macrocode}
%
% \subsection*{Deliverables}
%
%    \begin{macrocode}
\newcounter{@dcount} % Deliverable counter
\newcommand{\deliverable}[6]{%
  \stepcounter{@wp\arabic{@wpcount}deliverable}%
  \stepcounter{@dcount}%
  \expandafter\xdef\csname @dNumber\arabic{@dcount}\endcsname%
    {\arabic{@wpcount}.\arabic{@wp\arabic{@wpcount}deliverable}}%
  \expandafter\xdef\csname %
    @dWorkPackage\arabic{@dcount}\endcsname{\arabic{@wpcount}}%
  \expandafter\xdef\csname @dName\arabic{@dcount}\endcsname{#1}%
  \expandafter\gdef\csname @dDescription\arabic{@dcount}\endcsname{#2}%
  \expandafter\xdef\csname @dLead\arabic{@dcount}\endcsname{#3}%
  \expandafter\xdef\csname @dType\arabic{@dcount}\endcsname{#4}%
  \expandafter\xdef\csname %
    @dDisseminationLevel\arabic{@dcount}\endcsname{#5}%
  \expandafter\xdef\csname @dDeliveryDate\arabic{@dcount}\endcsname{#6}%
}
%    \end{macrocode}
%
% Deliverables table row
%
%    \begin{macrocode}
\newcommand{\dtablerow}[1]{%
  \stepcounter{#1}
  \disptoken{@dNumber\arabic{#1}} &
  \disptoken{@dName\arabic{#1}} &
  \disptoken{@dDescription\arabic{#1}} &
  \disptoken{@dWorkPackage\arabic{#1}} &
  \disptoken{@dLead\arabic{#1}} &
  \disptoken{@dType\arabic{#1}} &
  \disptoken{@dDisseminationLevel\arabic{#1}} &
  \disptoken{@dDeliveryDate\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Deliverables table
%
%    \begin{macrocode}
\newcommand{\makedeliverablestable}{%
  \newcounter{@dtable}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}%
      {|c|>{\raggedright\hsize=.667\hsize\linewidth=\hsize}X%
      |>{\hsize=1.333\hsize\linewidth=\hsize}X|c|c|c|c|p{15mm}|}
      \hline
      \rowcolor{tablegrey}%
      \thead{\#} &
      \thead{Name} &
      \thead{Short description} &
      \thead{WP\\ \#} &
      \thead{Lead\\ participant} &
      \thead{Type} &
      \thead{Dissem.\\ level} &
      \thead{Delivery\\ month} \\
      \hline
      \whiledo%
        {\value{@dtable}<\numexpr\value{@dcount}-1}%
        {\dtablerow{@dtable}}%
      \dtablerow{@dtable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Milestones}
%
%    \begin{macrocode}
\newcounter{@mcount} % Milestone counter
\newcommand{\milestone}[4]{%
  \stepcounter{@mcount}%
  \expandafter\gdef\csname @mName\arabic{@mcount}\endcsname{#1}%
  \expandafter\xdef\csname @mWorkPackages\arabic{@mcount}\endcsname{#2}%
  \expandafter\xdef\csname @mDueDate\arabic{@mcount}\endcsname{#3}%
  \expandafter\xdef\csname %
    @mMeansOfVerification\arabic{@mcount}\endcsname{#4}%
}
%    \end{macrocode}
%
% Milestones table row
%
%    \begin{macrocode}
\newcommand{\mtablerow}[1]{%
  \stepcounter{#1}
  \arabic{#1} &
  \disptoken{@mName\arabic{#1}} &
  \disptoken{@mWorkPackages\arabic{#1}} &
  \disptoken{@mDueDate\arabic{#1}} &
  \disptoken{@mMeansOfVerification\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Milestones table
%
%    \begin{macrocode}
\newcommand{\makemilestonestable}{%
  \newcounter{@mtable}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}{|c|X|p{26mm}|c|p{26mm}|}
      \hline
      \rowcolor{tablegrey}%
      \thead{\#} &
      \thead{Milestone\\ name} &
      \thead{Related\\ WP(s)} &
      \thead{Month\\ due} &
      \thead{Means of\\ verification} \\
      \hline
      \whiledo%
        {\value{@mtable}<\numexpr\value{@mcount}-1}%
        {\mtablerow{@mtable}}%
      \mtablerow{@mtable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Critical risks}
%
%    \begin{macrocode}
\newtcbox{\risktag}[1][black]{%
  fontupper=\scriptsize\sffamily\bfseries,%
  on line,%
  arc=3pt,%
  colupper=white,%
  colback=#1!50!black,%
  colframe=#1!50!black,%
  before upper={\rule[-3pt]{0pt}{10pt}},%
  boxrule=1pt,%
  boxsep=0pt,%
  left=2pt,%
  right=2pt,%
  top=1pt,%
  bottom=.5pt%
}
\newcounter{@crcount} % Critical risk counter
\newcommand{\criticalrisk}[5]{%
  \stepcounter{@crcount}%
  \expandafter\gdef\csname %
    @crDescription\arabic{@crcount}\endcsname{#1}%
  \expandafter\xdef\csname @crLikelihood\arabic{@crcount}\endcsname{#2}%
  \expandafter\xdef\csname @crSeverity\arabic{@crcount}\endcsname{#3}%
  \expandafter\xdef\csname %
    @crWorkPackages\arabic{@crcount}\endcsname{#4}%
  \expandafter\gdef\csname @crMitigation\arabic{@crcount}\endcsname{#5}%
}
%    \end{macrocode}
%
% Critical risk table row
%
%    \begin{macrocode}
\newcommand{\crtablerow}[1]{%
  \stepcounter{#1}%
  \disptoken{@crDescription\arabic{#1}}\newline 
    \risktag[blue]{Likelihood: \disptoken{@crLikelihood\arabic{#1}}} 
    \risktag[red]{Severity: \disptoken{@crSeverity\arabic{#1}}} &
  \disptoken{@crWorkPackages\arabic{#1}} &
  \disptoken{@crMitigation\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Critical risks table
%
%    \begin{macrocode}
\newcommand{\makecriticalriskstable}{%
  \newcounter{@crtable}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}{|p{60mm}|c|X|}
      \hline
      \rowcolor{tablegrey}%
      \thead{Description of risk (indicate level of\\ %
        (i) likelihood, and (ii) severity:\\ %
        Low\slash Medium\slash High)} &
      \thead{WP(s)\\ involved} &
      \thead{Proposed risk-mitigation measures} \\
      \hline
      \whiledo%
        {\value{@crtable}<\numexpr\value{@crcount}-1}%
        {\crtablerow{@crtable}}%
      \crtablerow{@crtable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Staff effort}
%
%    \begin{macrocode}
\newcommand{\staffeffort}[3]{%
  \expandafter\xdef\csname @se#1.#2\endcsname{#3}%
}
%    \end{macrocode}
%
% Summary of staff effort table row
%
%    \begin{macrocode}
\newcommand{\setablerow}[1]{%
  \def\serowtotal{0}%
  \setcounter{@secolumn}{0}%
  \bfseries\the\value{#1} \disptoken{@pShortName\arabic{#1}}%
  \edef\serowtemp{}%
  \whiledo{\value{@secolumn}<\value{@wpcount}}{%
    \stepcounter{@secolumn}%
    \edef\sewpname{\disptoken{@wpShortName\the\value{@secolumn}}}%
    \edef\sewpcell%
      {\disptoken{@se\disptoken{@pShortName\the\value{#1}}.\sewpname}}%
    \edef\serowtotal%
      {\fpeval{\serowtotal + \sewpcell}}% Total PMs per participant
    \xdef\setotalpm{\fpeval{\setotalpm + \sewpcell}}% Total PMs
    \expandafter\xdef\csname %
      @wpPersonMonths\arabic{@secolumn}\endcsname{\fpeval{%
      \sewpcell+\csname %
      @wpPersonMonths\arabic{@secolumn}\endcsname}}% Total PMs per WP
    \IfEq% If...
    {\disptoken{@pShortName\the\value{#1}}}% ...the current PI
    {\disptoken{@wpLeadParticipantShortName%
      \the\value{@secolumn}}}% ...is the WP lead
    {\protected@edef\seformat{\bfseries}}% ...then apply boldface
    {\edef\seformat{}}% ...otherwise don't.
    \protected@edef\serowtemp%
      {\serowtemp&\seformat \sewpcell}% Print PI's PMs for this WP
  }%
  \protected@edef\serowtemp{\serowtemp&\fpeval{round(\serowtotal,0)}}%
  \serowtemp%
  \stepcounter{#1}%
}
%    \end{macrocode}
%
% Summary of staff effort table
%
%    \begin{macrocode}
\newcommand{\makestaffefforttable}{%
  \newcounter{@setable}
  \stepcounter{@setable}
  \newcounter{@secolumn}
  \xdef\setotalpm{0}
  \edef\serowtemp{}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}%
      {|>{\columncolor{tablegrey}}l|*{\value{@wpcount}}{r|}%
      >{\columncolor{tablegrey}}r|}
      \hline
      % Table header
      \rowcolor{tablegrey}%
      \whiledo{\value{@secolumn}<\value{@wpcount}}{%
        \stepcounter{@secolumn}%
        \protected@edef\serowtemp%
          {\serowtemp&\protect\thead{WP\the\value{@secolumn}}}%
      }
      \serowtemp & \thead{Total PMs\\ per Participant} \\
      \hline
      % Participant rows
      \whiledo%
        {\value{@setable}<\numexpr\value{@pcount}}%
        {\setablerow{@setable}\\ \hline}%
      \setablerow{@setable} \\ \hline%
      % Total
      \rowcolor{tablegrey}%
      \setcounter{@secolumn}{0}
      \bfseries Total PMs
      \whiledo{\value{@secolumn}<\value{@wpcount}}{%
        \stepcounter{@secolumn}%
        \edef\serowtemp{\serowtemp&\fpeval{round(\csname %
          @wpPersonMonths\arabic{@secolumn}\endcsname,0)}}%
        \@bsphack
        \protected@write\@auxout{}%
        {\string\expandafter\string\expandafter\string\expandafter%
        \string\gdef\string\disptoken{@wpTotalPersonMonths%
        \arabic{@secolumn}}{\fpeval{round(\disptoken{@wpPersonMonths%
        \arabic{@secolumn}},0)}}}%
        \@esphack
      }
      \serowtemp & \fpeval{round(\setotalpm,0)} \\
      \hline
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Subcontracting costs}
%
%    \begin{macrocode}
\newcommand{\subcontractingcost}[3]{%
  \stepcounter{@pSubcontractingCosts\getPnum{#1}}
  \expandafter\xdef\csname %
    @scCost\getPnum{#1}.\arabic{@pSubcontractingCosts\getPnum{#1}}%
    \endcsname{#2}%
  \expandafter\xdef\csname %
    @scJustification\getPnum{#1}.\arabic{@pSubcontractingCosts\getPnum%
      {#1}}\endcsname{#3}%
}
%    \end{macrocode}
%
% Subcontracting costs table
%
%    \begin{macrocode}
\newcommand{\makesubcontractingcoststable}{%
  \newcounter{@scparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@scparticipant}<\value{@pcount}}{%
      \stepcounter{@scparticipant}%
      \ifthenelse%
        {\value{@pSubcontractingCosts\arabic%
        {@scparticipant}}>0}% If they have subcontracting costs
      {\sctablesection%
        {@scparticipant}}% Print their subcontracting costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Subcontracting costs table section
%
%    \begin{macrocode}
\newcommand{\sctablesection}[1]{%
  \newcounter{@sccost\arabic{#1}}
  \edef\scrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)}
    & \thead{Description of tasks and justification} \\
    \hline
    % For each subcontracting cost
    \whiledo%
      {\value{@sccost\arabic{#1}}<\numexpr\value%
      {@pSubcontractingCosts\arabic{#1}}-1}{%
    \stepcounter{@sccost\arabic{#1}}%
    \sctablerow{#1}{@sccost\arabic{#1}}%
    }%
    \stepcounter{@sccost\arabic{#1}}%
    \sctablerow{#1}{@sccost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% Subcontracting costs table row
%
%    \begin{macrocode}
\newcommand{\sctablerow}[2]{%
  \thead{Subcontracting} &
  \disptoken{@scCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@scJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Other costs}
%
%    \begin{macrocode}
\newcommand{\othercost}[3]{%
  \stepcounter{@pOtherCosts\getPnum{#1}}
  \expandafter\xdef\csname %
    @ocCost\getPnum{#1}.\arabic{@pOtherCosts\getPnum{#1}}\endcsname{#2}%
  \expandafter\xdef\csname %
    @ocJustification\getPnum{#1}.\arabic%
    {@pOtherCosts\getPnum{#1}}\endcsname{#3}%
}
%    \end{macrocode}
%
% Other costs table
%
%    \begin{macrocode}
\newcommand{\makeothercoststable}{%
  \newcounter{@ocparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@ocparticipant}<\value{@pcount}}{%
      \stepcounter{@ocparticipant}%
      \ifthenelse%
        {\value{@pOtherCosts\arabic%
        {@ocparticipant}}>0}% If they have other costs
      {\octablesection{@ocparticipant}}% Print their other costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Other costs table section
%
%    \begin{macrocode}
\newcommand{\octablesection}[1]{%
  \newcounter{@occost\arabic{#1}}
  \edef\ocrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)} & \thead{Justification} \\
    \hline
    % For each other cost
    \whiledo%
      {\value{@occost\arabic{#1}}<\numexpr\value%
      {@pOtherCosts\arabic{#1}}-1}{%
    \stepcounter{@occost\arabic{#1}}%
    \octablerow{#1}{@occost\arabic{#1}}%
    }%
    \stepcounter{@occost\arabic{#1}}%
    \octablerow{#1}{@occost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% Other costs table row
%
%    \begin{macrocode}
\newcommand{\octablerow}[2]{%
  \thead{Internally invoiced\\ goods and services} &
  \disptoken{@ocCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@ocJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Purchase costs}
%
%    \begin{macrocode}
\newcommand{\purchasecost}[8]{%
  \stepcounter{@pPurchaseCosts\getPnum{#1}}
  \expandafter\xdef\csname @pcTravelCost\getPnum{#1}\endcsname{#2}%
  \expandafter\xdef\csname %
    @pcTravelJustification\getPnum{#1}\endcsname{#3}%
  \expandafter\xdef\csname @pcEquipmentCost\getPnum{#1}\endcsname{#4}%
  \expandafter\xdef\csname %
    @pcEquipmentJustification\getPnum{#1}\endcsname{#5}%
  \expandafter\xdef\csname @pcOtherCost\getPnum{#1}\endcsname{#6}%
  \expandafter\xdef\csname %
    @pcOtherJustification\getPnum{#1}\endcsname{#7}%
  \expandafter\xdef\csname @pcRemainingCost\getPnum{#1}\endcsname{#8}%
  \expandafter\xdef\csname %
    @pcTotalCost\getPnum{#1}\endcsname%
    {\the\numexpr #2+#4+#6+#8 \relax}% TO DO
  %  \expandafter\xdef\csname @pcTotalCost\getPnum{#1}\endcsname{100}%
}
%    \end{macrocode}
%
% Purchase costs table
%
%    \begin{macrocode}
\newcommand{\makepurchasecoststable}{%
  \newcounter{@pcparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@pcparticipant}<\value{@pcount}}{%
      \stepcounter{@pcparticipant}%
      \ifthenelse%
        {\value{@pPurchaseCosts\arabic%
        {@pcparticipant}}>0}% If they have purchase costs
      {\pctablesection%
      {@pcparticipant}}% Print their purchase costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Purchase costs table section
%
%    \begin{macrocode}
\newcommand\swap[2]{
  \let\pcTemp#1
  \let#1#2
  \let#2\pcTemp
}
\newcommand{\pctablesection}[1]{%
  \newcounter{@pccost\arabic{#1}}
  % Define table rows
  \def\pcRowA{%
     \thead{Travel and subsistence} &
     \disptoken{@pcTravelCost\arabic{#1}} &
     \disptoken{@pcTravelJustification\arabic{#1}}
  }%
  \edef\pcCostA{\disptoken{@pcTravelCost\arabic{#1}}}%
  \def\pcRowB{%
     \thead{Equipment} &
     \disptoken{@pcEquipmentCost\arabic{#1}} &
     \disptoken{@pcEquipmentJustification\arabic{#1}}
  }%
  \edef\pcCostB{\disptoken{@pcEquipmentCost\arabic{#1}}}%
  \def\pcRowC{%
     \thead{Other goods, works\\ and services} &
     \disptoken{@pcOtherCost\arabic{#1}} &
     \disptoken{@pcOtherJustification\arabic{#1}}
  }%
  \edef\pcCostC{\disptoken{@pcOtherCost\arabic{#1}}}%
  % Sort table rows
  \ifthenelse{\pcCostA<\pcCostC}{%
    \swap{\pcRowA}{\pcRowC}
    \swap{\pcCostA}{\pcCostC}
    }{}
  \ifthenelse{\pcCostA<\pcCostB}{%
    \swap{\pcRowA}{\pcRowB}
    \swap{\pcCostA}{\pcCostB}
    }{}
  \ifthenelse{\pcCostB<\pcCostC}{%
    \swap{\pcRowC}{\pcRowB}
    \swap{\pcCostC}{\pcCostB}
    }{}

  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}p{43mm}|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)} & \thead{Justification} \\
    \hline
    % Output purchase costs in sorted order
    \pcRowA \\ \hline
    \pcRowB \\ \hline
    \pcRowC \\ \hline
    % Output remaining and total costs
    \thead{Remaining purchase\\ costs (<15\% of pers.\\ costs)}
      & \disptoken{@pcRemainingCost\arabic{#1}} \\
    \cline{1-2}
    \thead{Total} & \disptoken{@pcTotalCost\arabic{#1}} \\
    \cline{1-2}
  \end{xltabular}
}
%    \end{macrocode}
%
% \subsection*{In-kind contributions}
%
%    \begin{macrocode}
\newcommand{\inkindcontribution}[5]{%
  \stepcounter{@pInkindContributions\getPnum{#1}}
  \expandafter\xdef\csname %
    @ikcThirdPartyName\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#2}%
  \expandafter\xdef\csname %
    @ikcCategory\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#3}%
  \expandafter\xdef\csname %
    @ikcCost\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#4}%
  \expandafter\xdef\csname %
    @ikcJustification\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#5}%
}
%    \end{macrocode}
%
% In-kind contributions table
%
%    \begin{macrocode}
\newcommand{\makeinkindcontributionstable}{%
  \newcounter{@ikcparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@ikcparticipant}<\value{@pcount}}{%
      \stepcounter{@ikcparticipant}%
      \ifthenelse%
        {\value{@pInkindContributions\arabic%
        {@ikcparticipant}}>0}% If they have in-kind contributions
      {\ikctablesection%
        {@ikcparticipant}}% Print their in-kind contributions table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% In-kind contributions table section
%
%    \begin{macrocode}
\newcommand{\ikctablesection}[1]{%
  \newcounter{@ikccost\arabic{#1}}
  \edef\ikcrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}%
    {|>{\raggedright}p{40mm}|>{\raggedright}p{35mm}|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{4}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    \thead{Third party name} & \thead{Category} &
    \thead{Cost (€)} & \thead{Justification} \\
    \hline
    % For each in-kind contribution
    \whiledo%
      {\value{@ikccost\arabic{#1}}<\numexpr\value%
      {@pInkindContributions\arabic{#1}}-1}{%
    \stepcounter{@ikccost\arabic{#1}}%
    \ikctablerow{#1}{@ikccost\arabic{#1}}%
    }%
    \stepcounter{@ikccost\arabic{#1}}%
    \ikctablerow{#1}{@ikccost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% In-kind contributions table row
%
%    \begin{macrocode}
\newcommand{\ikctablerow}[2]{%
  \disptoken{@ikcThirdPartyName\arabic{#1}.\arabic{#2}} &
  \disptoken{@ikcCategory\arabic{#1}.\arabic{#2}} &
  \disptoken{@ikcCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@ikcJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Summary canvas}
%
%    \begin{macrocode}
\RequirePackage{pdflscape} % PDF landscape for Summary canvas
\newenvironment{summarycanvas}{%
  \begin{tcbraster}[%
    raster columns=3,
    ]%
}{%
  \end{tcbraster}%
}
\newenvironment{summarybox}[1]{%
  \begin{tcolorbox}[%
    colframe=summaryblue,
    colbacktitle=summaryblue,
    %height fill,
    fonttitle=\bfseries\sffamily,
    halign title=center,
    title={#1}
    ]
}{%
  \end{tcolorbox}%
}
%    \end{macrocode}
%
% Code for sideways figures, adapted from
% \url{https://tex.stackexchange.com/a/307142/22603}.
% Copyright 2016 John Kormylo and licensed under the Creative Commons
% Attribution-ShareAlike 4.0 license (CC~BY-SA~4.0), per personal
% communication with Tristan Miller on 2023-12-02.
% 
%    \begin{macrocode}
\RequirePackage{everypage}
\RequirePackage{environ}
\newcounter{abspage}% \thepage not reliab
\newcommand{\newSFPage}[1]% #1 = \theabspage
  {\global\expandafter\let\csname SFPage@#1\endcsname\null}
\NewEnviron{SidewaysFigure}{\begin{figure}[p]
\protected@write\@auxout%
  {\let\theabspage=\relax}% delays expansion until shipout
  {\string\newSFPage{\theabspage}}%
\ifdim\textwidth=\textheight
  \rotatebox{90}{\parbox[c][\textwidth][c]{\linewidth}{\BODY}}%
\else
  \rotatebox{90}{\parbox[c][\textwidth][c]{\textheight}{\BODY}}%
\fi
\end{figure}}
\AddEverypageHook{% check if sideways figure on this page
  \ifdim\textwidth=\textheight
    \stepcounter{abspage}% already in landscape
  \else
    \@ifundefined{SFPage@\theabspage}{}{\global\pdfpageattr{/Rotate 0}}%
    \stepcounter{abspage}%
    \@ifundefined{SFPage@\theabspage}{}%
      {\global\pdfpageattr{/Rotate 90}}%
  \fi}
%    \end{macrocode}
%
% \subsection*{Font setup}
%
%    \begin{macrocode}
\RequirePackage{newtxtext} % Use Times for main text
\RequirePackage{newtxmath} % Use Times for math
\renewcommand*\ttdefault{lmvtt} % Latin Modern Typewriter Proportional
%    \end{macrocode}
%
% \subsection*{Page header and footer}
%
%    \begin{macrocode}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\newcommand{\Paragraph}[1]{\vspace*{-.45em}\paragraph{#1.}}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % Remove line at top
\lhead{\sffamily\scriptsize Call: \@callidentifier\ --- \@callname}
\rhead{}
\chead{}
\cfoot{\raisebox{\dimexpr(-\height+\ht\strutbox-\dp\strutbox)/2}{%
    \begin{tcolorbox}[nobeforeafter,
                      fontupper=\scriptsize\sffamily,
                      colback=footergrey,
                      boxrule=0.75pt,
                      halign=center,
                      boxsep=0mm,
                     ]%
      \strut Part B -- Page \thepage\ of \pageref*{LastPage}%
    \end{tcolorbox}%
  }%
}
%    \end{macrocode}
%
% \subsection*{Titles and section headings}
%
% Document title
%
%    \begin{macrocode}
\def\@maketitle{%
  \newpage%
  \noindent%
  \large%
  \framebox[\textwidth]%
    {\null\hfill\textsf{\textbf{\textsc{\@title}}}\hfill\null}%
  \par
  \vskip 1.5em\thispagestyle{fancy}%
  \ifdefined\@calltopic
  \vspace{-5mm}
  \begin{center}
    Topic: \@calltopic
  \end{center}
  \fi
}
%    \end{macrocode}
%
% Format page limits used by the Horizon Europe template
%
%    \begin{macrocode}
\NewDocumentCommand{\showpagelimit}{m}
{%
   \ifheria@showinstructions%
   {\normalfont\sffamily\itshape [e.g.\ #1]}%
   \fi%
}
%    \end{macrocode}
%
% Format ``tags'' used by the Horizon Europe template
%
%    \begin{macrocode}
\ExplSyntaxOn
\NewDocumentCommand{\hetag}{mm}
 {%
   \textcolor{taggrey}{\normalfont\sffamily\footnotesize%
   \clist_map_inline:nn { #2 } { \# #1 ##1 #1 \# ~}%
   }%
 }
\ExplSyntaxOff
\NewDocumentCommand{\opentag}{m}{\hetag{@}{#1}}
\NewDocumentCommand{\closetag}{m}{\noindent\hetag{§}{#1}}
%    \end{macrocode}
%
% Format section titles, with optional opening and closing tags
%
%    \begin{macrocode}
\RequirePackage[explicit]{titlesec}
\titleformat{\section}
  {\normalfont\normalsize\bfseries\sffamily}%
  {\thesection}{1em}{#1 \sectiontag\sectionpagelimit}
\titleformat{\subsection}
  {\normalfont\normalsize\bfseries\sffamily}%
  {\thesubsection}{1em}{#1 \sectiontag\sectionpagelimit}
\titleformat{\subsubsection}
  {\normalfont\normalsize\bfseries\sffamily}%
  {\thesubsubsection}{1em}{#1 \sectiontag\sectionpagelimit}
\NewDocumentCommand{\extendedsection}{sO{#3}mooo}{%
  \IfValueTF{#4}%
    {\renewcommand{\sectiontag}{\opentag{#4}}}%
    {\renewcommand{\sectiontag}{}}%
  \IfValueTF{#6}%
    {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}%
    {\renewcommand{\sectionpagelimit}{}}%
  \IfValueT{#5}{%
    \closetag{#5}%
  }%
  \IfBooleanTF{#1}{%
    \latexsection*{#3}%
  }{%
    \latexsection[#2]{#3}%
  }%
}
\NewDocumentCommand{\extendedsubsection}{sO{#3}mooo}{%
  \IfValueTF{#4}%
    {\renewcommand{\sectiontag}{\opentag{#4}}}%
    {\renewcommand{\sectiontag}{}}%
  \IfValueTF{#6}%
    {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}%
    {\renewcommand{\sectionpagelimit}{}}%
  \IfValueT{#5}{%
    \closetag{#5}%
  }%
  \IfBooleanTF{#1}{%
    \latexsubsection*{#3}%
  }{%
    \latexsubsection[#2]{#3}%
  }%
}
\NewDocumentCommand{\extendedsubsubsection}{sO{#3}mooo}{%
  \IfValueTF{#4}%
    {\renewcommand{\sectiontag}{\opentag{#4}}}%
    {\renewcommand{\sectiontag}{}}%
  \IfValueTF{#6}%
    {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}%
    {\renewcommand{\sectionpagelimit}{}}%
  \IfValueT{#5}{%
    \closetag{#5}%
  }%
  \IfBooleanTF{#1}{%
    \latexsubsubsection*{#3}%
  }{%
    \latexsubsubsection[#2]{#3}%
  }%
}
\newcommand{\sectiontag}{}
\newcommand{\sectionpagelimit}{}
\AtBeginDocument{%
  \NewCommandCopy{\latexsection}{\section}%
  \RenewCommandCopy{\section}{\extendedsection}%
  \NewCommandCopy{\latexsubsection}{\subsection}%
  \RenewCommandCopy{\subsection}{\extendedsubsection}%
  \NewCommandCopy{\latexsubsubsection}{\subsubsection}%
  \RenewCommandCopy{\subsubsection}{\extendedsubsubsection}%
}
%    \end{macrocode}
%
% \subsection*{Official Horizon Europe template instructions}
%
%    \begin{macrocode}
\RequirePackage[inline]{enumitem} % For custom bullets
\RequirePackage[normalem]{ulem} % For underlined text
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=heria,
  prefix=heria@
}
\DeclareBoolOption{showinstructions}
\ProcessKeyvalOptions*

\RequirePackage{twemojis}
\RequirePackage{xspace}
\newcommand{\twarn}{\twemoji{warning}\xspace}
\RequirePackage{verbatim}
\newenvironment{instructions}{%
  \begin{tcolorbox}[fontupper=\sffamily,
                    fonttitle=\sffamily\bfseries,
                    colback=blue!5!white,
                    colframe=blue!75!black,
                    parbox=false,
                    breakable
  ]%
  }{%
  \end{tcolorbox}%
  }

\newcommand{\heinstructions}[1]{%
  \ifheria@showinstructions%
  \begin{instructions}%
    \input{hi-#1}%
  \end{instructions}%
  \fi%
}
%    \end{macrocode}
%\iffalse
%</class>
%<*hi-annexes>
\textbf{ANNEXES TO PROPOSAL PART B}

Some calls may ask to upload annexes to proposal part B. The annexes
must be uploaded as separate documents in the submission system. The
most common annexes to be uploaded in Horizon Europe are (standard
templates are published in the Funding \& Tenders portal):

\begin{itemize}
\item
  \textbf{CLINICAL TRIALS:} Annex with information on clinical trials
\item
  \textbf{FINANCIAL SUPPORT TO THIRD PARTIES:} Annex with information on
  financial support to third parties.~
\item
  \textbf{CALLS FLAGGED AS SECURITY SENSITIVE:} Annex with information
  on security aspects.~
\item
  \textbf{ETHICS:} ethics self-assessment should be included in proposal
  part A. However, in calls where several serious ethics issues are
  expected, the character limited in this section of proposal part A may
  not be sufficient for participants to give all necessary information.
  In those cases, participants may include additional information in an
  annex to proposal part B.~~
\end{itemize}
%</hi-annexes>
%<*hi-capacity>
\twarn \emph{The individual participants of the consortium are
  described in a separate section under Part A. There is no need to
  repeat that information here.}

\begin{itemize}
\item
  Describe the consortium. How does it match the project's objectives,
  and bring together the necessary disciplinary and inter-disciplinary
  knowledge? Show how this includes expertise in social sciences and
  humanities, open science practices, and gender aspects of R\&I, as
  appropriate. Include in the description affiliated entities and
  associated partners, if any.
\item
  Show how the partners will have access to critical infrastructure
  needed to carry out the project activities.
\item
  Describe how the members complement one another (and cover the value
  chain, where appropriate)
\item
  In what way does each of them contribute to the project? Show that
  each has a valid role, and adequate resources in the project to fulfil
  that role.
\item
  If applicable, describe the industrial/commercial involvement in the
  project to ensure exploitation of the results and explain why this is
  consistent with and will help to achieve the specific measures which
  are proposed for exploitation of the results of the project (see
  section 2.2).
\item
  \textbf{Other countries and international organisations}: If one or
  more of the participants requesting EU funding is based in a country
  or is an international organisation that is not automatically eligible
  for such funding (entities from Member States of the EU, from
  Associated Countries and from one of the countries in the exhaustive
  list included in the Work Programme General Annexes B are
  automatically eligible for EU funding), explain why the participation
  of the entity in question is essential to successfully carry out the
  project.
\end{itemize}
%</hi-capacity>
%<*hi-criticalrisks>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\textbf{Definition critical risk:}

A critical risk is a plausible event or issue that could have a high
adverse impact on the ability of the project to achieve its objectives.

\textbf{Level of likelihood to occur: Low/medium/high}

The likelihood is the estimated probability that the risk will
materialise even after taking account of the mitigating measures put in
place.

\textbf{Level of severity: Low/medium/high}

The relative seriousness of the risk and the significance of its effect.
\end{tcolorbox}
%</hi-criticalrisks>
%<*hi-deliverables-key>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\textbf{KEY}

Deliverable numbers in order of delivery dates. Please use the numbering
convention \textless WP number\textgreater.\textless number of
deliverable within that WP\textgreater.

For example, deliverable 4.2 would be the second deliverable from work
package 4.

\textbf{Type:}

Use one of the following codes:

\begin{quote}
R: Document, report (excluding the periodic and final reports)

DEM: Demonstrator, pilot, prototype, plan designs

DEC: Websites, patents filing, press \& media actions, videos, etc.

DATA: Data sets, microdata, etc.

DMP: Data management plan

ETHICS: Deliverables related to ethics issues.

SECURITY: Deliverables related to security issues

OTHER: Software, technical diagram, algorithms, models, etc.
\end{quote}

\textbf{Dissemination level:}

Use one of the following codes:

\begin{quote}
PU -- Public, fully open, e.g. web (Deliverables flagged as public will
be automatically published in CORDIS project's page)

SEN -- Sensitive, limited under the conditions of the Grant Agreement

Classified R-UE/EU-R -- EU RESTRICTED under the Commission Decision
No2015/444

Classified C-UE/EU-C -- EU CONFIDENTIAL under the Commission Decision
No2015/444

Classified S-UE/EU-S -- EU SECRET under the Commission Decision
No2015/444
\end{quote}

\textbf{Delivery date}

Measured in months from the project start date (month 1)
\end{tcolorbox}
%</hi-deliverables-key>
%<*hi-deliverables>
Only include deliverables that you consider essential for effective
project monitoring.\footnote{You must include a data
  management plan (DMP) and a `plan for dissemination and exploitation
  including communication activities as distinct deliverables within the
  first 6 months of the project. The DMP will evolve during the lifetime
  of the project in order to present the status of the
  project\textquotesingle s reflections on data management. A template
  for such a plan is available in the
  \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/common/guidance/om_en.pdf}{Online
  Manual} on the Funding \& Tenders Portal.}
%</hi-deliverables>
%<*hi-excellence>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
  \textbf{Excellence – aspects to be taken into account.}
  \begin{itemize}
  \item Clarity and pertinence of the project’s objectives, and the
    extent to which the proposed work is ambitious, and goes beyond
    the state of the art.
  \item Soundness of the proposed methodology, including the
    underlying concepts, models, assumptions, interdisciplinary
    approaches, appropriate consideration of the gender dimension in
    research and innovation content, and the quality of open science
    practices, including sharing and management of research outputs
    and engagement of citizens, civil society and end users where
    appropriate.
  \end{itemize}
  \end{tcolorbox}
  \noindent \twarn The following aspects will be taken into account
  only to the extent that the proposed work is within the scope of the
  work programme topic.
%</hi-excellence>
%<*hi-impact>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\emph{\textbf{Impact -- aspects to be taken into account.}}

\begin{itemize}
\item
  Credibility of the pathways to achieve the expected outcomes and
  impacts specified in the work programme, and the likely scale and
  significance of the contributions due to the project.
\item
  Suitability and quality of the measures to maximise expected outcomes
  and impacts, as set out in the dissemination and exploitation plan,
  including communication activities.
\end{itemize}
    \end{tcolorbox}

    \emph{The results of your project should make a contribution to the
expected outcomes set out for the work programme topic over the medium
term, and to the wider expected impacts set out in the `destination'
over the longer term.}

\emph{In this section you should show how your project could contribute
to the outcomes and impacts described in the work programme, the likely
scale and significance of this contribution, and the measures to
maximise these impacts.}
%</hi-impact>
%<*hi-inkind>
Please complete the table below for each participant that will make use
of in-kind contributions (non-financial resources made available free of
charge by third parties). In kind contributions provided by third
parties free of charge are declared by the participants as eligible
direct costs in the corresponding cost category (e.g. personnel costs or
purchase costs for equipment).
%</hi-inkind>
%<*hi-measures>
\begin{itemize}
\item
  Describe the planned measures to maximise the impact of your project
  by providing a first version of your `\uline{plan for the
  dissemination and exploitation including communication activities'}.
  Describe the dissemination, exploitation and communication measures
  that are planned, and the target group(s) addressed (e.g. scientific
  community, end users, financial actors, public at large).

\begin{itemize}[label=\twarn]
\item
  \emph{Please remember that this plan is an admissibility condition,
  unless the work programme topic explicitly states otherwise. In case
  your proposal is selected for funding, a more detailed `plan for
  dissemination and exploitation including communication activities'
  will need to be provided as a mandatory project deliverable within 6
  months after signature date. This plan shall be periodically updated
  in alignment with the project's progress.}
\item
  \emph{\uline{Communication}}\footnote{For further guidance on
    communicating EU research and innovation for project participants,
    please refer to the
    \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/common/guidance/om_en.pdf}{Online
    Manual} on the Funding \& Tenders Portal} \emph{measures should
  promote the project throughout the full lifespan of the project. The
  aim is to inform and reach out to society and show the activities
  performed, and the use and the benefits the project will have for
  citizens. Activities must be strategically planned, with clear
  objectives, start at the outset and continue through the lifetime of
  the project. The description of the communication activities needs to
  state the main messages as well as the tools and channels that will be
  used to reach out to each of the chosen target groups.}
\item
  \emph{All measures should be proportionate to the scale of the
  project, and should contain concrete actions to be implemented both
  during and after the end of the project, e.g. standardisation
  activities. Your plan should give due consideration to the possible
  follow-up of your project, once it is finished. In the justification,
  explain why each measure chosen is best suited to reach the target
  group addressed. Where relevant, and for innovation actions, in
  particular, describe the measures for a plausible path to
  commercialise the innovations.}
\item
  \emph{If exploitation is expected primarily in non-associated third
  countries, justify by explaining how that exploitation is still in the
  Union's interest.}
\item
  \emph{Describe possible feedback to policy measures generated by the
  project that will contribute to designing, monitoring, reviewing and
  rectifying (if necessary) existing policy and programmatic measures or
  shaping and supporting the implementation of new policy initiatives
  and decisions.}
\end{itemize}

\item
  Outline your strategy for the management of intellectual property,
  foreseen protection measures, such as patents, design rights,
  copyright, trade secrets, etc., and how these would be used to support
  exploitation.

\begin{itemize}[label=\twarn]
\item
  \emph{If your project is selected, you will need an appropriate
  consortium agreement to manage (amongst other things) the ownership
  and access to key knowledge (IPR, research data etc.). Where relevant,
  these will allow you, collectively and individually, to pursue market
  opportunities arising from the project.}
\item
  \emph{If your project is selected, you must indicate the owner(s) of
  the results (results ownership list) in the final periodic report.}
\end{itemize}
\end{itemize}


%</hi-measures>
%<*hi-methodology>
\begin{itemize}
\item
  Describe and explain the overall methodology, including the concepts,
  models and assumptions that underpin your work. Explain how this will
  enable you to deliver your project's objectives. Refer to any
  important challenges you may have identified in the chosen methodology
  and how you intend to overcome them. \emph{{[}e.g. 10 pages{]}}

\begin{itemize}[label=\twarn]
\item
  \emph{This section should be presented as a narrative. The detailed
  tasks and work packages are described below under `Implementation'.}
\item
  \emph{Where relevant, include how the project methodology complies
  with the `do no significant harm' principle as per Article 17 of
  \href{https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=celex:32020R0852}{Regulation
  (EU) No 2020/852} on the establishment of a framework to facilitate
  sustainable investment (i.e. the so-called \textquotesingle EU
  Taxonomy Regulation\textquotesingle). This means that the methodology
  is designed in a way it is not significantly harming any of the six
  environmental objectives of the EU Taxonomy Regulation.}
\item
  \emph{If you plan to use, develop and/or deploy artificial
  intellingence (AI) based systems and/or techniques you must
  demonstrate their technical robustness. AI-based systems or techniques
  should be, or be developed to become:~}

  \begin{itemize}
  \item
    \emph{technically robust, accurate and reproducible, and able to
    deal with and inform about possible failures, inaccuracies and
    errors, proportionate to the assessed risk they pose~}
  \item
    \emph{socially robust, in that they duly consider the context and
    environment in which they operate~}
  \item
    \emph{reliable and function as intended, minimizing unintentional
    and unexpected harm, preventing unacceptable harm and safeguarding
    the physical and mental integrity of humans~}
  \item
    \emph{able to provide a suitable explanation of their
    decision-making processes, whenever they can have a significant
    impact on people's lives.}
  \end{itemize}
\end{itemize}

\item
  Describe any national or international research and innovation
  activities whose results will feed into the project, and how that link
  will be established; \emph{{[}e.g. 1 page{]}}
\item
  Explain how expertise and methods from different disciplines will be
  brought together and integrated in pursuit of your objectives. If you
  consider that an inter-disciplinary approach is unnecessary in the
  context of the proposed work, please provide a justification.
  \emph{{[}e.g. 1/2 page{]}}
\item
  For topics where the work programme indicates the need for the
  integration of social sciences and humanities, show the role of these
  disciplines in the project or provide a justification if you consider
  that these disciplines are not relevant to your proposed project.
  \emph{{[}e.g. 1/2 page{]}}
\item
  Describe how the gender dimension (i.e. sex and/or gender analysis) is
  taken into account in the project's research and innovation content
  \emph{{[}e.g. 1 page{]}. If} you do not consider such a gender
  dimension to be relevant in your project, please provide a
  justification.

\begin{itemize}[label=\twarn]
\item
  \emph{Note: This section is mandatory except for topics which have
  been identified in the work programme as not requiring the integration
  of the gender dimension into R\&I content.}
\item
  \emph{Remember that that this question relates to the \uline{content}
  of the planned research and innovation activities, and not to gender
  balance in the teams in charge of carrying out the project.}
\item
  \emph{Sex and gender analysis refers to biological characteristics and
  social/cultural factors respectively. For guidance on methods of sex /
  gender analysis and the issues to be taken into account, please refer
  to}
  \url{https://ec.europa.eu/info/news/gendered-innovations-2-2020-nov-24_en}
\end{itemize}

\item
  Describe how appropriate open science practices are implemented as an
  integral part of the proposed methodology. Show how the choice of
  practices and their implementation are adapted to the nature of your
  work, in a way that will increase the chances of the project
  delivering on its objectives \emph{{[}e.g. 1 page{]}}. If you believe
  that none of these practices are appropriate for your project, please
  provide a justification here.

\begin{itemize}[label=\twarn]
\item
  \emph{Open science is an approach based on open cooperative work and
  systematic sharing of knowledge and tools as early and widely as
  possible in the process. Open science practices include early and open
  sharing of research (for example through preregistration, registered
  reports, pre-prints, or crowd-sourcing); research output management;
  measures to ensure reproducibility of research outputs; providing open
  access to research outputs (such as publications, data, software,
  models, algorithms, and workflows); participation in open peer-review;
  and involving all relevant knowledge actors including citizens, civil
  society and end users in the co-creation of R\&I agendas and contents
  (such as citizen science).}
\item
  \emph{Please note that this question does not refer to outreach
  actions that may be planned as part of communication, dissemination
  and exploitation activities. These aspects should instead be described
  below under `Impact'.}
\end{itemize}

\item
  Research \textbf{data management and management of other research
  outputs:} Applicants generating/collecting data and/or other research
  outputs (except for publications) during the project must provide
  maximum 1 page on how the data/ research outputs will be managed in
  line with the FAIR principles (Findable, Accessible, Interoperable,
  Reusable), addressing the following (the description should be
  specific to your project): \emph{{[}1 page{]}}

\begin{quote}
\textbf{Types of data/research outputs} (e.g. experimental,
observational, images, text, numerical) and their estimated size; if
applicable, combination with, and provenance of, existing data.

\textbf{Findability of data/research outputs:} Types of~persistent and
unique~identifiers (e.g. digital object identifiers)~and~trusted
repositories~that will be used.

\textbf{Accessibility of data/research outputs:}~IPR considerations and
timeline for open access (if open access not provided, explain why);
provisions for access to restricted data for verification purposes.

\textbf{Interoperability of data/research outputs:} Standards, formats
and vocabularies for data and metadata.

\textbf{Reusability of data/research outputs}:~ Licenses for data
sharing and re-use (e.g. Creative Commons, Open Data
Commons);~availability of tools/software/models for data generation and
validation/interpretation /re-use.

\textbf{Curation and storage/preservation costs}; person/team
responsible for data management and quality assurance.
\end{quote}

\begin{itemize}[label=\twarn]
\item
  \emph{Proposals selected for funding under Horizon Europe will need to
  develop a~detailed data management plan (DMP) for making their
  data/research outputs findable, accessible, interoperable and reusable
  (FAIR) as a deliverable by month 6 and revised towards the end of a
  project's lifetime.}
\item
  \emph{For guidance on open science practices and research data
  management, please refer to the relevant section of the
  \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/horizon/guidance/programme-guide_horizon_en.pdf}{HE
  Programme Guide} on the Funding \& Tenders Portal.}
\end{itemize}
\end{itemize}
%</hi-methodology>
%<*hi-milestones>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\textbf{KEY}

\textbf{Due date}

Measured in months from the project start date (month 1)

\textbf{Means of verification}

Show how you will confirm that the milestone has been attained. Refer to
indicators if appropriate. For example: a laboratory prototype that is
`up and running'; software released and validated by a user group; field
survey complete and data quality validated.
\end{tcolorbox}
%</hi-milestones>
%<*hi-objectives>
\begin{itemize}
\item
  Briefly describe the objectives of your proposed work. Why are they
  pertinent to the work programme topic? Are they measurable and
  verifiable? Are they realistically achievable?
\item
  Describe how your project goes beyond the state-of-the-art, and the
  extent the proposed work is ambitious. Indicate any exceptional
  ground-breaking R\&I, novel concepts and approaches, new products,
  services or business and organisational models. Where relevant,
  illustrate the advance by referring to products and services already
  available on the market. Refer to any patent or publication search
  carried out.
\item
  Describe where the proposed work is positioned in terms of R\&I
  maturity (i.e. where it is situated in the spectrum from `idea to
  application', or from `lab to market'). Where applicable, provide an
  indication of the Technology Readiness Level, if possible
  distinguishing the start and by the end of the project.

  \begin{itemize}[label=\twarn]
  \item \emph{Please bear in mind that advances beyond the state of
      the art must be interpreted in the light of the positioning of
      the project.  Expectations will not be the same for RIAs at
      lower TRL, compared with Innovation Actions at high TRLs. }
  \end{itemize}
\end{itemize}
%</hi-objectives>
%<*hi-othercosts>
Please complete the table below for each participant that would like to
declare costs under other costs categories (e.g. internally invoiced
goods and services), irrespective of the percentage of personnel costs.
%</hi-othercosts>
%<*hi-participant-numbering>
Please use the same participant numbering and name as that used in the
administrative proposal forms.
%</hi-participant-numbering>
%<*hi-participants>
\twarn The consortium members are listed in part A of the proposal
(application forms). A summary list should also be provided in the
table below.
%</hi-participants>
%<*hi-pathways>
\begin{itemize}
\item
  \begin{quote}
    Provide a \textbf{narrative} explaining how the project's results
    are expected to make a difference in terms of impact, beyond the
    immediate scope and duration of the project. The narrative should
    include the components below, tailored to your project.
  \end{quote}

\begin{enumerate}
\def\labelenumi{(\alph{enumi})}
\item
  Describe the unique contribution your project results would make
  towards (1) the \textbf{outcomes} specified in this topic, and (2) the
  \textbf{wider impacts}, in the longer term, specified in the
  respective destinations in the work programme.

\begin{itemize}[label=\twarn]
\item
  \emph{Be specific, referring to the effects of your project, and not
  R\&I in general in this field.}
\item
  \emph{State the target groups that would benefit. Even if target
  groups are mentioned in general terms in the work programme, you
  should be specific here, breaking target groups into particular
  interest groups or segments of society relevant to this project.}
\item
  \emph{The outcomes and impacts of your project may:}

  \begin{itemize}
  \item
    \emph{Scientific, e.g. contributing to specific scientific advances,
    across and within disciplines, creating new knowledge, reinforcing
    scientific equipment and instruments, computing systems (i.e.
    research infrastructures);}
  \item
    \emph{Economic/technological, e.g. bringing new products, services,
    business processes to the market, increasing efficiency, decreasing
    costs, increasing profits, contributing to standards' setting, etc.}
  \item
    \emph{Societal , e.g. decreasing CO\textsubscript{2} emissions,
    decreasing avoidable mortality, improving policies and decision
    making, raising consumer awareness.}
  \end{itemize}

\emph{Only include such outcomes and impacts where your project would
make a significant and direct contribution. Avoid describing very
tenuous links to wider impacts. However, include any potential
negative environmental outcome or impact of the project including when
expected results are brought at scale (such as at commercial level).
Where relevant, explain how the potential harm can be managed.}
\end{itemize}

\item
  Give an indication of the scale and significance of the project's
  contribution to the expected outcomes and impacts, should the project
  be successful. Provide quantified estimates where possible and
  meaningful.

\begin{itemize}[label=\twarn]
\item
  `\emph{\uline{Scale'} refers to how widespread the outcomes and
  impacts are likely to be. For example, in terms of the size of the
  target group, or the proportion of that group, that should benefit
  over time; \uline{`Significance'} refers to the importance, or value,
  of those benefits. For example, number of additional healthy life
  years; efficiency savings in energy supply.}

\item
  \emph{Explain your baselines, benchmarks and assumptions used for
  those estimates. Wherever possible, quantify your estimation of the
  effects that you expect from your project. Explain assumptions that
  you make, referring for example to any relevant studies or statistics.
  Where appropriate, try to use only one methodology for calculating
  your estimates: not different methodologies for each partner, region
  or country (the extrapolation should preferably be prepared by one
  partner).}

\item
  \emph{Your estimate must relate to this project only - the effect of
  other initiatives should not be taken into account.}
\end{itemize}

\item
  Describe any requirements and potential barriers - arising from
  factors beyond the scope and duration of the project - that may
  determine whether the desired outcomes and impacts are achieved. These
  may include, for example, other R\&I work within and beyond Horizon
  Europe; regulatory environment; targeted markets; user behaviour.
  Indicate if these factors might evolve over time. Describe any
  mitigating measures you propose, within or beyond your project, that
  could be needed should your assumptions prove to be wrong, or to
  address identified barriers.

\begin{itemize}[label=\twarn]
\item
  \emph{Note that this does not include the critical risks inherent to
  the management of the project itself , which should be described below
  under `Implementation'.}
\end{itemize}
\end{enumerate}
\end{itemize}
%</hi-pathways>
%<*hi-purchasecosts>
Please complete the table below for each participant if the purchase
costs (i.e. the sum of the costs for 'travel and subsistence',
`equipment', and `other goods, works and services') exceeds 15\% of the
personnel costs for that participant (according to the budget table in
proposal part A). The record must list cost items in order of costs and
starting with the largest cost item, up to the level that the remaining
costs are below 15\% of personnel costs.
%</hi-purchasecosts>
%<*hi-quality>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
  \emph{\textbf{Quality and efficiency of the implementation -- aspects to
be taken into account}}

\begin{itemize}
\item
  \emph{Quality and effectiveness of the work plan, assessment of risks,
  and appropriateness of the effort assigned to work packages, and the
  resources overall}
\item
  \emph{Capacity and role of each participant, and extent to which the
  consortium as a whole brings together the necessary expertise.}
\end{itemize}
  \end{tcolorbox}
%</hi-quality>
%<*hi-staffeffort>
\emph{Please indicate the number of person/months over the whole
duration of the planned work, for each work package, for each
participant. Identify the work-package leader for each WP by showing the
relevant person-month figure in bold.}
%</hi-staffeffort>
%<*hi-subcontractingcosts>
For each participant describe and justify the tasks to be subcontracted
(please note that core tasks of the project should not be
sub-contracted).
%</hi-subcontractingcosts>
%<*hi-summary>
  Provide a summary of this section by presenting in the canvas below the
key elements of your project impact pathway and of the measures to
maximise its impact.
%</hi-summary>
%<*hi-tables>
\twarn \emph{Use plain text for the tables in section 3.1. If the proposal is
invited to start Grant Agreement preparation, these tables will have to
be encoded in the grant management IT tool, where no graphics or special
formats are supported.}
%</hi-tables>
%<*hi-workplan>
Please provide the following:

\begin{itemize}
\item
  
  brief presentation of the overall structure of the work plan;
\item
  
  timing of the different work packages and their components (Gantt
  chart or similar);
\item
  
  graphical presentation of the components showing how they inter-relate
  (Pert chart or similar).
\item
  
  detailed work description, i.e.:

  \begin{itemize}
  \item
    
    a list of work packages (table 3.1a);
  \item
    
    a description of each work package (table 3.1b);
  \item
    
    a list of deliverables (table 3.1c);
\begin{itemize}[label=\twarn]
\item
  \emph{Give full details. Base your account on the logical structure of
  the project and the stages in which it is to be carried out.}
  \emph{The number of work packages should be proportionate to the scale
  and complexity of the project.}
\item
  \emph{You should give enough detail in each work package to justify
  the proposed resources to be allocated and also quantified information
  so that progress can be monitored, including by the Commission}
\item
  \emph{Resources assigned to work packages should be in line with their
  objectives and deliverables. You are advised to include a distinct
  work package on `project management', and to give due visibility in
  the work plan to `data management' `dissemination and exploitation'
  and `communication activities', either with distinct tasks or distinct
  work packages.}
\item
  \emph{You will be required to update the `plan for the dissemination
  and exploitation of results including communication activities', and a
  `data management plan', (this does not apply to topics where a plan
  was not required.) This should include a record of activities related
  to dissemination and exploitation that have been undertaken and those
  still planned.}
\item
  \emph{Please make sure the information in this section matches the
  costs as stated in the budget table in section 3 of the application
  forms, and the number of person months, shown in the detailed work
  package descriptions.}
\end{itemize}
\end{itemize}

\item
  a list of milestones (table 3.1d);
  
\item
  a list of critical risks, relating to project implementation, that the
  stated project\textquotesingle s objectives may not be achieved.
  Detail any risk mitigation measures. You will be able to update the
  list of critical risks and mitigation measures as the project
  progresses (table 3.1e);
  
\item
  a table showing number of person months required (table 3.1f);
  
\item
  a table showing description and justification of subcontracting costs
  for each participant (table 3.1g);

\item
  a table showing justifications for `purchase costs' (table 3.1h) for
  participants where those costs exceed 15\% of the personnel costs
  (according to the budget table in proposal part A);
  
\item
  if applicable, a table showing justifications for `other costs
  categories' (table 3.1i);
  
\item
  if applicable, a table showing in-kind contributions from third
  parties (table 3.1j)
\end{itemize}
%</hi-workplan>
%<*hi-wp-description>
(where appropriate, broken down into tasks), lead partner and role of
participants. Deliverables linked to each WP are listed in table 3.1c
(no need to repeat the information here).
%</hi-wp-description>
%<*hi-wp-objectives>
\twarn \emph{Participants involved in each WP and their efforts are
  shown in table 3.1f. Lead participant and starting and end date of
  each WP are shown in table 3.1a.)}
%</hi-wp-objectives>
%<*heria-proposal>
%% Copyright 2023 Tristan Miller
%%
%% 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
%%   https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%%
\documentclass[showinstructions]{heria}

\title{Skeleton Horizon Europe Proposal}
\callname{insert call name}
\callidentifier{HORIZON-XX0-0000-XXXXX-00-XXXXX}
\calltopic{HORIZON-XX0-0000-XXXXX-00-00}

\begin{document}
\maketitle

\heinstructions{participants}

\noindent\opentag{APP-FORM-HERIAIA}%
\section*{List of participants}[][][1 page]\label{sec:listofparticipants}

\participant
  {University of Upper Freedonia} % Participant organisation name
  {UUF} % Participant short name
  {AT} % Country

\participant
  {Molvania State University} % Participant organisation name
  {MSU} % Participant short name
  {DE} % Country

\participant
  {Institute for Underwater Basket Weaving} % Participant organisation name
  {IUBW} % Participant short name
  {UK} % Country

\makeparticipantstable

\heinstructions{participant-numbering}

\section{Excellence}[REL-EVA-RE]\label{sec:excellence}

\heinstructions{excellence}

\subsection{Objectives and ambition}[PRJ-OBJ-PO][][4 pages]\label{sec:objectives}

\heinstructions{objectives}

\subsection{Methodology}[CON-MET-CM,COM-PLE-CP][PRJ-OBJ-PO][14 pages]\label{sec:methodology}

\heinstructions{methodology}

\subsubsection{Overall methodology}[][][10 pages]\label{sec:overallmethodology}

\subsubsection{Connections to other research activities}[][][1 page]\label{sec:connections}

\subsubsection{Interdisciplinarity}[][][1/2 page]\label{sec:interdisciplinarity}

\subsubsection{Gender dimension}[][][1/2 page]\label{sec:gender} 

\subsubsection{Open science}[][][1 page]\label{sec:openscience}

\subsubsection{Research data management}[][][1 page]\label{sec:rdm}

\section{Impact}[IMP-ACT-IA][CON-MET-CM,COM-PLE-CP,REL-EVA-RE]\label{sec:impact}

\heinstructions{impact}

\subsection{Project's pathways towards impact}[][][4 pages]\label{sec:pathways}

\heinstructions{pathways}

\subsection{Measures to maximise impact: Dissemination, exploitation and communication}[COM-DIS-VIS-CDV][][5 pages, including section 2.3]\label{sec:measures}

\heinstructions{measures}

\subsection{Summary}\label{sec:summary}

\heinstructions{summary}

\closetag{COM-DIS-VIS-CDV}

\begin{SidewaysFigure}
\begin{summarycanvas}%
  \begin{summarybox}{SPECIFIC NEEDS}
  \end{summarybox}%
  \begin{summarybox}{EXPECTED RESULTS}
  \end{summarybox}%
  \begin{summarybox}{D \& E \& C MEASURES}
  \end{summarybox}%
\end{summarycanvas}%
\begin{summarycanvas}%
  \begin{summarybox}{TARGET GROUPS}
  \end{summarybox}%
  \begin{summarybox}{OUTCOMES}
  \end{summarybox}%
  \begin{summarybox}{IMPACTS}
  \end{summarybox}%
\end{summarycanvas}%
\caption{Impact summary tableau}\label{fig:impact}
\end{SidewaysFigure}

\section{Quality and efficiency of the implementation}[QUA-LIT-QL,WRK-PLA-WP][IMP-ACT-IA]\label{sec:quality}

\heinstructions{quality}

\subsection{Work plan and resources}[][][14 pages (19 pages for topics using lump sum funding)~-- including tables]\label{sec:workplan}

\heinstructions{workplan}

\subsubsection*{Table 3.1a: List of work packages}

\heinstructions{tables}

\makeworkpackagestable

\subsubsection*{Table 3.1b: Work package description}

\workpackage
  {ra} % unique ID (used only for cross-referencing deliverables, etc. in LaTeX)
  {Requirements analysis} % work package title
  {UUF}% Lead participant (using short name)
  {1}% Start month
  {6}% End month

\heinstructions{wp-objectives}
\begin{objectives}
\item First objective
\item Second objective
\item \dots
\end{objectives}

\begin{descriptionofwork}
\heinstructions{wp-description}
\task
  {Literature survey} % task name
  {UUF} % short name of lead participant
  {MSU} % other participants (or "all participants", etc.)
  {1--6} % month(s)
  In this task, we will read a lot of books, and\dots
\end{descriptionofwork}

\deliverable
  {dmp} % deliverable name
  {Data management plan} % short description
  {MSU} % short name of lead participant
  {DMP}% type; see Table 3.1c instructions for valid values
  {PU}% dissemination level; see Table 3.1c instructions for valid values
  {6}% delivery date (in months from beginning of project)

\workpackage%
  {integration}% Unique ID (used only for cross-referencing deliverables, etc. in LaTeX)
  {System integration}% Title
  {UUF}% Lead partner (using short name ID)
  {1}% Start month
  {20}% End month

\heinstructions{wp-objectives}
\begin{objectives}
\item First objective
\item Second objective
\item \dots
\end{objectives}

\begin{descriptionofwork}
\heinstructions{wp-description}
\task
  {Develop prototype} % task name
  {UUF} % short name of lead participant
  {MSU} % other participants (or "all participants", etc.)
  {1--10} % month(s)
  In this task, we will do lots of coding, and\dots
\end{descriptionofwork}

\deliverable
  {demo} % deliverable name
  {Working demo system} % short description
  {IUBW} % short name of lead participant
  {DEM}% type; see Table 3.1c instructions for valid values
  {SEN}% dissemination level; see Table 3.1c instructions for valid values
  {10}% delivery date (in months from beginning of project)

\workpackage%
  {dissemination}% Unique ID (used only for cross-referencing deliverables, etc. in LaTeX)
  {Dissemination and exploitation}% Title
  {UUF}% Lead partner (using short name ID)
  {7}% Start month
  {20}% End month

\heinstructions{wp-objectives}
\begin{objectives}
\item First objective
\item Second objective
\item \dots
\end{objectives}

\begin{descriptionofwork}
\heinstructions{wp-description}
\task
  {Organise public workshop} % task name
  {MSU} % short name of lead participant
  {all participants} % other participants (or "all participants", etc.)
  {7--10} % month(s)
  In this task, we will unite the greatest minds\dots
\end{descriptionofwork}

\deliverable
  {proceedings} % deliverable name
  {Workshop proceedings} % short description
  {MSU} % short name of lead participant
  {R}% type; see Table 3.1c instructions for valid values
  {PU}% dissemination level; see Table 3.1c instructions for valid values
  {11}% delivery date (in months from beginning of project)

\subsubsection*{Table 3.1c: List of deliverables}

\heinstructions{deliverables}

\makedeliverablestable

\heinstructions{deliverables-key}

\subsubsection*{Table 3.1d: List of milestones}

\milestone
  {Define use cases} % milestone name
  {WP1} % related work package(s)
  {12} % month due
  {expert review} % means of verification

\milestone
  {Minimum viable product (MVP)} % milestone name
  {WP2} % related work package(s)
  {20} % month due
  {expert review} % means of verification

\heinstructions{milestones}
\makemilestonestable

\subsubsection*{Table 3.1e: Critical risks for implementation}[RSK-MGT-RM]

\criticalrisk
  {Datasets are not available} % description of risk
  {Low} % Likelihood
  {High} % Severity
  {WP1, WP2} % Work package(s) involved
  {We'll find new ones} % Proposed risk-mitigation measures

\heinstructions{criticalrisks}
\makecriticalriskstable

\subsubsection*{Table 3.1f: Summary of staff effort}[][RSK-MGT-RM]

\staffeffort
  {UUF} % short name of participant
  {ra} % name of work package
  {23} % number of person-months
\staffeffort{UUF}{integration}{6}
\staffeffort{UUF}{dissemination}{11}
\staffeffort{MSU}{ra}{18}
\staffeffort{MSU}{integration}{17}
\staffeffort{MSU}{dissemination}{1}
\staffeffort{IUBW}{ra}{21}
\staffeffort{IUBW}{integration}{14}
\staffeffort{IUBW}{dissemination}{5}

\heinstructions{staffeffort}
\makestaffefforttable

\subsubsection*{Table 3.1g: `Subcontracting costs' items}

\heinstructions{subcontractingcosts}

\subcontractingcost
  {UUF} % short name of participant
  {25000} % cost in euros
  {Design project website} % description of tasks and justification

\makesubcontractingcoststable

\subsubsection*{Table 3.1h: `Purchase costs' items (travel and subsistence, equipment and other goods, works and services)}

\heinstructions{purchasecosts}

\purchasecost
  {IUBW} % short name of participant
  {6125} % travel cost in euros
  {Attendance at two conferences} % justification
  {2120} % equipment cost in euros
  {Computing cluster} % justification
  {4775} % other costs in euros
  {Crowdsourcing study} % justification
  {1000} % remaining costs

\makepurchasecoststable

\subsubsection*{Table 3.1i: `Other costs categories' items (e.g., internally invoiced goods and services)}

\heinstructions{othercosts}

\othercost
  {UUF} % short name of participant
  {500} % cost in euros
  {Cookies for bribing reviewers} % justification
\othercost
  {MSU} % short name of participant
  {15000} % cost in euros
  {Legal fees for defending bribery charges} % justification

\makeothercoststable

\subsubsection*{Table 3.1j: `In-kind contributions' provided by third parties}

\inkindcontribution
  {UUF} % short name of participant
  {Freedonian Ministry of Education} % third party name
  {Travel and subsistence} % category (see template instructions for list)
  {300} % cost in euros
  {Use of minister's private jet} % justification

\heinstructions{inkind}
\makeinkindcontributionstable

\subsection{Capacity of participants and consortium as a whole}[CON-SOR-CS,PRJ-MGT-PM][][3 pages]\label{sec:capacity}

\heinstructions{capacity}

\closetag{CON-SOR-CS,PRJ-MGT-PM}

\closetag{QUA-LIT-QL,WRK-PLA-WP}

\heinstructions{annexes}
\end{document}
%</heria-proposal>
% \fi
% \Finale