summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/metastr/metastr.dtx
blob: 8111b295c101a920f14e4c43ee10da48df43178f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
% \iffalse
%
% metastr.dtx Copyright (C) 2020 Niklas Beisert
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Niklas Beisert.
%
% This work consists of the files metastr.dtx and metastr.ins
% and the derived files metastr.sty and metasamp.tex.
%
%<package|sample>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
%<package>\ProvidesPackage{metastr}[2020/06/28 v1.1 Metadata Strings Storage]
%<sample>\ProvidesFile{metasamp.tex}[2020/06/28 v1.1 sample for metastr]
%<*driver>
\def\thedate#1{2020/06/28}\def\theversion#1{v1.1}
\ProvidesFile{metastr.dtx}[\thedate{} \theversion{} metastr reference manual file]
\PassOptionsToClass{10pt,a4paper}{article}
\documentclass{ltxdoc}

\usepackage[margin=35mm]{geometry}
\usepackage{hyperref}
\usepackage{hyperxmp}
\usepackage[usenames]{color}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{ccicons}
\newcommand{\translate}[1]{\ignorespaces}

\IfFileExists{doclicense.sty}{}{%
  \GenericWarning{please install package `doclicense'}}

\hypersetup{colorlinks=true}
\hypersetup{pdfstartview=FitH}
\hypersetup{pdfpagemode=UseNone}
\hypersetup{keeppdfinfo}
\hypersetup{pdfsource={}}
\hypersetup{pdflang={en-UK}}
\hypersetup{pdfcopyright={Copyright 2020 Niklas Beisert.
  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.}}
\hypersetup{pdflicenseurl={http://www.latex-project.org/lppl.txt}}
\hypersetup{pdfcontactaddress={ETH Zurich, ITP, HIT K,
  Wolfgang-Pauli-Strasse 27}}
\hypersetup{pdfcontactpostcode={8093}}
\hypersetup{pdfcontactcity={Zurich}}
\hypersetup{pdfcontactcountry={Switzerland}}
\hypersetup{pdfcontactemail={nbeisert@itp.phys.ethz.ch}}
\hypersetup{pdfcontacturl={http://people.phys.ethz.ch/\xmptilde nbeisert/}}

\newcommand{\secref}[1]{\hyperref[#1]{section \ref*{#1}}}

\parskip1ex
\parindent0pt
\let\olditemize\itemize
\def\itemize{\olditemize\parskip0pt}

\begin{document}

\title{The \textsf{metastr} Package}
\hypersetup{pdftitle={The metastr Package}}
\author{Niklas Beisert\\[2ex]
  Institut f\"ur Theoretische Physik\\
  Eidgen\"ossische Technische Hochschule Z\"urich\\
  Wolfgang-Pauli-Strasse 27, 8093 Z\"urich, Switzerland\\[1ex]
  \href{mailto:nbeisert@itp.phys.ethz.ch}
  {\texttt{nbeisert@itp.phys.ethz.ch}}}
\hypersetup{pdfauthor={Niklas Beisert}}
\hypersetup{pdfsubject={Manual for the LaTeX2e Package metastr}}
\date{\thedate{}, \theversion{}}
\maketitle

\begin{abstract}\noindent
\textsf{metastr} is a \LaTeXe{} package
to store and compose strings in a structured way.
This can serve several purposes such as:
manage and write document metadata;
use templates for formatting document data;
assist in assembling and displaying document license information;
facilitate basic internationalisation and localisation.
\end{abstract}

\begingroup
\parskip0ex
\tableofcontents
\endgroup

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}

This package provides some basic functionality
to store and compose strings.
The main goal is to keep relevant information
for the document in a structured way
such that it can be accessed and used by conveniently
using some standardised methods.

The package has the following goals, tasks and features:
%
\begin{itemize}
\item
manage document metadata and write them to the PDF output file;
\item
set up and use templates for formatting document data, e.g.\ for title pages;
\item
assist in assembling and displaying document license information;
\item
facilitate basic internationalisation and localisation;
\item
provide preset texts and common license statements
in different languages.
\end{itemize}
%
Using the structures provided by the packages makes particular sense
if you can rely on predefined text and formatting or if you have a couple
of similar documents for which you can define suitable templates.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Usage}
\label{sec:usage}

To use the package \textsf{metastr}, add the command
%
\begin{center}
|\usepackage{metastr}|
\end{center}
%
to the preamble of the \LaTeX{} document.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Defining Strings}
\label{sec:def}

\DescribeMacro{\metadef}
\DescribeMacro{\metaset}
The package supplies registers for storing data.
Registers need to be declared before they can be filled or used
(unless the package option |checkdef=false| is set,
see \secref{sec:options}).
A new register \textit{reg} is declared by the command:
%
\begin{center}
|\metadef{|\textit{reg}|}|
\end{center}
%
The register \textit{reg} can be filled
with the value \textit{def}
by the command:
%
\begin{center}
|\metaset{|\textit{reg}|}{|\textit{def}|}|
\end{center}
%

The package declares a couple of registers for storing standard metadata.
The basic set of registers consists of:
%
\begin{center}
\begin{tabular}{ll}
|title| & document title
\\
|subtitle| & document subtitle
\\
|author| & document author
\\
|location| & location associated to the document
\\
|date| & document date
\\
|subject| & `subject' of the document
\\
|keywords| & (a list of) keywords describing the document
\\
|titlematter| & composition register for title matter
\\
|titletext| & composition register for title
\\
|authortext| & composition register for author
\\
|datatext| & composition register for location and date
\end{tabular}
\end{center}
%

The register |titletext| composes information
for printing the title
(such as |title|, |subtitle| but also |author|, |location| and |date|).
It can serve a similar purpose as the \LaTeX{} command |\maketitle|.

Finally, there are some auxiliary registers:
%
\begin{center}
\begin{tabular}{ll}
|language| &
main language of the document
\\
|url| &
URL of the document or additional info on it
\\
|urlmessage| &
message to describe the document URL
\\
|source| &
name of the source file
\\
|draft| &
indicator of draft version
\\
|linebreak| &
expands to linebreak when printed or space otherwise
\end{tabular}
\end{center}
%
The register |language| specifies
the main language used in the document.
This should be a two-letter language code (\textit{ln})
potentially followed by two-letter country code
(\textit{ln}|-|\textit{CN}) such as |en| or |en-GB|.
The language has some impact on selecting
register variants, see \secref{sec:variants} and \secref{sec:language},
it should therefore be set by the command:
%
\begin{center}
|\metasetlang|[|*|]|{|\textit{ln-CN}|}|
\end{center}
%
The starred version declares the language for PDF metadata
rather than the document contents.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Working with Strings}
\label{sec:work}

\DescribeMacro{\metaget}
A register \textit{reg} can be read out by the macro:
%
\begin{center}
|\metaget[]{|\textit{reg}|}{|\textit{def}|}|
\end{center}
%
Note that the (empty) argument in square brackets is mandatory,
it cannot be left out, see \secref{sec:variants}
for further details on its purpose.
This is because |\metaget| must be robust so that its output
can be processed for writing (optional arguments make a macro fragile).
In case the register \textit{reg} has not been filled,
|\metaget| returns nothing.

\DescribeMacro{\metaif}
Sometimes one may want to test whether a register is filled or not,
e.g.\ in order to display a default value otherwise.
This can be achieved by the conditional:
%
\begin{center}
|\metaif[]{|\textit{reg}|}{|\textit{true}|}{|\textit{false}|}|
\end{center}
%
If the register \textit{reg} is filled, return \textit{true}
otherwise \textit{false}.
Again, the argument in square brackets is mandatory.

\DescribeMacro{\metaunset}
The following command cleans a register \textit{reg}
which has previously been filled:
%
\begin{center}
|\metaunset{|\textit{reg}|}|
\end{center}
%
Note that cleaning is different from filling an empty string
when it comes to the conditional |\metaif|
which evaluates true for an empty string but false for a clean register.

\DescribeMacro{\metaappend}
\DescribeMacro{\metaprepend}
\DescribeMacro{\metaaddsep}
The content of registers can be manipulated by some commands.
To append or prepend a string to a register,
use the commands:
%
\begin{center}
\begin{tabular}{l}
|\metaappend{|\textit{reg}|}{|\textit{def}|}|\\
|\metaprepend{|\textit{reg}|}{|\textit{def}|}|\\
|\metaaddsep{|\textit{reg}|}{|\textit{sep}|}{|\textit{def}|}|
\end{tabular}
\end{center}
%
The latter command |\metaaddsep| is designed to compose lists with separators,
it appends the separator \textit{sep}
and the value \textit{def} unless the register is clean,
in which case it is set to \textit{def} without the separator \textit{sep}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{String Variants}
\label{sec:variants}

A versatile feature of the registers is that they can be provided
in several variants.
These variants can be used for producing different representations
of the same register depending on the intended situation.
For example, a title could be given in a fully formatted version
|print| for printing, a bare version for metadata
and a shortened version for headings.
Similarly, translations to different languages
could be stored as different versions of the same register,
see \secref{sec:language}.
Moreover, certain attributes related to the registers
could be stored in additional variants.

\DescribeMacro{titletext}
For example, the register |titletext| exists in
the default variant (mainly intended for writing out metadata)
and the |print| variant
(for printing out a combination of title data on the title page).
The default variant expands to a combination
of |draft|, |title| and |subtitle|
(as far as filled):
%
\begin{center}
[\textit{draft}: ]\textit{title}[ -- \textit{subtitle}]
\end{center}
%
The |print| variant is accessed by the command:
%
\begin{center}
|\metapick[print]{titletext}|
\end{center}
%
It expands to two lines containing |title| and |subtitle| + |draft|
(as far as filled):
%
\begin{center}
\textit{title}\\
\textit{subtitle} |\par| \textit{draft}
\end{center}
%
In fact, the legacy behaviour of |titletext|
also adds two lines containing |author| and |location| + |date|,
as in the new composition register |titlematter| to be explained below;
this behaviour needs to be disabled explicitly
for purposes of backwards compatibility
by the package option |titlematter|.
The formatting style of each line is given
by the variant |style| of the first register on this line;
the vertical space above each line is
produced by the variant |skip|.
Two items on a single line are separated by the variant |sep|
of the second register;
an unfilled |sep| variant puts the two items on individual lines
(by default this applies to |subtitle| and |draft|).

\DescribeMacro{titlematter}
The composition register |titlematter| (in |print| variant):
%
\begin{center}
|\metapick[print]{titlematter}|
\end{center}
%
collects extended information
on the documents for display on the title page
(it substitutes the \LaTeX{} command |\maketitle| in the class \textsf{article}
whose display it mimics):
%
\begin{center}
\textit{title}\\
\textit{subtitle} |\par| \textit{draft}\\
\textit{author}\\
\textit{location}, \textit{date}
\end{center}
%
By adjusting the definitions,
the layout of the title display on the title page
can be adjusted conveniently.

Variants are always specified by an argument |[|\textit{var}|]|
in square brackets preceding the register |{|\textit{reg}|}|.
This argument is optional for commands
which set registers and which can be fragile;
it is however \emph{mandatory} for macros which read
the register content and whose output needs to be expandable
into the output stream
(even though the register is not optional,
it is more uniform to stick with square brackets to specify the variant).
The main declaration involving variants is:
%
\begin{center}
|\metaset[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|
\end{center}
%
This command defines the register \textit{reg} in variant \textit{var}
as \textit{def}.
The default variant is the empty string,
while the variant |print| is intended for printed output.
The variant string is obtained by:
%
\begin{center}
|\metaget[|\textit{var}|]{|\textit{reg}|}|
\end{center}

\DescribeMacro{\metapick}
The variant mechanism can become powerful
through macros which fall back to default variants
if the desired variant has not been filled explicitly:
%
\begin{center}
|\metapick[|\textit{var}|]{|\textit{reg}|}|
\end{center}
%
This macro tests whether the variant \textit{var},
the language variant \textit{ln}
specified through |\metasetlang{|\textit{ln}|}|,
the generic (empty) variant
or a fallback language variant have been specified.
If so, their value is returned (in this order of preference).
Importantly, the intended variant \textit{var} is passed along
to the evaluation of \textit{reg} as the argument `|#1|' in
the definition string \textit{def} of |\metaset|.
This allows to define a register in one generic variant
which composes other registers in more specific variants.
To that end reference registers should be accessed by the construct:
%
\begin{center}
|\metaset{|\textit{reg1}|}{|\ldots|\metapick[#1]{|\textit{reg2}|}|\ldots|}|
\end{center}
%
When this register is accessed by
|\metapick[|\textit{var}|]{|\textit{reg1}|}|,
it will read the default variant of \textit{reg1}
which will pass on to \textit{reg2} in \textit{var}
(rather than in the default variant).
A useful application within title declarations
is |\metapick[#1]{linebreak}| which expands to a line break
when the title is displayed and to a space when the title is used elsewhere.

\DescribeMacro{\metaifpick}
\DescribeMacro{\metacompose}
There also exist a corresponding conditional:
%
\begin{center}
|\metaifpick[|\textit{var}|]{|\textit{reg}|}|%
  |{|\textit{true}|}{|\textit{false}|}|
\end{center}
%
This command tests whether any of the above variants \textit{var}
have been filled.
Another convenient macro to more efficiently compose strings is:
%
\begin{center}
|\metacompose[|\textit{var}|]{|\textit{reg}|}|%
  |{|\textit{prefix}|}{|\textit{postfix}|}{|\textit{empty}|}|
\end{center}
%
It returns the intended register value with prefix string \textit{prefix}
and suffix string \textit{suffix} if any of the above variants
have been filled; otherwise it returns \textit{empty}.
For example, the prefix and/or suffix could be separators for
displaying the content of an optional register.

In dealing with variants,
the following commands specify the variant \textit{var}
as an optional argument |[|\textit{var}|]|:
%
\begin{center}
\begin{tabular}{l}
|\metaset[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|\\
|\metaunset[|\textit{var}|]{|\textit{reg}|}|\\
|\metaappend[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|\\
|\metaprepend[|\textit{var}|]{|\textit{reg}|}{|\textit{def}|}|\\
|\metaaddsep[|\textit{var}|]{|\textit{reg}|}{|\textit{sep}|}{|\textit{def}|}|
\end{tabular}
\end{center}
%
For the following macros, specifying the variant \textit{var}
as |[|\textit{var}|]| is \emph{mandatory}:
%
\begin{center}
|\metaget[|\textit{var}|]{|\textit{reg}|}|\\
|\metapick[|\textit{var}|]{|\textit{reg}|}|\\
|\metaifpick[|\textit{var}|]{|\textit{reg}|}|%
  |{|\textit{true}|}{|\textit{false}|}|\\
|\metacompose[|\textit{var}|]{|\textit{reg}|}|%
  |{|\textit{prefix}|}{|\textit{postfix}|}|
\end{center}
%
Here, the default variant is accessed by an empty argument \textit{var}.

\DescribeMacro{titletext}
\DescribeMacro{\metatitleline}
\DescribeMacro{\metatitlelinetwo}
To illustrate a construction using variants,
let us consider the above register |titletext|
(with activated package option |titlematter|).
It is defined in the generic variant as:
%
\begin{center}
\begin{tabular}{l}
|\metaset{titletext}{%|\\
|  \metacompose[#1]{draft}{}{\metaget[sep]{draft}}{}%|\\
|  \metapick[#1]{title}%|\\
|  \metacompose[#1]{subtitle}{\metaget[sep]{subtitle}}{}{}}|
\end{tabular}
\end{center}
%
This expands to the prefix `\textit{draft}: ' (if available),
the main title `\textit{title}'
and the suffix ` -- \textit{subtitle}' (if available).
The |print| variant to output a full title for the document is defined by:
%
\begin{center}
\begin{tabular}{l}
|\metaset[print]{titletext}{%|\\
|  \metatitleline[print]{title}%|\\
|  \metatitlelinetwo[print]{subtitle}[print]{draft}|
\end{tabular}
\end{center}
%
Here, the macros |\metatitleline|[|two|] produce a title line
consisting of one or two items.
The single-item version is defined as:
%
\begin{center}
\begin{tabular}{l}
|\def\metatitleline[#1]#2{%|\\
|  \metacompose[#1]{#2}|\\
|   {\metaget[skip]{#2}\begingroup\metaget[style]{#2}}|\\
|   {\par\endgroup}{}}|
\end{tabular}
\end{center}
%
If register |#2| is filled,
this expands to the vertical skip defined by the variant |skip|
and an encapsulated paragraph of the register value
in the layout defined by the variant |style|.

\DescribeMacro{authortext}
\DescribeMacro{datetext}
\DescribeMacro{titlematter}
The composition registers |authortext| and |datetext| work in
a similar fashion as |titletext| and compose
the registers |author| and |location| + |date|, respectively.
The composition register |titlematter| (in variant |print|)
prints out the title, author and date information
and serves a similar purpose as the \LaTeX{} command |\maketitle|:
%
\begin{center}
\begin{tabular}{l}
|\metaset{titlematter}{%|\\
|  \metapick[#1]{titletext}%|\\
|  \metapick[#1]{authortext}%|\\
|  \metapick[#1]{datatext}}|
\end{tabular}
\end{center}
%

%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Write Document Metadata}
\label{sec:meta}

The contents of certain registers can be written out to
PDF files as metadata using the package \textsf{hyperref}
and the extension \textsf{hyperxmp}.

\DescribeMacro{\metawritepdfinfo}
The basic metadata registers are written out by |\metawritepdfinfo|
using \textsf{hyperref}.
The mapping between \textsf{metastr} registers
and \textsf{hyperref} |\hypersetup| options is given by:
%
\begin{center}
\begin{tabular}{l@{\quad$\to$\quad}l}
|titletext| & |pdftitle|
\\
|authortext| & |pdfauthor|
\\
|subject| & |pdfsubject|
\\
|keywords| & |pdfkeywords|
\end{tabular}
\end{center}
%
Here, |titletext| is used instead of |title| to compose information
from the registers |draft|, |title| and |subtitle| (as far as filled).
Similarly, |authortext| composes information on the author,
typically just |author|.
Note that |\metawritepdfinfo| will be effective
only when invoked before the contents of the first page are written out.

\DescribeMacro{\metawritepdfaux}
Auxiliary metadata is written out using \textsf{hyperxmp}
by the command |\metawritepdfaux| with the mapping:
%
\begin{center}
\begin{tabular}{l@{\quad$\to$\quad}l}
|url| & |pdfurl|
\\
|source| & |pdfsource|
\end{tabular}
\end{center}

\DescribeMacro{\metawritepdfpreamble}
Some metadata must be written out sufficiently early,
i.e.\ in the document preamble, in order to go into effect.
These include the language settings,
and they are written out by |\metawritepdfpreamble|
with the mapping:
%
\begin{center}
\begin{tabular}{l@{\quad$\to$\quad}l}
|language| & |pdflang|
\\
|language| variant |[meta]| & |pdfmetalang|
\\
 & |keeppdfinfo|
\end{tabular}
\end{center}
%
Note that |pdfmetalang| is a setting of \textsf{hyperxmp}
and will be ignored if the package is not loaded.
Furthermore, the \textsf{hyperxmp} option |keeppdfinfo|
will be set unless the package option |xmppdfinfo=false| is set.

\DescribeMacro{\metawritepdfcontact}
A contact can be specified within PDF files
in a standardised format using \textsf{hyperxmp}.
The command |\metawritepdfcontact| passes on the following
registers with the mapping:
%
\begin{center}
\begin{tabular}{l@{\quad$\to$\quad}l}
|contactaddress| & |pdfcontactaddress|
\\
|contactpostcode| & |pdfcontactpostcode|
\\
|contactcity| & |pdfcontactcity|
\\
|contactregion| & |pdfcontactregion|
\\
|contactcountry| & |pdfcontactcountry|
\\
|contactemail| & |pdfcontactemail|
\\
|contacturl| & |pdfcontacturl|
\end{tabular}
\end{center}

\DescribeMacro{\metawritepdfrights}
A document copyright statement, see \secref{sec:rights},
is recorded within the PDF file by |\metawritepdfrights|
using \textsf{hyperxmp} with the mapping:
%
\begin{center}
\begin{tabular}{l@{\quad$\to$\quad}l}
|rightstext| & |pdfcopyright|
\\
|licenseurl| & |pdflicenseurl|
\end{tabular}
\end{center}
%

\DescribeMacro{\metawritepdf}
\DescribeMacro{writepdf}
Finally, it makes sense to write out PDF metadata automatically.
This is controlled by filling or clearing certain variants \textit{var}
of the register |writepdf|:
%
\begin{center}
\begin{tabular}{rl}
&|\metaset[|\textit{var}|]{writepdf}{}|\\
or&|\metaunset[|\textit{var}|]{writepdf}|
\end{tabular}
\end{center}
%
If the variant |auto| is filled (default),
PDF metadata is written automatically
at the beginning of the |document| block
by calling |\metawritepdf|.
The command |\metawritepdf| calls
the commands |\metawritepdf|\ldots{}
depending on whether the variants |info|, |aux|, |preamble|,
|contact|, |rights| of the register |writepdf| are filled;
the variants |info|, |aux|, |preamble| are enabled by default,
the variants |contact|, |rights| need to be enabled explicitly.

Note that the basic metadata such as |author| and |title|
do not have to be defined already in the preamble,
but (depending on the combination of drivers and packages)
they can be set before the contents of the first page
are shipped out to the PDF file.
If the basic registers are to be declared on the first page,
one should disable their automatic writing by
|\metaunset[info]{writepdf}|.
When the corresponding registers have been filled,
(but no later than the end of the first page),
they need to be written manually
by invoking |\metawritepdfinfo|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Copyright and Licenses}
\label{sec:rights}

Specifying a copyright statement and a license is very useful because it
makes the allowed (re)use of the provided material evident to the reader.
However, it also takes some efforts to set things up properly.
The package \textsf{metastr} provides some default texts to
state the license for a couple of well-established licenses.
For instance, the set of Creative Commons licenses has become a standard
to mark the intended (re)use of a document involving creative content.
For documents related to software, there is a number of
standard software licenses to choose from.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Registers.}

The package declares the following registers to state the copyright:
%
\begin{center}
\begin{tabular}{ll}
|copyrightmark| & `\copyright' (|print| variant) or ``Copyright''
\\
|copyrightdate| & copyright date
\\
|copyrightowner| & copyright owner
\\
|copyrightstatement| & combines:
|...mark| + |...date| + |...owner|
\\
|copyrightmessage| & a message explaining the copyright situation
\end{tabular}
\end{center}
%
The package declares the following registers to state the license:
%
\begin{center}
\begin{tabular}{ll}
|licensemessage| & licensing message
\\
|licenseprovider| & license provider
\\
|licenseversion| & license version
\\
|licenselogo| & license logo inclusion
\\
|licenselogomessage| & display the license logo
\\
|licenseurl| & URL with license text and details
\\
|licenseurlmessage| & display the license URL
\end{tabular}
\end{center}
%
Furthermore, there are some related auxiliary registers:
%
\begin{center}
\begin{tabular}{ll}
|partof| & specifies the work this document is a part of
\\
|partofmessage| & a message declaring being part of
\\
|attributionmessage| & a message declaring attributions
\\
|rightstext| & a composition template for all of the above
\end{tabular}
\end{center}
%
The above information is compiled automatically in the register |rightstext|.
It can be written as PDF metadata
as well as printed with formatting:
%
\begin{center}
|\metapick[print]{rightstext}|
\end{center}
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Presets.}

The package provides a couple of presets
for commonly used copyright statements and licenses.
These are selected by:
%
\begin{center}
\begin{tabular}{l}
|\metacopyright{|\textit{preset}|}|\\
|\metalicense{|\textit{preset}|}|
\end{tabular}
\end{center}
%
The following \textit{preset} values
provide the associated copyright statements:
%
\begin{center}
\begin{tabular}{ll}
|plain| & This work is protected by copyright.
\\
|parts| & This work as well as its parts is protected by copyright.
\\
|doc| & This document is protected by copyright.
\\
|doc-parts| & This document as well as its parts is protected by copyright.
\\
|reserved| & All rights reserved.
\\
|publicdomain| & This work is dedicated to the public domain.
\end{tabular}
\end{center}
%
The following \textit{preset} values
provide the associated license statements:
%
\begin{center}
\begin{tabular}{ll}
|consent| &
\parbox[t]{0.75\textwidth}{\raggedright
  Reproduction of any part of this work in any form
  without prior written consent
  \textit{of the author}
  is not permissible.
}
\\
\vphantom{$\hat A$}%
|consent-noncom| &
\parbox[t]{0.75\textwidth}{\raggedright
  Reproduction of any part of this work in any form
  without prior written consent
  \textit{of the author}
  is permissible only for private, scientific and non-commercial use.
  \vphantom{g}}
\\
\vphantom{$\hat A$}%
|lppl| &
\parbox[t]{0.75\textwidth}{\raggedright
  This work may be distributed and/or modified under the
  conditions of the LaTeX Project Public License, either version \textit{1.3}
  of this license or (at your option) any later version.\\
  \url{http://www.latex-project.org/lppl.txt}
}
\end{tabular}
\end{center}
%
The license URL will be selected where available.
The italicised parts of the license statement can be customised
by the registers |licenseversion| and |licenseprovider|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Creative Commons Licenses.}

A Creative Commons license can be selected by the command:
%
\begin{center}
|\metalicensecc{|\textit{license}|}|
\end{center}
%
The parameter \textit{license} specifies the type of CC license:
%
\begin{center}
\begin{tabular}{ll}
|by| & Attribution \\
|by-sa| & Attribution-ShareAlike \\
|by-nd| & Attribution-NoDerivatives \\
|by-nc| & Attribution-NonCommercial \\
|by-nc-sa| & Attribution-NonCommercial-ShareAlike \\
|by-nc-nd| & Attribution-NonCommercial-NoDerivatives \\
|zero| & CC0 public domain declaration \\
|pd| & generic public domain declaration
\end{tabular}
\end{center}
%
The appropriate license URL and CC logo is selected
by the command as well, e.g.
%
\begin{center}
\includegraphics{doclicense-CC-by-sa-88x31}\\
\url{https://creativecommons.org/licenses/by-sa/4.0/}
\end{center}
%
Note that |pd| is not a CC license, but it declares
that the document is in the public domain by
|\metacopyright{publicdomain}|
and it selects the corresponding CC logo for public domain content.

A version of the CC license can be specified by
the register |licenseversion|.
The default version is |4.0| (international), further available versions are
|3.0| (unported) as well as |2.5|, |2.0|, |1.0| (generic).
For the CC0 license |zero|, the only available version is |1.0| (universal)
which is the default.

Displaying the logo requires (manual) loading
of the package \textsf{graphicx};
furthermore the package \textsf{doclicense} containing the logo files
must be present.
The display of the logo can be disabled by the package option |cclogo=false|.
The logo display is coded by the following definitions
which can be customised:
%
\begin{center}
\begin{tabular}{l}
|\metaset[print]{licenselogomessage}{%|\\
|  \centerline{\metapick[#1]{licenselogo}}}|\\
|\metaset[cmd]{licenselogo}{\includegraphics{#1}}|
\end{tabular}
\end{center}

Various registers and variants of the selected CC license exist.
The registers specific to CC licenses are:
%
\begin{center}
\begin{tabular}{ll}
|licencecc| & CC license identifier
\\
|licenceccver| & CC license version
\\
|licenceccfull| & full license descriptor
\end{tabular}
\end{center}
%
The variants specific to CC licenses are:
%
\begin{center}
\begin{tabular}{ll}
\textit{ln} & representation in language \textit{ln}
\\
|icon| & CC icon (package \textsf{ccicons} required),
e.g. \ccLogo\ccAttribution\ccShareAlike
\\
|url| & license URL
\\
|ident| & CC identifier, e.g.\ `BY-SA'
\\
|short| & short form, e.g.\ `CC BY-SA'
\\
|logo| & logo filename (package \textsf{doclicense})
\end{tabular}
\end{center}
%
For example, a full license descriptor is displayed by
|\metapick[]{licenseccfull}|:
Creative Commons License ``Attribution-ShareAlike 4.0 International''.
The license icon can be displayed by
|\metaget[icon]{licensecc}|: \ccLogo\ccAttribution\ccShareAlike{}
(this requires the package \textsf{ccicons} to be loaded).
Note that displaying the full license message |licensemessage|
in variant |print| in some languages
may produce quotation marks not declared in default fonts
causing an error; this can be avoided to some extent by
loading an appropriate packages for internationalisation
such as \textsf{babel}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Languages}
\label{sec:language}

A principal application of the register variants is to
implement internationalisation and localisation.
Evidently, this is a tricky subject
due to various particularities of languages,
but the register variants can be used
to specify and select different language representations
for some commonly used text elements.
For example, the copyright and license statements in \secref{sec:rights}
are internationalised (to some extent).
This makes them conveniently usable in the appropriate language.
Note that the language presets to be loaded
need to be specified explicitly by the package option |loadlang|,
see \secref{sec:options}.

The idea is to understand the variant \textit{var}
of a register \textit{reg} to be its representation in the language
\textit{var}=\textit{ln}[|-|\textit{CN}].
The default (empty) variant as well as specific purpose variants
(such as |print|) should be provided in the
document language or a fallback language (such as English).
The macro |\metapick[|\textit{var}|]{|\textit{reg}|}|
then selects the appropriate language representation
or falls back to the default language.
Here \textit{var} can specify a particular language or a particular purpose.
Then, |\metapick| will pick (in this order of preference):
%
\begin{itemize}
\item
the language or purpose \textit{var},
\item
the document language specified by |\metasetlang| (if available),
\item
the document language specified by |\metasetlang|
with country code stripped (if available),
\item
the default variant,
\item
the fallback language (first of package option |loadlang|).
\end{itemize}
%
Note that nesting of |\metapick|
via |\metapick[#1]{|\textit{reg}|}|
passes along the original variant
\textit{var} in the parameter |#1|.
This mechanism allows to specify some non-specific elements
in a universal language while the appropriate language is
selected where available.

\macro{\metaterm}
\macro{\metatranslate}
\macro{\metasettest}
The package reserves registers of the form |term-|\textit{term}
for storing terms in various (language) representations.
A couple of such term registers describing common entities in typesetting
are defined by the package:
%
\begin{center}
\begin{tabular}[t]{ll}
|title|&Title\\
|abstract|&Abstract\\
|copyright|&Copyright\\
|preface|&Preface\\
|part|&Part\\
|chapter|&Chapter\\
|section|&Section\\
|subsection|&Subsection\\
|paragraph|&Paragraph
\end{tabular}
\qquad\qquad
\begin{tabular}[t]{ll}
|appendix|&Appendix\\
|page|&Page\\
|figure|&Figure\\
|table|&Table\\
|contents|&Contents\\
|listfigure|&List of Figures\\
|listtable|&List of Tables\\
|references|&References\\
|index|&Index\\
|draft|&DRAFT
\end{tabular}
\end{center}
%
These are provided in different languages for convenient
internationalisation
(this can be viewed as a low-key implementation of some of the features
of the \href{https://ctan.org/pkg/babel}{\textsf{babel}} package).
Additional term registers can be defined by the user.
Term registers are accessed by the macros:
%
\begin{center}
\begin{tabular}{l}
|\metaterm{|\textit{term}|}|\\
|\metatranslate[|\textit{ln}|]{|\textit{term}|}|\\
|\metasetterm[|\textit{ln}|]{|\textit{reg}|}{|\textit{def}|}|
\end{tabular}
\end{center}
%
The macro |\metaterm| obtains the term \textit{term}
in the default language
(it invokes |\metapick[]| with empty variant),
while |\metatranslate| uses any other language \textit{ln}.
The macro |\metasetterm| declares and fills a term register \textit{term}
(in a particular language \textit{ln}).
Note that therefore it is not necessary to declare term registers
explicitly by |\metadef|.

The PDF metadata are written out in the metadata language variant
specified by |\metasetlang*|;
otherwise in the default document language
specified by |\metasetlang| is used.
Some registers can even be written out
in several alternative language versions
using the package \textsf{hyperxmp},
namely |title|, |subject| and |rightstext|.
The set of alternative languages is specified by
(before invoking the respective command |\metawritepdf...|):
%
\begin{center}
\begin{tabular}{l}
|\metaset[altlang]{title}{|\textit{languages}|}|\\
|\metaset[altlang]{subject}{|\textit{languages}|}|\\
|\metaset[altlang]{rightstext}{|\textit{languages}|}|
\end{tabular}
\end{center}
%
Here, \textit{languages} is a comma-separated list of language identifiers
and for each identifier \textit{ln}
the information is written out in the respective language variant.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Package Options}
\label{sec:options}

General options for the package can be selected by the commands:
%
\begin{center}
\begin{tabular}{rl}
&|\usepackage[|\textit{opts}|]{metastr}|
\\
or&|\PassOptionsToPackage{|\textit{opts}|}{metastr}|
\end{tabular}
\end{center}
%
|\PassOptionsToPackage| must be used before |\usepackage|.
\textit{opts} is a comma-separated list of options.

The following options are available:
%
\begin{itemize}
\item |hyperref|[|=true|\textbar|false|]
(no value implies |true|, initially set to |true|) --
use the package \textsf{hyperref} to write metadata to PDF.
\item |hyperxmp|[|=true|\textbar|false|]
(no value implies |true|, initially set to |true|) --
use the auxiliary package \textsf{hyperxmp}
to write additional metadata to PDF.
\item |checkdef|[|=true|\textbar|false|]
(no value implies |true|, initially set to |true|) --
check whether registers have been previously declared
when filling them.
\item |cclogo|[|=true|\textbar|false|]
(no value implies |true|, initially set to |true|) --
display CC logo from \textsf{doclicense} package.
\item |cclogocurr=dollar|\textbar|euro|\textbar|yen|
(initially set to |dollar|) --
select currency symbol for Creative Commons NonCommercial logos.
\item |cclogoshape=box|\textbar|slim|
(initially set to |box|) --
select shape of Creative Commons NonCommercial logos.
\item |xmppdfinfo|[|=true|\textbar|false|]
(no value implies |true|, initially set to |true|) --
write the basic PDF info block
when using the auxiliary package \textsf{hyperxmp};
if this option is set,
\textsf{hyperxmp} is loaded with the option |keeppdfinfo|.
\item |draft|[|=true|\textbar|false|]
(no value implies |true|, initially set to |false|) --
fill |draft| register with ``DRAFT''.
\item |titlematter|[|=true|\textbar|false|]
(no value implies |true|, initially set to |false|) --
when set to |true|, composition register |titletext|
prints only the title; when set to |false|,
|titletext| also prints authorship, location and date information
(legacy behaviour).
\item |course|[|=true|\textbar|false|]
(no value implies |true|, initially set to |false|) --
Setup extended registers for course materials, see \secref{sec:extras}.
\item |loadlang=|\textit{ln-1}\texttt{\textbar}\textit{ln-2}%
  \texttt{\textbar}|...|\texttt{\textbar}\textit{ln-n}
(bar-separated list w/o spaces, initially set to |en|) --
Load presets for languages \textit{ln-1}, \textit{ln-2}, \ldots, \textit{ln-n},
see \secref{sec:language}.
The first language \textit{ln-1} serves as the fallback variant.
Available internationalisations currently consist of:
\begin{center}
\begin{tabular}{ll}
|en|& English\\
|de|& German\\
|fr|& French\\
|es|& Spanish
\end{tabular}
\end{center}
\end{itemize}
%

Selected package options can be adjusted after the package
has been loaded by the command:
%
\begin{center}
|\metasetup{|\textit{opts}|}|
\end{center}
%
Presently, only |draft| can be adjusted.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Extras}
\label{sec:extras}

The package can provide some special purpose registers on request.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Course Materials.}

A couple of registers for course materials are provided
upon setting the package option |course|:
%
\begin{center}
\begin{tabular}{ll}
|course| & title of course
\\
|material| & description of document material
\\
|period| & period where course takes place
\\
|institution| & institution where course is given
\\
|instructor| & instructor of course
\end{tabular}
\end{center}
%

The variant |course| of the register |titlematter| (or |titletext|)
displays a compilation of these registers for display on a title page:
%
\begin{center}
\textit{course}\\
\textit{material} |\par| \textit{draft}\\
\textit{institution}, \textit{period}\\
\textit{instructor}
\end{center}
%
Furthermore, the registers
|title|, |subtitle|, |author|, |location| and |date| are
diverted to |course|, |material|, |instructor|,
|institution| and |period| respectively.
Consequently, their values are automatically written as PDF metadata,
but it is certainly possible to override them with custom values.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Information}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Copyright}

Copyright \copyright{} 2020 Niklas Beisert

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
  \url{http://www.latex-project.org/lppl.txt}
and version 1.3 or later is part of all distributions of \LaTeX{}
version 2005/12/01 or later.

This work has the LPPL maintenance status `maintained'.

The Current Maintainer of this work is Niklas Beisert.

This work consists of the files |README.txt|, |metastr.ins| and |metastr.dtx|
as well as the derived files |metastr.sty|, |metasamp.tex| and |metastr.pdf|.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Files and Installation}

The package consists of the files:
%
\begin{center}
\begin{tabular}{ll}
    |README.txt|   & readme file \\
    |metastr.ins|  & installation file \\
    |metastr.dtx|  & source file \\
    |metastr.sty|  & package file \\
    |metasamp.tex| & sample file \\
    |metastr.pdf|  & manual
\end{tabular}
\end{center}
%
The distribution consists of the files
|README.txt|, |metastr.ins| and |metastr.dtx|.
%
\begin{itemize}
\item
Run (pdf)\LaTeX{} on |metastr.dtx|
to compile the manual |metastr.pdf| (this file).
\item
Run \LaTeX{} on |metastr.ins| to create the package |metastr.sty|
and the samples consisting of |metasamp.tex|.
Copy the file |metastr.sty| to an appropriate directory of your \LaTeX{}
distribution, e.g.\ \textit{texmf-root}|/tex/latex/metastr|.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Related Packages}

The package makes use of other packages available at CTAN:
\begin{itemize}
\item
This package uses the package
\href{http://ctan.org/pkg/hyperref}{\textsf{hyperref}}
to write basic metadata to a PDF file.
Compatibility with the \textsf{hyperref} package
has been tested with v7.00c (2019/11/10).
\item
This package uses the package \textsf{keyval}
from the \textsf{graphics} bundle
to process the options for the package, environments and macros.
Compatibility with the \textsf{keyval} package
has been tested with v1.15 (2014/10/28).
\item
This package can use the package
\href{http://ctan.org/pkg/hyperxmp}{\textsf{hyperxmp}}
to write extended metadata to a PDF file.
Compatibility with the \textsf{hyperxmp} package
has been tested with v5.4 (2020/06/19).
\item
This package can use the Creative Commons license icon files
included in the package
\href{http://ctan.org/pkg/doclicense}{\textsf{doclicense}}.
Compatibility with the \textsf{doclicense} package
has been tested with v2.0.1 (2020/06/26).
\item
This package can use the Creative Commons license icon fonts
included in the package
\href{http://ctan.org/pkg/ccicons}{\textsf{ccicons}}.
Compatibility with the \textsf{ccicons} package
has been tested with v1.6 (2017/10/30).
\item
Icon files are displayed by means of the
\href{http://ctan.org/pkg/graphicx}{\textsf{graphicx}} package.
The package needs to be loaded explicitly.
Compatibility with the \textsf{graphicx} package
has been tested with v1.1a (2017/06/01).
\end{itemize}

There are several other \LaTeX{} packages
which store and write basic metadata
for some specific purposes:
%
\begin{itemize}
\item
The package \href{http://ctan.org/pkg/hyperref}{\textsf{hyperref}}
writes the arguments of |\author| and |\title|
unless the package option |pdfusetitle=false| is declared (at load time).
\item
The package \href{http://ctan.org/pkg/hyperxmp}{\textsf{hyperxmp}}
writes the arguments of |\author| and |\title|.
\item
The package \href{http://ctan.org/pkg/exframe}{\textsf{exframe}}
writes the |\exercisedata| registers
|author|, |title|, |subject| and |keyword|
unless the package option |pdfdata=off| is specified.
\item
The package \href{http://ctan.org/pkg/beamer}{\textsf{beamer}}
writes the arguments of |\author|, |\title|, |\subject| and |\keywords|.
\item
The package \href{http://ctan.org/pkg/gitver}{\textsf{gitver}}
writes |pdfsubject| unless the package option |nopdfinfo| is specified.
\item
Various packages to prepare articles for publication in journals.
\end{itemize}
%
Their mechanisms may be in competition
with the ones of the present package \textsf{metastr}.
In order to make the packages work together on the same set of data,
the most promising option which should work in many cases is the following:
Fill the registers of \textsf{metastr}
with the desired values.
Then pass them on to the structures
of the other package(s) using |\metaget| or |\metapick|.
Since the latter commands are robust,
the other structures ought to be able to handle them without further ado.
To avoid potential conflicts, multiple writing of (basic) metadata
should be disabled. For the \textsf{metastr} package this is achived by:
%
\begin{center}
\begin{tabular}{rl}
&|\metaunset[info]{writepdf}|\\
or&|\metaunset[auto]{writepdf}|
\end{tabular}
\end{center}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Feature Suggestions}
\label{sec:suggestions}

The following is a list of features which may be useful for future
versions of this package:
%
\begin{itemize}
\item
Presets for GNU and other software licenses.
\item
Registers for publication data.
% editor, preprint, doi, publisher, publication, (volume, page), version ...
\item
Further translations of copyright and license statements.
\item
Export translations to files
\item
Make use of the \textsf{babel} package for translations of basic terms.
% load babel when not only en?
%\item
%title translations via titletext?
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Revision History}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v1.1:} 2020/06/28

\begin{itemize}
\item
|\metasetup| to adjust some package options (|draft|)
\item
|titlematter|, |authortext|, |datatext| composition registers added;
legacy behaviour of |titletext| preserved,
can be changed by package option |titlematter|
\item
|linebreak| register added
\item
fix saving of PDF info (|keeppdfinfo|) with updated \textsf{hyperxmp} package
\item
fix package options |hyperref|, |hyperxmp|, |checkdef|, |xmppdfinfo|
\item
fix compatibility with updated \textsf{doclicense} package (v2)
\item
\ldots
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v1.0:} 2020/02/06

\begin{itemize}
\item
first version, published on CTAN
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix

\settowidth\MacroIndent{\rmfamily\scriptsize 0000\ }

 \DocInput{metastr.dtx}

\end{document}
%</driver>
% \fi
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \section{Sample}
% \label{sec:sample}
%\iffalse
%<*sample>
%\fi
%
% This section provides an example of how to apply
% some of the \textsf{metastr} mechanisms and licenses.
%
% Some lines in the example are commented by |%%| for easy experimenting.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Preamble.}
%
% Standard document class:
%    \begin{macrocode}
\documentclass[12pt]{article}
%    \end{macrocode}

% Use package \textsf{geometry} to set the page layout;
% adjust the paragraph shape:
%    \begin{macrocode}
\usepackage{geometry}
\geometry{layout=a4paper}
\geometry{paper=a4paper}
\geometry{margin=2.5cm}
\parindent0pt
\parskip1ex
%    \end{macrocode}

% Declare some options for the package \textsf{hyperref};
% it does not hurt to load it explicitly
% although \textsf{metastr} will invoke it by default if not loaded:
%    \begin{macrocode}
\PassOptionsToPackage{bookmarks=true}{hyperref}
\usepackage{hyperref}
%    \end{macrocode}

% Set some options for the \textsf{metastr} package:
%    \begin{macrocode}
\PassOptionsToPackage{loadlang=en|de|fr|es}{metastr}
%%\PassOptionsToPackage{loadlang=en|fr|es}{metastr}
%%\PassOptionsToPackage{loadlang=de|en}{metastr}
\PassOptionsToPackage{cclogocurr=euro}{metastr}
%%\PassOptionsToPackage{cclogoshape=slim}{metastr}
%    \end{macrocode}

% Include the \textsf{metastr} package along with
% \textsf{graphicx}, \textsf{babel}
% and \textsf{ccicons} (where available):
%    \begin{macrocode}
\usepackage[titlematter]{metastr}
\usepackage{graphicx}
\usepackage[english]{babel}
\IfFileExists{ccicons.sty}{\usepackage{ccicons}}{}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Some Adjustments.}
%
% Declare some term to be translated;
% doesn't hurt to declare a couple of variants:
%    \begin{macrocode}
\metasetterm[en]{Zurich}{Zurich}
\metasetterm[de]{Zurich}{Z\"rich}
\metasetterm[fr]{Zurich}{Zurich}
\metasetterm[es]{Zurich}{Z\'urich}
\metasetterm[it]{Zurich}{Zurigo}
\metasetterm[pt]{Zurich}{Zurique}
%    \end{macrocode}

% Define |subject| to combine |location| and |date|
% (as far as filled):
%    \begin{macrocode}
\metaset{subject}{\metacompose[#1]{location}{location: }
   {\metacompose[#1]{date}{, date: }{}{}}
   {\metacompose[#1]{date}{date: }{}{}}}
%    \end{macrocode}

% Adjust title display:
%    \begin{macrocode}
\metaset[skip]{subtitle}{\vspace{1ex}}
\metaset[skip]{author}{\vspace{2ex}}
\metaset[skip]{location}{\vspace{1ex}}
\metaset[skip]{date}{\vspace{1ex}}
\metaset[style]{title}{\LARGE\bfseries}
\metaset[style]{author}{\large\scshape}
\metaset[sep]{draft}{ -- }
%%\metaunset[sep]{date}
%    \end{macrocode}

% Write title also in english and german;
% write rights as PDF metadata also in English and Spanish:
%    \begin{macrocode}
\metaset[altlang]{title}{en,de}
\metaset[altlang]{rightstext}{en,es}
\metaset[rights]{writepdf}{}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Set Document Data.}
%
% Set the document language:
%    \begin{macrocode}
\metasetlang{en}
%%\metasetlang{de}
%%\metasetlang{de-CH}
%%\metasetlang{fr}
%    \end{macrocode}

% Define some document data:
%    \begin{macrocode}
\metaset[en]{title}{A metastr Sample}
\metaset[de]{title}{Ein metastr Beispiel}
\metaset[print]{title}{A \textsf{metastr} Sample}
\metaset{subtitle}{Illustration of some features}
\metaset{author}{Niklas Beisert}
\metaset{keywords}{composition of title, application of licenses, translations}
\metaset{location}{\metatranslate[#1]{Zurich}}
\metaset{date}{2020/02/06}
\metaset{partof}{The metastr Package}
\metaset[print]{partof}{The \textsf{metastr} Package}
\metasetup{draft=true}
%    \end{macrocode}

% Copyright settings:
%    \begin{macrocode}
\metaset{copyrightowner}{\metapick[#1]{author}}
\metaset{copyrightdate}{2020}
\metacopyright{doc}
%%\metacopyright{reserved}
%    \end{macrocode}

% License settings:
%    \begin{macrocode}
%%\metaset{licenseversion}{1.2}
%%\metalicense{lppl}
%    \end{macrocode}

% Creative Commons License use:
%    \begin{macrocode}
%%\metaset{licenseversion}{3.0}
\metalicensecc{by-sa}
%%\metalicensecc{by-nc-sa}
%%\metalicensecc{zero}
%%\metalicensecc{pd}
%    \end{macrocode}

% Scale the CC logo a bit:
%    \begin{macrocode}
\metaset[cmd]{licenselogo}{\includegraphics[scale=0.75]{#1}}
%    \end{macrocode}

% Start document body:
%    \begin{macrocode}
\begin{document}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Header.}
%
% Display title block:
%    \begin{macrocode}
\pdfbookmark[1]{\metaterm{title}}{title}
\begin{center}
\metapick[print]{titlematter}
\end{center}
%    \end{macrocode}

% Display fineprint in fine print:
%    \begin{macrocode}
\vspace{1ex}\hrule\par\vspace{1ex}
\begingroup\footnotesize
\pdfbookmark[1]{\metaterm{copyright}}{copyright}
\metapick[print]{rightstext}
\endgroup
\vspace{1ex}\hrule\par\vspace{1ex}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Content.}
%
% Some useful content:
%    \begin{macrocode}
\section{Metadata Inspection}

The metadata stored in this example PDF can be inspected with
the tool \texttt{pdfinfo}:

\begin{tabular}{l}
\verb+pdfinfo metasamp.pdf+\\
\verb+pdfinfo -meta metasamp.pdf | less+
\end{tabular}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Translations.}
%
% Demonstration of terms and translations:
%    \begin{macrocode}
\section{Translations}

\begin{tabular}{ll}
document language:&\metaterm{Zurich}\\
Spanish:&\metatranslate[es]{Zurich}
\end{tabular}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Creative Commons.}
%
% Demonstrate some CC terms:
%    \begin{macrocode}
\metaif[]{cc@type}{ % only if a CC license is in use
\section{Creative Commons}
some representations of the selected license:
\begin{itemize}
\item license identifier:
  \metapick[]{licensecc}
\item \texttt{short} identifier:
  \metapick[short]{licensecc}
\item full form:
  \metapick[]{licenseccfull}
\item \texttt{ident} form:
  \metapick[ident]{licensecc}
\item \texttt{short} form:
  \metapick[short]{licenseccfull}
\IfFileExists{ccicons.sty}
  {\item \texttt{icon} forms:
   -- \metapick[icon]{licensecc}
   -- \metapick[icon]{licenseccfull} --}{}
\item \texttt{url} form:
  \metapick[url]{licenseccfull}
\end{itemize}
}{}
%    \end{macrocode}

% End of document body:
%    \begin{macrocode}
\end{document}
%    \end{macrocode}
%\iffalse
%</sample>
%\fi
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \section{Implementation}
% \label{sec:implementation}
%\iffalse
%<*package>
%\fi
%
% This section describes the implementation of the package |metastr.sty|.

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Package Setup}
% \label{sec:imp-setup}
%
% The package declares a couple of setup options.
%
% It loads the package \textsf{keyval}
% for extended options processing.
%    \begin{macrocode}
\RequirePackage{keyval}
%    \end{macrocode}

% \macro{hyperref}
% \macro{hyperxmp}
% \macro{checkdef}
% \macro{cclogo}
% \macro{cclogocurr}
% \macro{cclogoshape}
% \macro{xmppdfinfo}
% Store the selected package options in some corresponding internal macros:
%    \begin{macrocode}
\newif\ifmstr@opt@hyperref\mstr@opt@hyperreftrue
\newif\ifmstr@opt@hyperxmp\mstr@opt@hyperxmptrue
\newif\ifmstr@opt@checkdef\mstr@opt@checkdeftrue
\newif\ifmstr@opt@xmppdfinfo\mstr@opt@xmppdfinfotrue
\newif\ifmstr@opt@course\mstr@opt@coursefalse
\newif\ifmstr@opt@draft\mstr@opt@draftfalse
\newif\ifmstr@opt@titlematter\mstr@opt@titlematterfalse
\newif\ifmstr@opt@cclogo\mstr@opt@cclogotrue
\def\mstr@opt@cclogocurr{dollar}
\def\mstr@opt@cclogoshape{box}
\def\mstr@opt@loadlang{en}
\def\mstr@group{mstr@}
\define@key{\mstr@group}{hyperref}[true]{%
  \csname mstr@opt@hyperref#1\endcsname}
\define@key{\mstr@group}{hyperxmp}[true]{%
  \csname mstr@opt@hyperxmp#1\endcsname}
\define@key{\mstr@group}{checkdef}[true]{%
  \csname mstr@opt@checkdef#1\endcsname}
\define@key{\mstr@group}{xmppdfinfo}[true]{%
  \csname mstr@opt@xmppdfinfo#1\endcsname}
\define@key{\mstr@group}{cclogo}[true]{\csname mstr@opt@cclogo#1\endcsname}
\define@key{\mstr@group}{cclogocurr}{\def\mstr@opt@cclogocurr{#1}}
\define@key{\mstr@group}{cclogoshape}{\def\mstr@opt@cclogoshape{#1}}
\define@key{\mstr@group}{loadlang}{\def\mstr@opt@loadlang{#1}}
\define@key{\mstr@group}{course}[true]{\csname mstr@opt@course#1\endcsname}
\define@key{\mstr@group}{draft}[true]{\csname mstr@opt@draft#1\endcsname}
\define@key{\mstr@group}{titlematter}[true]{%
  \csname mstr@opt@titlematter#1\endcsname}
%    \end{macrocode}

% Pass undeclared options on to \textsf{keyval} processing:
%    \begin{macrocode}
\DeclareOption*{\expandafter\setkeys\expandafter\mstr@group%
  \expandafter{\CurrentOption}}
%    \end{macrocode}

% Process global options while loading package:
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}

% \macro{\metasetup}
% |\metasetup| processes package options
% when the package has already been loaded:
%    \begin{macrocode}
\def\mstr@setup{mstr@setup}
\newcommand{\metasetup}[1]{\setkeys\mstr@setup{#1}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Definitions}
% \label{sec:imp-def}
%
% The following describes the basic definitions
% of the package.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Required Packages.}
%
% The package loads the packages
% \textsf{hyperref} and \textsf{hyperxmp}
% (unless excluded):
%    \begin{macrocode}
\ifmstr@opt@hyperref\RequirePackage{hyperref}\fi
\ifmstr@opt@hyperxmp\RequirePackage{hyperxmp}\fi
\ifmstr@opt@xmppdfinfo\ifdefined\xmptilde\hypersetup{keeppdfinfo}\fi\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{General Definitions.}
%
% \macro{\mstr@exptwo}
% A macro to conveniently expand the third token in line:
%    \begin{macrocode}
\def\mstr@exptwo#1{\expandafter#1\expandafter}
%    \end{macrocode}
% \macro{\mstr@csdo}
% \macro{\mstr@csdotwo}
% Some macros to conveniently expand |\csname| arguments
% before expanding the macro:
%    \begin{macrocode}
\def\mstr@csdo#1#2{\expandafter#1\csname#2\endcsname}
\def\mstr@csdotwo#1#2#3{\mstr@exptwo#1#2\csname#3\endcsname}
%    \end{macrocode}
% \macro{\mstr@iftext}
% Check whether macro |#1| equals text |#2|, then do |#3|:
%    \begin{macrocode}
\long\def\mstr@iftext#1#2#3{\def\mstr@tmp{#2}\ifx#1\mstr@tmp#3\fi}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Internal Definitions.}
%
% \macro{\mstr@lang@main}
% \macro{\mstr@lang@short}
% \macro{\mstr@lang@fallback}
% \macro{\mstr@lang@meta}
% Predefine language identifiers as empty.
% These define the language for the document text
% (with and without country code), document metadata
% and a fallback language:
%    \begin{macrocode}
\let\mstr@lang@main\@empty
\let\mstr@lang@short\@empty
\let\mstr@lang@fallback\@empty
\let\mstr@lang@meta\@empty
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Interface Definitions.}
%
% \macro{\metatilde}
% \macro{\metacomma}
% Define a macro for the tilde character (mostly for use within URLs);
% recycle the definitions from \textsf{hyperxmp} if available:
%    \begin{macrocode}
\ifdefined\xmptilde
\let\metatilde\xmptilde
\let\metacomma\xmpcomma
\else
\def\metatilde{~}
\def\metacomma{,}
\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Declare Registers.}
%
% \macro{\metadef}
% Declare a register:
%    \begin{macrocode}
\newcommand{\metadef}[1]{%
  \mstr@csdo\let{mstr@def@#1}\relax}
%    \end{macrocode}

% \macro{\mstr@verify}
% Verify the declaration of a register;
% throw an error if undeclared;
% disable checking for package option |checkdef=false|:
%    \begin{macrocode}
\newcommand{\mstr@verify}[1]{%
  \ifcsname mstr@def@#1\endcsname\else
    \PackageError{metastr}{register `#1' undefined}{}%
  \fi}
\ifmstr@opt@checkdef\else\def\mstr@verify#1{}\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Set Registers.}
%
% \macro{\mstr@setbare}
% Store the register value in the macro
% |\mstr@data@|\textit{reg}|@|\textit{var};
% define one argument to pass along original variant:
%    \begin{macrocode}
\long\def\mstr@setbare[#1]#2#3{%
  \mstr@csdo\gdef{mstr@data@#2@#1}##1{#3}}
%    \end{macrocode}

% \macro{\mstr@set}
% Set the register value; verify whether the register has been declared:
%    \begin{macrocode}
\long\def\mstr@set[#1]#2#3{\mstr@verify{#2}%
  \mstr@setbare[#1]{#2}{#3}}
%    \end{macrocode}

% \macro{\metaset}
% Interface macro for setting register
% with optional variant argument:
%    \begin{macrocode}
\newcommand{\metaset}{\@ifnextchar[{\mstr@set}{\mstr@set[]}}
%    \end{macrocode}

% \macro{\mstr@unset}
% Clear a register value:
%    \begin{macrocode}
\long\def\mstr@unset[#1]#2{\mstr@verify{#2}%
  \mstr@csdotwo\global\let{mstr@data@#2@#1}\@undefined}
%    \end{macrocode}

% \macro{\metaunset}
% Interface macro for clearing register
% with optional variant argument:
%    \begin{macrocode}
\newcommand{\metaunset}{\@ifnextchar[{\mstr@unset}{\mstr@unset[]}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Register Conditionals.}
%
% \macro{\metaif}
% If-then-else structure checking whether register variant is filled:
%    \begin{macrocode}
\long\def\metaif[#1]#2#3#4{%
  \ifcsname mstr@data@#2@#1\endcsname #3\else #4\fi}
%    \end{macrocode}

% \macro{\metaifpick}
% If-then-else structure checking if the register in either of the variants
% |#1|, |\mstr@lang@main|, |\mstr@lang@short|,
% default and |\mstr@lang@fallback|
% is filled;
% |#1| may in fact be a comma-separated list of variants (without spaces):
%    \begin{macrocode}
\long\def\mstr@ifloop[#1,#2]#3#4#5{%
  \metaif[#1]{#3}{#4}{\if @#2@#5\else\mstr@ifloop[#2]{#3}{#4}{#5}\fi}}
\long\def\metaifpick[#1]#2#3#4{%
  \mstr@ifloop
    [#1,\mstr@lang@main,\mstr@lang@short,,\mstr@lang@fallback,]
    {#2}{#3}{#4}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Manipulate Registers.}
%
% \macro{\mstr@append}
% Append some string to a register value:
%    \begin{macrocode}
\long\def\mstr@append[#1]#2#3{%
  \mstr@csdotwo\let\mstr@tmpa{mstr@data@#2@#1}%
  \def\mstr@tmpb##1{\mstr@set[#1]{#2}{##1#3}}%
  \mstr@exptwo\mstr@tmpb{\mstr@tmpa{##1}}}
%    \end{macrocode}

% \macro{\mstr@prepend}
% Prepend some string to a register value:
%    \begin{macrocode}
\long\def\mstr@prepend[#1]#2#3{%
  \mstr@csdotwo\let\mstr@tmpa{mstr@data@#2@#1}%
  \def\mstr@tmpb##1{\mstr@set[#1]{#2}{#3##1}}%
  \mstr@exptwo\mstr@tmpb{\mstr@tmpa{##1}}}
%    \end{macrocode}

% \macro{\mstr@addsep}
% Append a string to a register value separated by |#1|
% if the string was previously filled:
%    \begin{macrocode}
\long\def\mstr@addsep[#1]#2#3#4{%
  \metaif[#1]{#2}{\mstr@append[#1]{#2}{#3#4}}{\mstr@set[#1]{#2}{#4}}}
%    \end{macrocode}

% \macro{\metaappend}
% \macro{\metaprepend}
% \macro{\metaaddsep}
% Interface macros for appending, prepending
% and adding with separator:
%    \begin{macrocode}
\newcommand{\metaappend}{%
  \@ifnextchar[{\mstr@append}{\mstr@append[]}}
\newcommand{\metaprepend}{%
  \@ifnextchar[{\mstr@prepend}{\mstr@prepend[]}}
\newcommand{\metaaddsep}{%
  \@ifnextchar[{\mstr@addsep}{\mstr@addsep[]}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Read Register Values.}
%
% \macro{\mstr@getbare}
% Read a register value
% while passing along the original variant as an argument:
%    \begin{macrocode}
\def\mstr@getbare[#1]#2#3{\csname mstr@data@#2@#1\endcsname{#3}}
%    \end{macrocode}

% \macro{\metaget}
% Interface function to read register value
% with mandatory variant argument in square brackets;
% return nothing if register clean:
%    \begin{macrocode}
\def\metaget[#1]#2{%
  \metaif[#1]{#2}{\mstr@getbare[#1]{#2}{#1}}{}}%
%    \end{macrocode}

% \macro{\metacompose}
% \macro{\metapick}
% |\metapick| returns a filled register value among the variants
% |#1|, |\mstr@lang@main|, |\mstr@lang@short|, default
% and |\mstr@lang@fallback|
% (in this order of preference), otherwise it returns nothing;
% |#1| may in fact be a comma-separated list of variants (without spaces);
% |\metacompose| sandwiches the value between |#3| and |#4| if found,
% and otherwise returns |#5|:
%    \begin{macrocode}
\long\def\mstr@composeloop[#1,#2]#3#4#5#6#7{%
  \metaif[#1]{#4}{#5\mstr@getbare[#1]{#4}{#3}#6}
    {\if @#2@#7\else\mstr@composeloop[#2]{#3}{#4}{#5}{#6}{#7}\fi}}
\long\def\metacompose[#1]#2#3#4#5{%
  \mstr@composeloop
    [#1,\mstr@lang@main,\mstr@lang@short,,\mstr@lang@fallback,]{#1}
    {#2}{#3}{#4}{#5}}%
\def\metapick[#1]#2{\metacompose[#1]{#2}{}{}{}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Language Selection.}
%
% \macro{language}
% Declare language register:
%    \begin{macrocode}
\metadef{language}
%    \end{macrocode}
% \macro{\metasetlang}
% Set language and extract short forms:
%    \begin{macrocode}
\def\mstr@lang@split#1#2-#3@{%
  \mstr@csdo\gdef{mstr@lang@#1}{#2}}
\newcommand{\mstr@setlang@main}[1]{%
  \metaset{language}{#1}%
  \gdef\mstr@lang@main{#1}%
  \mstr@lang@split{short}#1-@%
  \metaset[short]{language}{\mstr@lang@short}%
  \metaif[meta]{language}{}{\mstr@lang@split{meta}#1-@}}
\newcommand{\mstr@setlang@meta}[1]{%
  \metaset[meta]{language}{#1}%
  \mstr@lang@split{meta}#1-@%
  \metaset[metashort]{language}{\mstr@lang@meta}}
\newcommand{\metasetlang}{%
  \@ifstar\mstr@setlang@meta\mstr@setlang@main}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Terms.}
%
% \macro{\metaterm}
% \macro{\metatranslate}
% \macro{\metasetterm}
% Macros for filling and reading term registers:
%    \begin{macrocode}
\newcommand{\metaterm}{\metatranslate[]}
\def\metatranslate[#1]#2{\metapick[#1]{term-#2}}
\long\def\mstr@setterm[#1]#2#3{%
  \metadef{term-#2}\mstr@setbare[#1]{term-#2}{#3}}
\newcommand{\metasetterm}{\@ifnextchar[{\mstr@setterm}{\mstr@setterm[]}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Automatic Writing to PDF.}
%
% \macro{writepdf}
% Declare register |writepdf| to control automatic
% writing of metadata to PDF files:
%    \begin{macrocode}
\metadef{writepdf}
\metaset[auto]{writepdf}{}
\metaset[preamble]{writepdf}{}
\metaset[info]{writepdf}{}
\metaset[aux]{writepdf}{}
%    \end{macrocode}

% \macro{\mstr@ifwritepdf}
% Auxiliary macro to write some type of metadata if switch activated,
% disable switch afterwards:
%    \begin{macrocode}
\long\def\mstr@ifwritepdf[#1]#2{%
  \metaif[#1]{writepdf}{#2\metaunset[#1]{writepdf}}{}}
%    \end{macrocode}

% \macro{\metawritepdf}
% Write selected types of metadata to PDF file:
%    \begin{macrocode}
\newcommand{\metawritepdf}{%
  \mstr@ifwritepdf[preamble]{\metawritepdfpreamble}%
  \mstr@ifwritepdf[info]{\metawritepdfinfo}%
  \mstr@ifwritepdf[aux]{\metawritepdfaux}%
  \mstr@ifwritepdf[contact]{\metawritepdfcontact}%
  \mstr@ifwritepdf[rights]{\metawritepdfrights}%
}
%    \end{macrocode}

% \macro{\mstr@begindoc}
% Hook for writing data to PDF file;
% this is the last chance to write the preamble set of data to the PDF:
%    \begin{macrocode}
\newcommand{\mstr@begindoc}{%
  \mstr@ifwritepdf[preamble]{\metawritepdfpreamble}%
  \mstr@ifwritepdf[auto]{\metawritepdf}%
}
%    \end{macrocode}

% Hook |\mstr@begindoc| to begining of |document| block
% before all other hooks are called:
%    \begin{macrocode}
\begingroup
\toks@\expandafter{\expandafter\mstr@begindoc\@begindocumenthook}%
\xdef\@begindocumenthook{\the\toks@}%
\endgroup
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Basic Registers}
% \label{sec:imp-basic}
%
% The following defines a set of basic and auxiliary registers.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Declarations.}
%
% \macro{draft}
% Declare register to state draft mode:
%    \begin{macrocode}
\metadef{draft}
%    \end{macrocode}
% Set draft text (if |draft| option set), declare |draft| option:
%    \begin{macrocode}
\newcommand{\mstr@set@draft}{%
  \ifmstr@opt@draft\metaset{draft}{\metatranslate[##1]{draft}}%
  \else\metaunset{draft}\fi}
\define@key{\mstr@setup}{draft}[true]{%
  \csname mstr@opt@draft#1\endcsname\mstr@set@draft}%
\mstr@set@draft
%    \end{macrocode}

% \macro{title}
% \macro{subtitle}
% \macro{author}
% \macro{date}
% \macro{location}
% \macro{subject}
% \macro{keywords}
% Basic registers:
%    \begin{macrocode}
\metadef{title}
\metadef{subtitle}
\metadef{author}
\metadef{date}
\metadef{location}
\metadef{subject}
\metadef{keywords}
%    \end{macrocode}

% \macro{linebreak}
% Declare an auxiliary register to break a line in |print| variant
% and display a space otherwise:
%    \begin{macrocode}
\metadef{linebreak}
\metaset[]{linebreak}{ }
\metaset[print]{linebreak}{\\}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Title and Author Composition.}
%
% \macro{titlematter}
% \macro{titletext}
% \macro{authortext}
% \macro{datatext}
% Declare register to compose title display (analogous to |\maketitle|):
%    \begin{macrocode}
\metadef{titlematter}
\metadef{titletext}
\metadef{authortext}
\metadef{datatext}
%    \end{macrocode}

% \macro{\metatitleline}
% \macro{\metatitlelinetwo}
% Macros to print a formatted title line
% with one or two items;
% variant |skip| produces vertical skip before the item,
% variant |style| sets the text style,
% variant |sep| defines the separator between
% two items or undefined for two independent lines:
%    \begin{macrocode}
\def\metatitleline[#1]#2{%
  \metacompose[#1]{#2}
   {\metaget[skip]{#2}\begingroup\metaget[style]{#2}}
   {\par\endgroup}{}}
\def\metatitlelinetwo[#1]#2[#3]#4{%
  \metaif[sep]{#4}
   {\metacompose[#1]{#2}
     {\metaget[skip]{#2}\begingroup\metaget[style]{#2}}
     {\metacompose[#3]{#4}{\metaget[sep]{#4}}{}{}\par\endgroup}
     {\metatitleline[#3]{#4}}}
   {\metatitleline[#1]{#2}\metatitleline[#3]{#4}}}
%    \end{macrocode}

% Set default layout and spacing:
%    \begin{macrocode}
\metaset[style]{title}{\LARGE}
\metaset[style]{subtitle}{\large}
\metaset[style]{draft}{\large}
\metaset[style]{author}{\large}
\metaset[style]{location}{\large}
\metaset[style]{date}{\large}
\metaset[skip]{subtitle}{\vspace{1.5em}}
\metaset[skip]{draft}{\vspace{1.5em}}
\metaset[skip]{author}{\vspace{3em}}
\metaset[skip]{location}{\vspace{1.5em}}
\metaset[skip]{date}{\vspace{1.5em}}
\metaset[sep]{subtitle}{ -- }
\metaset[sep]{date}{, }
\metaset[sep]{draft}{: }
%    \end{macrocode}
% Preset for |titlematter|, |titletext|, |authortext| and |datatext|
% in generic and |print| variants:
%    \begin{macrocode}
\metaset{titletext}{%
  \metacompose[#1]{draft}{}{\metaget[sep]{draft}}{}%
  \metapick[#1]{title}%
  \metacompose[#1]{subtitle}{\metaget[sep]{subtitle}}{}{}}
\metaset{authortext}{\metapick[#1]{author}}
\metaset{datatext}{%
  \metacompose[#1]{location}{}{\metaget[sep]{date}}{}%
  \metapick[#1]{date}}
\metaset{titlematter}{%
  \metapick[#1]{titletext}%
  \metapick[#1]{authortext}%
  \metapick[#1]{datatext}}
\metaset[print]{titletext}{%
  \metatitleline[print]{title}%
  \metatitlelinetwo[print]{subtitle}[print]{draft}}
\metaset[print]{authortext}{%
  \metatitleline[print]{author}}
\metaset[print]{datatext}{%
  \metatitlelinetwo[print]{location}[print]{date}}
%    \end{macrocode}
% Legacy presets:
%    \begin{macrocode}
\ifmstr@opt@titlematter\else
\metaset{titlematter}{%
  \metapick[#1]{titletext}}
\metaset[print]{titletext}{%
  \metatitleline[print]{title}%
  \metatitlelinetwo[print]{subtitle}[print]{draft}%
  \metapick[print]{authortext}%
  \metapick[print]{datatext}}
\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Further Registers.}
%
% \macro{url}
% \macro{urlmessage}
% Registers for document URL and message to display it:
%    \begin{macrocode}
\metadef{url}
\metadef{urlmessage}
%    \end{macrocode}
% Print URL as hyperlink:
%    \begin{macrocode}
\metaset[print]{url}{\url{\metaget[]{url}}}
%    \end{macrocode}
% URL message default text (translated):
% \translate{urlmessage}
%    \begin{macrocode}
% \metaset{urlmessage}{%
%   The current version of this work can be found at:
%   \metapick[#1]{url}.}
%    \end{macrocode}

% \macro{partof}
% \macro{partofmessage}
% Registers for document URL and message to display it:
%    \begin{macrocode}
\metadef{partof}
\metadef{partofmessage}
%    \end{macrocode}
% part of message default text (translated):
% \translate{partofmessage}
%    \begin{macrocode}
% \metaset{partofmessage}{%
%   This document is part of the work: \metapick[#1]{partof}.}
%    \end{macrocode}

% \macro{source}
% Register for source name:
%    \begin{macrocode}
\metadef{source}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Write to PDF.}
%
% \macro{\metawritepdfpreamble}
% Write some registers to PDF that need to be written
% before the start of the document:
%    \begin{macrocode}
\newcommand{\metawritepdfpreamble}{\ifdefined\hypersetup
  \metaif[]{language}
    {\hypersetup{pdflang={\metaget[]{language}}}}{}%
  \ifdefined\xmptilde
    \metaif[meta]{language}
      {\hypersetup{pdfmetalang={\metaget[meta]{language}}}}{}%
  \fi\fi}
%    \end{macrocode}

% \macro{\metawritepdfinfo}
% Write the basic registers to PDF;
% also write alternative language representations
% of |pdftitle| and |pdfsubject|:
%    \begin{macrocode}
\newcommand{\metawritepdfinfo}{\ifdefined\hypersetup
  \metaifpick[\mstr@lang@meta]{author}
    {\hypersetup{pdfauthor={\metapick[\mstr@lang@meta]{authortext}}}}{}%
  \metaifpick[\mstr@lang@meta]{title}
    {\hypersetup{pdftitle={\metapick[\mstr@lang@meta]{titletext}}}}{}%
  \metaifpick[\mstr@lang@meta]{subject}
    {\hypersetup{pdfsubject={\metapick[\mstr@lang@meta]{subject}}}}{}%
  \metaifpick[\mstr@lang@meta]{keywords}
    {\hypersetup{pdfkeywords={\metapick[\mstr@lang@meta]{keywords}}}}{}%
  \ifdefined\xmptilde
    \metaif[altlang]{title}{%
      \@for\mstr@tmp:=\mstr@data@title@altlang{}\do{%
        \metaifpick[\mstr@tmp]{title}
          {\XMPLangAlt{\mstr@tmp}{pdftitle=
            {\metapick[\mstr@tmp]{titletext}}}}{}}%
      \metaunset[altlang]{title}}{}%
    \metaif[altlang]{subject}{%
      \@for\mstr@tmp:=\mstr@data@subject@altlang{}\do{%
        \metaifpick[\mstr@tmp]{subject}
          {\XMPLangAlt{\mstr@tmp}{pdfsubject=
            {\metapick[\mstr@tmp]{subject}}}}{}}%
      \metaunset[altlang]{subject}}{}%
  \fi\fi}
%    \end{macrocode}

% \macro{\metawritepdfaux}
% Write auxiliary registers to PDF:
%    \begin{macrocode}
\newcommand{\metawritepdfaux}{\ifdefined\hypersetup\ifdefined\xmptilde
  \metaif[]{url}
    {\hypersetup{pdfurl={\metaget[]{url}}}}{}%
  \hypersetup{pdfsource={}}%
  \metaif[]{source}
    {\hypersetup{pdfsource={\metaget[]{source}}}}{}%
\fi\fi}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Copyright and License}
% \label{sec:imp-rights}
%
% The following defines some registers concerning
% copyright and licensing.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Rights Composition.}
%
% \macro{rightstext}
% Declare a register to compose copyright and license information:
%    \begin{macrocode}
\metadef{rightstext}
%    \end{macrocode}
% Define generic version of composition register:
%    \begin{macrocode}
\metaset{rightstext}{%
  \metaifpick[]{partof}{\metacompose[#1]{partofmessage}{}{ }{}}{}%
  \metapick[#1]{copyrightstatement}%
  \metacompose[#1]{copyrightmessage}{ }{}{}%
  \metacompose[#1]{licensemessage}{ }{}{}%
  \metaif[]{licenseurl}{\metacompose[#1]{licenseurlmessage}{ }{}{}}{}%
  \metaif[]{url}{\metacompose[#1]{urlmessage}{ }{}{}}{}%
}
%    \end{macrocode}
% Define print version of composition register;
% variant |sep| contains code to separate parts of the message:
%    \begin{macrocode}
\metaset[skip]{rightstext}{\par\addvspace\medskipamount}
\metaset[print]{rightstext}{%
  \metaifpick[]{partof}{%
    \metacompose[#1]{partofmessage}{}{\metaget[skip]{rightstext}}{}}{}%
  \metacompose[#1]{copyrightstatement}{}{\metaget[skip]{rightstext}}{}%
  \metacompose[#1]{copyrightmessage}{}{ }{}%
  \metacompose[#1]{licensemessage}{}{ }{}%
  \metaif[]{licenselogo}{%
    \metacompose[#1]{licenselogomessage}
    {\metaget[skip]{rightstext}}{\metaget[skip]{rightstext}}{}}{}%
  \metaif[]{licenseurl}{\metacompose[#1]{licenseurlmessage}{ }{ }{}}{}%
  \metaif[]{url}{\metacompose[#1]{urlmessage}
    {\metaget[skip]{rightstext}}{}{}}{}
  \metacompose[#1]{attributionmessage}{\metaget[skip]{rightstext}}{}{}%
}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Copyright Composition.}
%
% \macro{copyright...}
% Declare registers to specify document copyright:
%    \begin{macrocode}
\metadef{copyrightmark}
\metadef{copyrightdate}
\metadef{copyrightowner}
\metadef{copyrightstatement}
\metadef{copyrightmessage}
%    \end{macrocode}

% \macro{copyrightmark}
% The copyright sign or word:
%    \begin{macrocode}
\metaset{copyrightmark}{Copyright}
\metaset[print]{copyrightmark}{\copyright}
%    \end{macrocode}

% \macro{copyrightstatement}
% Assemble the copyright statement from available fragments;
% proper spacing makes this a bit tedious:
%    \begin{macrocode}
\metaset{copyrightstatement}{\metaifpick[#1]{copyrightdate}%
  {\metapick[#1]{copyrightmark} \metapick[#1]{copyrightdate}%
  \metacompose[#1]{copyrightowner}{ }{}{}.}
  {\metaifpick[#1]{copyrightowner}
   {\metapick[#1]{copyrightmark} \metapick[#1]{copyrightowner}.}{}}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{License Composition.}
%
% \macro{license...}
% Declare registers to specify document license:
%    \begin{macrocode}
\metadef{licenseversion}
\metadef{licenseprovider}
\metadef{licensemessage}
\metadef{licenselogo}
\metadef{licenselogomessage}
\metadef{licenseurl}
\metadef{licenseurlmessage}
%    \end{macrocode}

% \macro{attributionmessage}
% Declare a register for the attribution message:
%    \begin{macrocode}
\metadef{attributionmessage}
%    \end{macrocode}

% \macro{licenseurlmessage}
% Message to declare URL at which the relevant license
% or further details can be found (translated):
% \translate{licenseurlmessage}
%    \begin{macrocode}
% \metaset{licenseurlmessage}{%
%   To view a copy of this license, visit: \metapick[#1]{licenseurl}.}
%    \end{macrocode}

% \macro{licenseurl}
% In |print| version, pass plain |licenseurl| through |\url|:
%    \begin{macrocode}
\metaset[print]{licenseurl}{\url{\metaget[]{licenseurl}}}
%    \end{macrocode}

% \macro{licenselogo}
% \macro{licenselogomessage}
% Display license logo, by default align centrally;
% abuse the variant argument for passing the file name argument
% to |\includegraphics|:
%    \begin{macrocode}
\metaset[print]{licenselogomessage}{%
  \centerline{\metapick[#1]{licenselogo}}}
\metaset[cmd]{licenselogo}{\includegraphics{#1}}
\metaset[print]{licenselogo}{%
  \IfFileExists{\metaget[]{licenselogo}.pdf}%
    {\mstr@getbare[cmd]{licenselogo}{\metaget[]{licenselogo}}}%
    {\mstr@getbare[cmd]{licenselogo}{\metaget[nocurr]{licenselogo}}}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Write to PDF.}
%
% \macro{\metawritepdfrights}
% Write rights information
% (rights text, alternative language representations, license url)
% to PDF via \textsf{hyperxmp}:
%    \begin{macrocode}
\newcommand{\metawritepdfrights}{\ifdefined\hypersetup\ifdefined\xmptilde
    \metaifpick[\mstr@lang@meta]{rightstext}
      {\hypersetup{pdfcopyright=
        {\metapick[\mstr@lang@meta]{rightstext}}}}{}%
    \metaif[altlang]{rightstext}
      {\@for\mstr@tmp:=\mstr@data@rightstext@altlang{}\do
        {\XMPLangAlt{\mstr@tmp}{pdfcopyright=
          {\metapick[\mstr@tmp]{rightstext}}}}}{}
    \metaifpick[\mstr@lang@meta]{licenseurl}
      {\hypersetup{pdflicenseurl=
        {\metapick[\mstr@lang@meta]{licenseurl}}}}{}%
\fi\fi}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Copyright Presets.}
%
% \macro{copyright@...}
% Declare some copyright presets:
%    \begin{macrocode}
\metadef{copyright@plain}
\metadef{copyright@parts}
\metadef{copyright@doc}
\metadef{copyright@doc-parts}
\metadef{copyright@reserved}
\metadef{copyright@publicdomain}
%    \end{macrocode}
% \macro{plain}
% \macro{parts}
% \macro{doc}
% \macro{doc-parts}
% \macro{reserved}
% Some plain copyright messages (translated):
% \translate{copyright@plain}
% \translate{copyright@parts}
% \translate{copyright@doc}
% \translate{copyright@doc-parts}
% \translate{copyright@reserved}
%    \begin{macrocode}
% \metaset{copyright@plain}{%
%   This work is protected by copyright.}
% \metaset{copyright@parts}{%
%   This work as well as its parts is protected by copyright.}
% \metaset{copyright@doc}{%
%   This document is protected by copyright.}
% \metaset{copyright@doc-parts}{%
%   This document as well as its parts is protected by copyright.}
% \metaset{copyright@reserved}{All rights reserved.}
%    \end{macrocode}
% \macro{publicdomain}
% A public domain declaration (translated):
% \translate{copyright@publicdomain}
%    \begin{macrocode}
% \metaset{copyright@publicdomain}
%   {This work is dedicated to the public domain.}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{License Presets.}
%
% \macro{license@...}
% Declare some license presets
%    \begin{macrocode}
\metadef{license@consent}
\metadef{license@consent-noncom}
\metadef{license@lppl}
%    \end{macrocode}

% \macro{consent}
% A license to reproduce with prior written consent (translated):
% \translate{license@consent}
%    \begin{macrocode}
% \metaset{license@consent}{%
%   Reproduction of any part of this work in any form
%   without prior written consent
%   \metacompose[#1]{licenseprovider}{}{}{of the author}
%   is not permissible.}
%    \end{macrocode}

% \macro{consent-noncom}
% A license to reproduce
% for private, scientific and non-commercial purposes
% or with prior written consent (translated):
% \translate{license@consent-noncom}
%    \begin{macrocode}
% \metaset{license@consent-noncom}{%
%   Reproduction of any part of this work in any form
%   without prior written consent
%   \metapick[#1]{licenseprovider}{}{}{of the author}
%   is permissible only for private, scientific and non-commercial use.}
%    \end{macrocode}

% \macro{lppl}
% \LaTeX{} project public license (translated):
% \translate{license@lppl}
%    \begin{macrocode}
\metaset[url]{license@lppl}{http://www.latex-project.org/lppl.txt}
% \metaset{license@lppl}{%
%   This work may be distributed and/or modified under the
%   conditions of the LaTeX Project Public License, either version
%   \metaif[]{licenseversion}{\metaget[]{licenseversion}}{1.3}
%   of this license or (at your option) any later version.}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Selection Code.}
%
% \macro{\metacopyright}
% \macro{\metalicense}
% Set a copyright or license message:
%    \begin{macrocode}
\newcommand{\metacopyright}[1]{%
  \metaset{copyrightmessage}{\metapick[##1]{copyright@#1}}}
\newcommand{\metalicense}[1]{%
  \metaset{licensemessage}{\metapick[##1]{license@#1}}%
  \metaif[url]{license@#1}{%
    \metaset{licenseurl}{\metaget[url]{license@#1}}}{}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Creative Commons}
% \label{sec:imp-cc}
%
% The following implements the scheme of Creative Commons licenses.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Declarations.}
%
% \macro{cc@type}
% \macro{cc@class}
% |cc@type| stores the selected CC license type;
% |cc@class| is `|@zero|' for the CC0 public domain dedication
% and empty otherwise:
%    \begin{macrocode}
\metadef{cc@type}
\metadef{cc@class}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Text Components and Internationalisation.}
%
% CC license declarations are composed
% from several elements which can be conveniently internationalised.
%
% The following registers store various terms used in CC licenses:
% \translate{term-cc@...}
%    \begin{macrocode}
\metasetterm{cc@sep}{-}
\metasetterm{cc@quotel}{\textquotedblleft}
\metasetterm{cc@quoter}{\textquotedblright}
\metasetterm{cc@cc}{Creative Commons}
\metasetterm{cc@zero}{CC0}
\metasetterm{cc@by}{Attribution}
\metasetterm{cc@sa}{ShareAlike}
\metasetterm{cc@nd}{NoDerivatives}
\metasetterm{cc@nc}{NonCommercial}
\metasetterm{cc@unported}{Unported}
\metasetterm{cc@generic}{Generic}
\metasetterm{cc@intl}{International}
\metasetterm{cc@univ}{Universal}
\metasetterm{cc@pd}{Public Domain}
\metasetterm{cc@license}{License}
\metasetterm{cc@pddecl}{Public Domain Dedication}
%    \end{macrocode}

% \macro{cc@pd}
% \macro{cc@zero}
% \macro{cc@by...}
% The following template registers store the combinations
% for the various CC licenses:
%    \begin{macrocode}
\metadef{cc@pd}
\metadef{cc@zero}
\metadef{cc@by}
\metadef{cc@by-sa}
\metadef{cc@by-nd}
\metadef{cc@by-nc}
\metadef{cc@by-nc-sa}
\metadef{cc@by-nc-nd}
%    \end{macrocode}
% Fill the registers:
%    \begin{macrocode}
\metaset{cc@zero}{\metatranslate[#1]{cc@zero}}
\metaset{cc@by}{\metatranslate[#1]{cc@by}}
\metaset{cc@by-sa}{%
  \metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@sa}}
\metaset{cc@by-nd}{%
  \metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@nd}}
\metaset{cc@by-nc}{%
  \metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@nc}}
\metaset{cc@by-nc-sa}{%
  \metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@nc}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@sa}}
\metaset{cc@by-nc-nd}{%
  \metatranslate[#1]{cc@by}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@nc}\metatranslate[#1]{cc@sep}%
  \metatranslate[#1]{cc@nd}}
%    \end{macrocode}

% \macro{cc@n.n}
% \macro{cc@n.n@zero}
% The following registers store the various versions for CC licenses:
%    \begin{macrocode}
\metadef{cc@1.0@zero}
\metadef{cc@1.0}
\metadef{cc@2.0}
\metadef{cc@2.5}
\metadef{cc@3.0}
\metadef{cc@4.0}
%    \end{macrocode}
% Fill the registers:
%    \begin{macrocode}
\metaset{cc@1.0@zero}{\metatranslate[#1]{cc@univ}}
\metaset{cc@1.0}{\metatranslate[#1]{cc@generic}}
\metaset{cc@2.0}{\metatranslate[#1]{cc@generic}}
\metaset{cc@2.5}{\metatranslate[#1]{cc@generic}}
\metaset{cc@3.0}{\metatranslate[#1]{cc@unported}}
\metaset{cc@4.0}{\metatranslate[#1]{cc@intl}}
%    \end{macrocode}

% \macro{cc@license}
% \macro{cc@license@zero}
% \macro{cc@license@pd}
% The following registers store the term ``CC license'':
%    \begin{macrocode}
\metadef{cc@license}
\metadef{cc@license@zero}
\metadef{cc@license@pd}
%    \end{macrocode}
% Fill the registers (translated):
% \translate{cc@license}
% \translate{cc@license@zero}
% \translate{cc@license@pd}
%    \begin{macrocode}
% \metaset{cc@license}{%
%   \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@license}}
% \metaset{cc@license@zero}{%
%   \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@pddecl}}
\metaset{cc@license@pd}{\metatranslate[#1]{cc@pddecl}}
%    \end{macrocode}

% \macro{cc@message}
% \macro{cc@message@zero}
% The following registers contain presets for the CC license messages:
%    \begin{macrocode}
\metadef{cc@message}
\metadef{cc@message@zero}
%    \end{macrocode}
% Fill the registers (translated):
% \translate{cc@message}
% \translate{cc@message@zero}
%    \begin{macrocode}
% \metaset{cc@message}{%
%   This work is licensed under the
%   \metapick[#1]{licenseccfull} (\metapick[short]{licenseccfull}).}
% \metaset{cc@message@zero}{%
%   This work is dedicated to the public domain by means of the
%   \metapick[#1]{licenseccfull} (\metapick[short]{licenseccfull}).}
%    \end{macrocode}

% \macro{licensecc}
% \macro{licenseccver}
% \macro{licenseccfull}
% |licensecc| and |licenseccver|
% represent the name and version of the selected CC license;
% |licenseccfull| contains a full representation of the selected CC license:
%    \begin{macrocode}
\metadef{licensecc}
\metadef{licenseccver}
\metadef{licenseccfull}
%    \end{macrocode}
% Fill the registers:
%    \begin{macrocode}
\metaset{licensecc}{%
  \metapick[#1]{cc@\metaget[]{cc@type}}}
\metaset{licenseccver}{%
  \metaget[]{licenseversion}
  \metapick[#1]{cc@\metaget[]{licenseversion}\metaget[]{cc@class}}}
\metaset{licenseccfull}{%
  \metapick[#1]{cc@license\metaget[]{cc@class}}
  \metatranslate[#1]{cc@quotel}%
  \metapick[#1]{licensecc}
  \metapick[#1]{licenseccver}%
  \metatranslate[#1]{cc@quoter}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{License Identifier.}
%
% \macro{ident}
% Compose the license identifier by |ident| variant:
%    \begin{macrocode}
\metaset[ident]{licenseccver}{\metaget[]{licenseversion}}
\metaset[ident]{licenseccfull}{%
  \metapick[ident]{licensecc} \metaget[ident]{licenseccver}}
\metasetterm[ident]{cc@sep}{-}
\metasetterm[ident]{cc@cc}{CC}
\metasetterm[ident]{cc@by}{BY}
\metasetterm[ident]{cc@sa}{SA}
\metasetterm[ident]{cc@nd}{ND}
\metasetterm[ident]{cc@nc}{NC}
\metasetterm[ident]{cc@zero}{CC0}
%    \end{macrocode}
%
% \macro{short}
% Compose the short license identifier by |short| variant:
%    \begin{macrocode}
\metaset[short]{licensecc}{%
  \metaget[short]{cc@license\metaget[]{cc@class}}%
  \metapick[short]{cc@\metaget[]{cc@type}}}
\metaset[short]{licenseccver}{\metaget[]{licenseversion}}
\metaset[short]{licenseccfull}{%
  \metapick[short]{licensecc} \metaget[short]{licenseccver}}
\metasetterm[short]{cc@sep}{-}
\metasetterm[short]{cc@cc}{CC}
\metasetterm[short]{cc@by}{BY}
\metasetterm[short]{cc@sa}{SA}
\metasetterm[short]{cc@nd}{ND}
\metasetterm[short]{cc@nc}{NC}
\metasetterm[short]{cc@zero}{CC0}
\metaset[short]{cc@license}{CC }
\metaset[short]{cc@license@zero}{}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{License Logo.}
%
% \macro{logo}
% |logo| variants used for the license logo
% provided by the \textsf{doclicense} package:
%    \begin{macrocode}
\metaset[logo]{cc@pd}{doclicense-CC-pd}
\metaset[logo]{cc@zero}{doclicense-CC-zero}
\metaset[logo]{cc@by}{doclicense-CC-by}
\metaset[logo]{cc@by-sa}{doclicense-CC-by-sa}
\metaset[logo]{cc@by-nd}{doclicense-CC-by-nd}
\metaset[logo]{cc@by-nc}{doclicense-CC-by-nc}
\metaset[logo]{cc@by-nc-sa}{doclicense-CC-by-nc-sa}
\metaset[logo]{cc@by-nc-nd}{doclicense-CC-by-nc-nd}
%    \end{macrocode}
% Select currency versions:
%    \begin{macrocode}
\mstr@iftext\mstr@opt@cclogocurr{dollar}{\metaset[curr]{licenselogo}{}}
\mstr@iftext\mstr@opt@cclogocurr{euro}{\metaset[curr]{licenselogo}{-eu}}
\mstr@iftext\mstr@opt@cclogocurr{yen}{\metaset[curr]{licenselogo}{-jp}}
%    \end{macrocode}
% Select shape versions:
%    \begin{macrocode}
\mstr@iftext\mstr@opt@cclogoshape{box}{\metaset[shape]{licenselogo}{-88x31}}
\mstr@iftext\mstr@opt@cclogoshape{slim}{\metaset[shape]{licenselogo}{-80x15}}
%    \end{macrocode}

% \macro{\mstr@setcclogo}
% Use the Creative Commons logos
% included in the \textsf{doclicense} package:
%    \begin{macrocode}
\newcommand{\mstr@setcclogo}{%
  \ifmstr@opt@cclogo
    \IfFileExists{doclicense.sty}{%
      \ifdefined\includegraphics
      \IfFileExists{doclicense-CC-by-88x31.pdf}
        {\metaset[size]{licenselogo}{-88x31}}{}
      \metaset{licenselogo}{%
        \metapick[logo]{licensecc}\metaget[curr]{licenselogo}%
        \metaget[shape]{licenselogo}}%
      \metaset[nocurr]{licenselogo}{%
        \metapick[logo]{licensecc}\metaget[shape]{licenselogo}}%
      \fi}{\GenericWarning{please install package `doclicense'}}%
  \fi}
%    \end{macrocode}

% \macro{icon}
% |icon| variants used for the license icons
% provided by the \textsf{ccicons} package:
%    \begin{macrocode}
\metaset[icon]{licensecc}{%
  \metaget[icon]{cc@license\metaget[]{cc@class}}%
  \metapick[icon]{cc@\metaget[]{cc@type}}}
\metaset[icon]{licenseccver}{\metaget[]{licenseversion}}
\metaset[icon]{licenseccfull}{%
  \metaget[icon]{licensecc}
  \metaget[icon]{licenseccver}}
\metasetterm[icon]{cc@sep}{}
\metasetterm[icon]{cc@cc}{\ccLogo}
\metasetterm[icon]{cc@pd}{\ccPublicDomain}
\metasetterm[icon]{cc@zero}{\ccZero}
\metasetterm[icon]{cc@by}{\ccAttribution}
\metasetterm[icon]{cc@sa}{\ccShareAlike}
\metasetterm[icon]{cc@nd}{\ccNoDerivatives}
\metasetterm[icon]{cc@nc}{\ccNonCommercial}
\metaset[icon]{cc@license}{\metatranslate[#1]{cc@cc}}
\metaset[icon]{cc@license@zero}{\metatranslate[#1]{cc@cc}}
\metaset[icon]{cc@license@pd}{\metatranslate[#1]{cc@pd}}
\metaset[icon]{copyrightmark}{\ccCopy}
%    \end{macrocode}
% Use euro or yen sign versions:
%    \begin{macrocode}
\mstr@iftext\mstr@opt@cclogocurr{euro}{
  \metasetterm[icon]{cc@nc}{\ccNonCommercialEU}}
\mstr@iftext\mstr@opt@cclogocurr{yen}{
  \metasetterm[icon]{cc@nc}{\ccNonCommercialJP}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{License URL.}
%
% \macro{url}
% The |url| variant of compounds are used for the license URL.
%    \begin{macrocode}
\metaset[url]{licenseccver}{\metaget[]{licenseversion}}
\metaset[url]{licenseccfull}{%
  \metaget[url]{cc@license\metaget[]{cc@class}}/%
  \metapick[url]{licensecc}/%
  \metaget[url]{licenseccver}/}
\metaset[url]{cc@license}{https://creativecommons.org/licenses}
\metaset[url]{cc@license@zero}{https://creativecommons.org/publicdomain}
\metaset[url]{cc@zero}{zero}
\metaset[url]{cc@by}{by}
\metaset[url]{cc@by-sa}{by-sa}
\metaset[url]{cc@by-nd}{by-nd}
\metaset[url]{cc@by-nc}{by-nc}
\metaset[url]{cc@by-nc-sa}{by-nc-sa}
\metaset[url]{cc@by-nc-nd}{by-nc-nd}
%    \end{macrocode}

% Declare registers for internationalisation of deed URL:
%    \begin{macrocode}
\metadef{cc@url}
\metadef{cc@url@deed}
%    \end{macrocode}
% Fill registers:
% \translate{cc@url@deed}
%    \begin{macrocode}
\metaset{cc@url@deed}{}
\metaset{cc@url}{\metapick[url]{licenseccfull}\metapick[#1]{cc@url@deed}}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{License Preset.}
%
% \macro{\metalicensecc}
% Set the CC license of type `|#1|':
%    \begin{macrocode}
\newcommand{\metalicensecc}[1]{%
  \def\mstr@tmpl{#1}%
  \def\mstr@tmp{pd}%
  \ifx\mstr@tmpl\mstr@tmp
    \metaset{cc@class}{@pd}%
    \metacopyright{publicdomain}%
    \metaset{cc@type}{pd}%
  \else
    \def\mstr@tmp{zero}%
    \ifx\mstr@tmpl\mstr@tmp
      \metaset{cc@class}{@zero}%
      \metaif[]{licenseversion}{}{\metaset{licenseversion}{1.0}}%
    \else
      \metaset{cc@class}{}%
      \metaif[]{licenseversion}{}{\metaset{licenseversion}{4.0}}%
    \fi
    \metaset{cc@type}{#1}%
    \metaset{licenseurl}{\metapick[##1]{cc@url}}%
    \metaset{licensemessage}
      {\metapick[##1]{cc@message\metaget[]{cc@class}}}%
  \fi
  \mstr@setcclogo}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Contact Information}
% \label{sec:imp-contact}
%
% The following describes an interface
% to store and write contact information.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Declarations.}
%
% \macro{contact...}
% Contact register declarations:
%    \begin{macrocode}
\metadef{contactaddress}
\metadef{contactpostcode}
\metadef{contactcity}
\metadef{contactregion}
\metadef{contactcountry}
\metadef{contactemail}
\metadef{contacturl}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Write to PDF.}
%
% \macro{\metawritepdfcontact}
% Write contact information to PDF via \textsf{hyperxmp}:
%    \begin{macrocode}
\newcommand{\metawritepdfcontact}{\ifdefined\hypersetup\ifdefined\xmptilde
  \metaifpick[\mstr@lang@meta]{contactaddress}{%
    \hypersetup{pdfcontactaddress=
      {\metapick[\mstr@lang@meta]{contactaddress}}}}{}%
  \metaifpick[\mstr@lang@meta]{contactpostcode}{%
    \hypersetup{pdfcontactpostcode=
      {\metapick[\mstr@lang@meta]{contactpostcode}}}}{}%
  \metaifpick[\mstr@lang@meta]{contactcity}{%
    \hypersetup{pdfcontactcity=
      {\metapick[\mstr@lang@meta]{contactcity}}}}{}%
  \metaifpick[\mstr@lang@meta]{contactregion}{%
    \hypersetup{pdfcontactregion=
      {\metapick[\mstr@lang@meta]{contactregion}}}}{}%
  \metaifpick[\mstr@lang@meta]{contactcountry}{%
    \hypersetup{pdfcontactcountry=
      {\metapick[\mstr@lang@meta]{contactcountry}}}}{}%
  \metaifpick[\mstr@lang@meta]{contactemail}{%
    \hypersetup{pdfcontactemail=
      {\metapick[\mstr@lang@meta]{contactemail}}}}{}%
  \metaifpick[\mstr@lang@meta]{contacturl}{%
    \hypersetup{pdfcontacturl=
      {\metapick[\mstr@lang@meta]{contacturl}}}}{}%
\fi\fi}
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Extras}
% \label{sec:imp-extra}
%
% The following defines some extras to be activated by package options.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Course Metadata.}
%
% Include structures for course materials:
%    \begin{macrocode}
\ifmstr@opt@course
%    \end{macrocode}

%\macro{institution}
%\macro{instructor}
%\macro{course}
%\macro{material}
%\macro{period}
% Declare course structures:
%    \begin{macrocode}
\metadef{institution}
\metadef{instructor}
\metadef{course}
\metadef{material}
\metadef{period}
%    \end{macrocode}

% Preset formatting styles:
%    \begin{macrocode}
\metaset[style]{course}{\LARGE\bfseries}
\metaset[style]{material}{\large}
\metaset[style]{institution}{\large}
\metaset[style]{period}{\large}
\metaset[style]{instructor}{\scshape\Large}
\metaset[skip]{material}{\vspace{2ex}}
\metaset[skip]{institution}{\vspace{4ex}}
\metaset[skip]{period}{\vspace{4ex}}
\metaset[skip]{instructor}{\vspace{6ex}}
\metaset[sep]{period}{, }
%    \end{macrocode}

% Fill |titletext| in |course| variant to display
% relevant title data for the course material:
%    \begin{macrocode}
\metaset[course]{titlematter}{%
  \metapick[course]{titletext}%
  \metapick[course]{datatext}%
  \metapick[course]{authortext}}
\metaset[course]{titletext}{%
  \metatitleline[print]{course}%
  \metatitlelinetwo[print]{material}[print]{draft}}
\metaset[course]{authortext}{%
  \metatitleline[print]{instructor}}
\metaset[course]{datatext}{%
  \metatitlelinetwo[print]{institution}[print]{period}}
%    \end{macrocode}
% Legacy presets:
%    \begin{macrocode}
\ifmstr@opt@titlematter\else
\metaset[course]{titlematter}{%
  \metapick[course]{titletext}}
\metaset[course]{titletext}{%
  \metatitleline[print]{course}%
  \metatitlelinetwo[print]{material}[print]{draft}%
  \metapick[course]{datatext}%
  \metapick[course]{authortext}}
\fi
%    \end{macrocode}

% Inherit title, subtitle, author and date:
%    \begin{macrocode}
\metaset{title}{\metapick[#1]{course}}
\metaset{subtitle}{\metapick[#1]{material}}
\metaset{author}{\metapick[#1]{instructor}}
\metaset{date}{\metapick[#1]{period}}
\metaset{location}{\metapick[#1]{institution}}
%    \end{macrocode}

%    \begin{macrocode}
\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Translations}
% \label{sec:imp-translate}
%
% Determine all desired international versions to be loaded;
% use first one as fallback language:
%    \begin{macrocode}
\def\mstr@loadlangloop#1|#2&{%
  \mstr@csdo\let{mstr@lang@#1}\relax%
  \ifx\mstr@lang@fallback\@empty\def\mstr@lang@fallback{#1}\fi%
  \if @#2@\else\mstr@loadlangloop#2&\fi}
\expandafter\mstr@loadlangloop\mstr@opt@loadlang|&
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{English.}
%
% Check whether to load English strings:
%    \begin{macrocode}
\ifdefined\mstr@lang@en
%    \end{macrocode}

% Terms:
%    \begin{macrocode}
\metasetterm[en]{title}{Title}
\metasetterm[en]{abstract}{Abstract}
\metasetterm[en]{copyright}{Copyright}
\metasetterm[en]{preface}{Preface}
\metasetterm[en]{part}{Part}
\metasetterm[en]{chapter}{Chapter}
\metasetterm[en]{section}{Section}
\metasetterm[en]{subsection}{Subsection}
\metasetterm[en]{paragraph}{Paragraph}
\metasetterm[en]{appendix}{Appendix}
\metasetterm[en]{page}{Page}
\metasetterm[en]{figure}{Figure}
\metasetterm[en]{table}{Table}
\metasetterm[en]{contents}{Contents}
\metasetterm[en]{listfigure}{List of Figures}
\metasetterm[en]{listtable}{List of Tables}
\metasetterm[en]{references}{References}
\metasetterm[en]{index}{Index}
\metasetterm[en]{draft}{DRAFT}
%    \end{macrocode}

% General purpose messages:
%    \begin{macrocode}
\metaset[en]{urlmessage}{%
  The current version of this work can be found at: \metapick[#1]{url}.}
\metaset[en]{partofmessage}{%
  This document is part of the work: \metapick[#1]{partof}.}
\metaset[en]{licenseurlmessage}{%
  To view a copy of this license, visit: \metapick[#1]{licenseurl}.}
%    \end{macrocode}
% Copyright statements:
%    \begin{macrocode}
\metaset[en]{copyright@plain}{%
  This work is protected by copyright.}
\metaset[en]{copyright@parts}{%
  This work as well as its parts is protected by copyright.}
\metaset[en]{copyright@doc}{%
  This document is protected by copyright.}
\metaset[en]{copyright@doc-parts}{%
  This document as well as its parts is protected by copyright.}
\metaset[en]{copyright@reserved}{All rights reserved.}
\metaset[en]{copyright@publicdomain}
  {This work is dedicated to the public domain.}
%    \end{macrocode}
% License statements:
%    \begin{macrocode}
\metaset[en]{license@consent}{%
  Reproduction of any part of this work in any form
  without prior written consent
  \metacompose[#1]{licenseprovider}{}{}{of the author}
  is not permissible.}
\metaset[en]{license@consent-noncom}{%
  Reproduction of any part of this work in any form
  without prior written consent
  \metacompose[#1]{licenseprovider}{}{}{of the author}
  is permissible only for private, scientific and non-commercial use.}
\metaset[en]{license@lppl}{%
  This work may be distributed and/or modified under the
  conditions of the LaTeX Project Public License, either version
  \metaif[]{licenseversion}{\metaget[]{licenseversion}}{1.3}
  of this license or (at your option) any later version.}
%    \end{macrocode}
% Creative Commons license composition:
%    \begin{macrocode}
\metaset[en]{cc@url@deed}{deed.en}
\metaset[en]{cc@message}{%
  This work is licensed under the
  \metapick[en]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[en]{cc@message@zero}{%
  This work is dedicated to the public domain by means of the
  \metapick[#1]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[en]{cc@license}{%
  \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@license}}
\metaset[en]{cc@license@zero}{%
  \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@pddecl}}
\metasetterm[en]{cc@sep}{-}
\metasetterm[en]{cc@quotel}{\textquotedblleft}
\metasetterm[en]{cc@quoter}{\textquotedblright}
\metasetterm[en]{cc@by}{Attribution}
\metasetterm[en]{cc@sa}{ShareAlike}
\metasetterm[en]{cc@nd}{NoDerivatives}
\metasetterm[en]{cc@nc}{NonCommercial}
\metasetterm[en]{cc@unported}{Unported}
\metasetterm[en]{cc@generic}{Generic}
\metasetterm[en]{cc@intl}{International}
\metasetterm[en]{cc@univ}{Universal}
\metasetterm[en]{cc@license}{License}
\metasetterm[en]{cc@pd}{Public Domain}
\metasetterm[en]{cc@pddecl}{Public Domain Dedication}
%    \end{macrocode}

%    \begin{macrocode}
\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{German.}
%
% Check whether to load German strings:
%    \begin{macrocode}
\ifdefined\mstr@lang@de
%    \end{macrocode}

% Terms:
%    \begin{macrocode}
\metasetterm[de]{title}{Titel}
\metasetterm[de]{abstract}{Zusammenfassung}
\metasetterm[de]{copyright}{Urheberrechte}
\metasetterm[de]{preface}{Vorwort}
\metasetterm[de]{part}{Teil}
\metasetterm[de]{chapter}{Kapitel}
\metasetterm[de]{section}{Abschnitt}
\metasetterm[de]{subsection}{Unterabschnitt}
\metasetterm[de]{paragraph}{Absatz}
\metasetterm[de]{appendix}{Anhang}
\metasetterm[de]{page}{Seite}
\metasetterm[de]{figure}{Abbildung}
\metasetterm[de]{table}{Tabelle}
\metasetterm[de]{contents}{Inhaltsverzeichnis}
\metasetterm[de]{listfigure}{Abbildungsverzeichnis}
\metasetterm[de]{listtable}{Tabellenverzeichnis}
\metasetterm[de]{references}{Literatur}
\metasetterm[de]{index}{Index}
\metasetterm[de]{draft}{ENTWURF}
%    \end{macrocode}

% General purpose messages:
%    \begin{macrocode}
\metaset[de]{urlmessage}{%
  Die aktuelle Version dieses Werks befindet sich unter:
  \metapick[#1]{url}.}
\metaset[de]{partofmessage}{%
  Dieses Dokument ist Teil des Werks: \metapick[#1]{partof}.}
\metaset[de]{licenseurlmessage}{%
  Die Lizenz kann eingesehen werden unter:
  \metapick[#1]{licenseurl}.}
%    \end{macrocode}
% Copyright statements:
%    \begin{macrocode}
\metaset[de]{copyright@plain}{%
  Dieses Werk ist urheberrechtlich gesch\"utzt.}
\metaset[de]{copyright@parts}{%
  Dieses Werk sowie seine Teile sind urheberrechtlich gesch\"utzt.}
\metaset[de]{copyright@doc}{%
  Dieses Dokument ist urheberrechtlich gesch\"utzt.}
\metaset[de]{copyright@doc-parts}{%
  Dieses Dokument sowie seine Teile sind urheberrechtlich gesch\"utzt.}
\metaset[de]{copyright@reserved}{Alle Rechte vorbehalten.}
\metaset[de]{copyright@publicdomain}
  {Dieses Werk ist gemeinfrei.}
%    \end{macrocode}
% License statements:
%    \begin{macrocode}
\metaset[de]{license@consent}{%
  Reproduktion eines Teils dieses Werks in beliebiger Form
  ohne vorg\"angige schriftliche Erlaubnis
  \metacompose[#1]{licenseprovider}{}{}{des Verfassers}
  ist nicht gestattet.}
\metaset[de]{license@consent-noncom}{%
  Reproduktion eines Teils dieses Werks in beliebiger Form
  ohne vorg\"angige schriftliche Erlaubnis
  \metacompose[#1]{licenseprovider}{}{}{des Verfassers}
  ist nur zum privaten, wissenschaftlichen
  und nicht-gewerblichen Gebrauch gestattet.}
\metaset[de]{license@lppl}{%
  Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
  entweder Version
  \metaif[]{licenseversion}{\metaget[]{licenseversion}}{1.3}
  oder (nach Ihrer Wahl) jede sp\"atere Version,
  verteilt und/oder ver\"andert werden.}
%    \end{macrocode}
% Creative Commons license composition:
%    \begin{macrocode}
\metaset[de]{cc@url@deed}{deed.de}
\metaset[de]{cc@message}{%
  Dieses Werk ist lizensiert unter der
  \metapick[de]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[de]{cc@message@zero}{%
  Dieses Werk ist gemeinfrei deklariert mittels der
  \metapick[de]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[de]{cc@license}{%
  \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@license}}
\metaset[de]{cc@license@zero}{%
  \metatranslate[#1]{cc@cc} \metatranslate[#1]{cc@pddecl}}
\metasetterm[de]{cc@sep}{ -- }
\metasetterm[de]{cc@quotel}{\quotedblbase}
\metasetterm[de]{cc@quoter}{\textquotedblleft}
\metasetterm[de]{cc@by}{Namensnennung}
\metasetterm[de]{cc@sa}{Weitergabe unter gleichen Bedingungen}
\metasetterm[de]{cc@nd}{Keine Bearbeitungen}
\metasetterm[de]{cc@nc}{Nicht kommerziell}
\metasetterm[de]{cc@unported}{Unportiert}
\metasetterm[de]{cc@generic}{Generisch}
\metasetterm[de]{cc@intl}{International}
\metasetterm[de]{cc@univ}{Universell}
\metasetterm[de]{cc@license}{Lizenz}
\metasetterm[de]{cc@pd}{Gemeinfrei}
\metasetterm[de]{cc@pddecl}{Gemeinfrei Deklaration}
%    \end{macrocode}

%    \begin{macrocode}
\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{French.}
%
% Disclaimer: professional assistance with translations needed.
%
% Check whether to load French strings:
%    \begin{macrocode}
\ifdefined\mstr@lang@fr
%    \end{macrocode}

% Terms:
%    \begin{macrocode}
\metasetterm[fr]{title}{Titre}
\metasetterm[fr]{abstract}{R\'esum\'e}
\metasetterm[fr]{copyright}{Droits d'Auteur}
\metasetterm[fr]{preface}{Pr\'eface}
\metasetterm[fr]{part}{Partie}
\metasetterm[fr]{chapter}{Chapitre}
\metasetterm[fr]{section}{Section}
\metasetterm[fr]{subsection}{Sous-Section}
\metasetterm[fr]{paragraph}{Paragraphe}
\metasetterm[fr]{appendix}{Annexe}
\metasetterm[fr]{page}{Page}
\metasetterm[fr]{figure}{Figure}
\metasetterm[fr]{table}{Table}
\metasetterm[fr]{contents}{Table des Mati\`eres}
\metasetterm[fr]{listfigure}{Table des Figures}
\metasetterm[fr]{listtable}{Liste des Tableaux}
\metasetterm[fr]{references}{R\'ef\'erences}
\metasetterm[fr]{index}{Index}
\metasetterm[fr]{draft}{BROUILLON}
%    \end{macrocode}

% General purpose messages:
%    \begin{macrocode}
\metaset[fr]{urlmessage}{%
  La version actuelle de cet \oe uvre se trouve \`a l'adresse:
  \metapick[#1]{url}.}
\metaset[fr]{partofmessage}{%
  Ce document fait partie de la \oe uvre: \metapick[#1]{partof}.}
\metaset[fr]{licenseurlmessage}{%
  Pour voir une copie de cette licence, visitez:
  \metapick[#1]{licenseurl}.}
%    \end{macrocode}
% Copyright statements:
%    \begin{macrocode}
\metaset[fr]{copyright@plain}{%
  Cette \oe uvre est prot\'eg\'ee par le droit d'auteur.}
\metaset[fr]{copyright@parts}{%
  Cette \oe uvre ainsi que ses parties
  sont prot\'eg\'ees par le droit d'auteur.}
\metaset[fr]{copyright@doc}{%
  Ce document est prot\'eg\'es par le droit d'auteur.}
\metaset[fr]{copyright@doc-parts}{%
  Ce document ainsi que ses parties
  sont prot\'eg\'es par le droit d'auteur.}
\metaset[fr]{copyright@reserved}{Tous les droits sont r\'eserv\'es.}
\metaset[fr]{copyright@publicdomain}
  {Cette \oe uvre est du domaine public.}
%    \end{macrocode}
% Creative Commons license composition:
%    \begin{macrocode}
\metaset[fr]{cc@url@deed}{deed.fr}
\metaset[fr]{cc@message}{%
  Cette \oe uvre est mise \`a disposition selon les termes de la
  \metapick[fr]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[fr]{cc@message@zero}{%
  Cette \oe uvre est d\'eclar\'ee du domaine public par le
  \metapick[fr]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[fr]{cc@license}{%
  \metatranslate[#1]{cc@license} \metatranslate[#1]{cc@cc}}
\metaset[fr]{cc@license@zero}{%
  \metatranslate[#1]{cc@pddecl} \metatranslate[#1]{cc@cc}}
\metasetterm[fr]{cc@sep}{ -- }
\metasetterm[fr]{cc@quotel}{\guillemotleft}
\metasetterm[fr]{cc@quoter}{\guillemotright}
\metasetterm[fr]{cc@by}{Attribution}
\metasetterm[fr]{cc@sa}{Partage dans les M\^emes Conditions}
\metasetterm[fr]{cc@nd}{Pas de Modification}
\metasetterm[fr]{cc@nc}{Pas d'Utilisation Commerciale}
\metasetterm[fr]{cc@unported}{Non Transpos\'e}
\metasetterm[fr]{cc@generic}{G\'en\'erique}
\metasetterm[fr]{cc@intl}{International}
\metasetterm[fr]{cc@univ}{Universel}
\metasetterm[fr]{cc@license}{Licence}
\metasetterm[fr]{cc@pd}{Domaine Public}
\metasetterm[fr]{cc@pddecl}{Transfert dans le Domaine Public}
%    \end{macrocode}

%    \begin{macrocode}
\fi
%    \end{macrocode}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Spanish.}
%
% Disclaimer: professional assistance with translations needed.
%
% Check whether to load Spanish strings:
%    \begin{macrocode}
\ifdefined\mstr@lang@es
%    \end{macrocode}

% Terms:
%    \begin{macrocode}
\metasetterm[es]{chapter}{Cap\'itulo}
\metasetterm[es]{section}{Secci\'on}
\metasetterm[es]{subsection}{Subsecci\'on}
\metasetterm[es]{paragraph}{P\'arrafo}
\metasetterm[es]{title}{T\'itulo}
\metasetterm[es]{abstract}{Resumen}
\metasetterm[es]{copyright}{Derechos de Autor}
\metasetterm[es]{preface}{Prefacio}
\metasetterm[es]{part}{Parte}
\metasetterm[es]{appendix}{Ap\'endice}
\metasetterm[es]{page}{P\'agina}
\metasetterm[es]{figure}{Figura}
\metasetterm[es]{table}{Cuadro}
\metasetterm[es]{contents}{\'Indice}
\metasetterm[es]{listfigure}{\'Indice de Figuras}
\metasetterm[es]{listtable}{\'Indice de Cuadros}
\metasetterm[es]{references}{Referencias}
\metasetterm[es]{index}{\'Indice Alfab\'etico}
\metasetterm[es]{draft}{BORRADOR}
%    \end{macrocode}

% General purpose messages:
%    \begin{macrocode}
\metaset[es]{urlmessage}{%
  La versi\'on actual de esta obra se puede encontrar en:
  \metapick[#1]{url}.}
\metaset[es]{partofmessage}{%
  Este documento es parte de la obra: \metapick[#1]{partof}.}
\metaset[es]{licenseurlmessage}{%
  Para ver una copia de esta licencia, visite:
  \metapick[#1]{licenseurl}.}
%    \end{macrocode}
% Copyright statements:
%    \begin{macrocode}
\metaset[es]{copyright@plain}{%
  Esta obra est\'a protegida por derechos de autor.}
\metaset[es]{copyright@parts}{%
  Esta obra y sus partes est\'an protegidas por derechos de autor.}
\metaset[es]{copyright@doc}{%
  Este documento est\'a protegido por derechos de autor.}
\metaset[es]{copyright@doc-parts}{%
  Este documento y sus partes est\'an protegidos por derechos de autor.}
\metaset[es]{copyright@reserved}{Todos los derechos reservados.}
\metaset[es]{copyright@publicdomain}
  {Esta obra es de dominio p\'ublico.}
%    \end{macrocode}
% Creative Commons license composition:
%    \begin{macrocode}
\metaset[es]{cc@url@deed}{deed.es}
\metaset[es]{cc@message}{%
  Esta obra est\'a bajo la
  \metapick[es]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[es]{cc@message@zero}{Esta obra est\'a dedicada
  al dominio p\'ublico por la
  \metapick[es]{licenseccfull} (\metapick[short]{licenseccfull}).}
\metaset[es]{cc@license}{%
  \metatranslate[#1]{cc@license} \metatranslate[#1]{cc@cc}}
\metaset[es]{cc@license@zero}{%
  \metatranslate[#1]{cc@pddecl} \metatranslate[#1]{cc@cc}}
\metasetterm[es]{cc@sep}{-}
\metasetterm[es]{cc@quotel}{\textquotedblleft}
\metasetterm[es]{cc@quoter}{\textquotedblright}
\metasetterm[es]{cc@by}{Atribuci\'on}
\metasetterm[es]{cc@sa}{CompartirIgual}
\metasetterm[es]{cc@nd}{SinDerivadas}
\metasetterm[es]{cc@nc}{NoComercial}
\metasetterm[es]{cc@unported}{No Portada}
\metasetterm[es]{cc@generic}{Gen\'erica}
\metasetterm[es]{cc@intl}{Internacional}
\metasetterm[es]{cc@univ}{Universal}
\metasetterm[es]{cc@license}{Licencia}
\metasetterm[es]{cc@pd}{Dominio P\'ublico}
\metasetterm[es]{cc@pddecl}{Dedicaci\'on de Dominio P\'ublico}
%    \end{macrocode}

%    \begin{macrocode}
\fi
%    \end{macrocode}

%\iffalse
%</package>
%\fi
%
\endinput