summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex/njuthesis/njuthesis.dtx
blob: 926b68a51c58b6819130cf717935b956bfa941dc (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
% \iffalse meta-comment
% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
%
% Copyright (C) 2021 
% by Nanjing University Linux User Group <nju.lug@yaoge123.cn>
% 
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version.  The latest version
% of this license is in the file
%
%    https://www.latex-project.org/lppl.txt
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Yu Xiong.
%
% This work consists of the files njuthesis.dtx,
%           and the derived files njuthesis.ins,
%                                 njuthesis.cls,
%                                 njuthesis.pdf,
%                             and README.md.
%
% -----------------------------------------------------------------------
%
% The development version of the template can be found at
%
%    https://github.com/nju-lug/NJUThesis
%
% for those people who are interested.
%
%<*internal>
\iffalse
%</internal>
%
%<*internal>
\fi
\begingroup
  \def\NameOfLaTeXe{LaTeX2e}
\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
\csname fi\endcsname
%</internal>
%
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse

\preamble

Copyright (C) 2021 
by Nanjing University Linux User Group <nju.lug@yaoge123.cn>

This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3c 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.

To produce the documentation run the original source files ending with `.dtx'
through XeTeX.
    
\endpreamble

\generate{
  \usedir{tex/latex/njuthesis}
    \file{\jobname.cls}        {\from{\jobname.dtx}{class}}
%</install>
%<*internal>
  \usedir{source/latex/njuthesis}
    \file{\jobname.ins}        {\from{\jobname.dtx}{install}}
%</internal>
%<*install>
}

\obeyspaces
\Msg{*************************************************************}
\Msg{*                                                           *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* files into a directory searched by TeX:                   *}
\Msg{*                                                           *}
\Msg{* The recommended directory is TDS:tex/latex/njuthesis      *}
\Msg{*                                                           *}
\Msg{*     njuthesis.cls                                         *}
\Msg{*     njuthesis.ins                                         *}
\Msg{*                                                           *}
\Msg{* To produce the documentation, run the file njuthesis.dtx  *}
\Msg{* through XeLaTeX.                                          *}
\Msg{*                                                           *}
\Msg{* Happy TeXing!                                             *}
\Msg{*                                                           *}
\Msg{*************************************************************}

\endbatchfile
%</install>
%
%<*internal>
\fi
%</internal>
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\RequirePackage{expl3}
%<class>\GetIdInfo  $Id: njuthesis.dtx 0.12.0 2021-11-30 11:30:00 +0800  NJU LUG <nju.lug@yaoge123.cn> $
%<class>  { Thesis template for Nanjing University }
%<class>\ProvidesExplClass{njuthesis}
%<class>{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%
%<*driver>
\ProvidesFile{njuthesis.dtx}
\documentclass{ctxdoc}
\usepackage{floatrow,tabularray,njuvisual}
\usepackage[firstpage=true]{background}
\backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm}
\setlist[1]{labelindent=0.5em}
\UseTblrLibrary{booktabs,siunitx,diagbox}
\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable}
\SetTblrStyle{caption-tag}{font=\bfseries}
\DefTblrTemplate{caption-sep}{default}{\quad}
\begin{document}
  \DocInput{njuthesis.dtx}
  \PrintChanges
  \PrintIndex
\end{document}
%</driver>
% \fi
%
% \title{\color{njuviolet}{The \cls{njuthesis} class\\ 南京大学学位论文模板}}
% 
% \author{^^A
% Nanjing University Linux User Group
% \thanks{E-mail: \href{mailto:nju.lug@yaoge123.cn}{nju.lug@yaoge123.cn}}}
%
% \date{v0.12.0 \\ Released 2021-11-30}
%
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
% \changes{v0.3}{2021/09/09}{使用自动构建工具进行测试。}
% \changes{v0.4}{2021/09/09}{将个人信息使用内置命令输入。}
% \changes{v0.5}{2021/09/10}{新增了对第二导师的支持。}
% \changes{v0.6}{2021/09/10}{封装个人信息}
% \changes{v0.6}{2021/09/10}{实现自动打包发布。}
% \changes{v0.7}{2021/09/11}{增加对研究生模板的支持}
% \changes{v0.7}{2021/09/12}{将njuthesis发布在CTAN。}
% \changes{v0.8}{2021/09/12}{修复已知问题,进行公开宣传。}
% \changes{v0.9}{2021/09/15}{使用DocStrip合并模板文件。}
% \changes{v0.9}{2021/09/15}{大幅度修改宏名称以符合\hologo{LaTeX3}规范。}
% \changes{v0.9}{2021/09/15}{进一步完善文档。}
% \changes{v0.10}{2021/09/24}{删除了生成自述文件的代码。}
% \changes{v0.12}{2021/11/28}{删除内置的 \pkg{njuvisual} 代码。}
% \changes{v0.12}{2021/11/29}{更新了说明文档封面设计。}
%
% \maketitle
%
% \begin{abstract}
% 南京大学学位论文 \hologo{LaTeX} 模板 \cls{njuthesis} 基于本科生院的论文撰写
% 规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学学
% 位论文排版要求和相应的国家规范、行业标准的学位论文,旨在为同学提供毕业论文书
% 写的方便。
% \end{abstract}
%
% \def\abstractname{Abstract}
% \begin{abstract}
% The \cls{njuthesis} class is intended for typesetting Nanjing University
% dissertations with \hologo{LaTeX}, providing support for bachelor, masters,  
% and doctoral thesis. 
% \end{abstract}
%
% \vspace{2cm}
% \def\abstractname{特别声明}
% \begin{abstract}
% 请注意,本模板仍未完成开发,出现bug或者文档不完善属于正常情况,欢迎提交
% issue 或 Pull Request。
%
% 本模板未经学校官方部门的审核,作者不对使用本模板产生的格式审查问题负责。
% 
% \href{https://git.nju.edu.cn/nju-lug/lug-introduction}{NJU LUG}始终欢迎
% 您的加入!
% \end{abstract}
%
% \clearpage
%
% \setcounter{tocdepth}{4}
% \tableofcontents
%
% \clearpage
%
% \EnableDocumentation
% 
% \begin{documentation}
%
%
% \section{模板介绍}
% \cls{njuthesis},即南京大学学位论文模板,是一个由南京大学 LUG 组织维护的,用于处理本校学生毕业论文排版需求的 \hologo{LaTeX} 模板。
%
% \subsection{历史沿革}
%
% 十几年来,多位热心校友发布过自己编写的模板,在GitHub上可考的包括
% \begin{enumerate}
%  \item 杨文博(\href{http://yangwenbo.com/}{@solrex})的\href{https://github.com/solrex/njuthesis}{南京大学学位论文\hologo{LaTeX}模板}(2010) 
%  \item \href{https://github.com/fireblue}{@fireblue}基于solrex模板的的\href{https://github.com/fireblue/NJUThesis}{南京大学学位论文\hologo{LaTeX}模板}(2013)
%  \item \href{https://github.com/wenhai-zheng}{@wenhai-zheng}的\href{https://github.com/wenhai-zheng/NJUThesis}{NJUThesis}(2013)  
%  \item 曹增乐(\href{https://github.com/ZLCao}{@ZLCao})的\href{https://github.com/ZLCao/NJUBachelor}{NJUBachelor}(2013-2016)
%  \item 胡海星(\href{http://haixing-hu.github.io/}{@Haixing-Hu})的\href{https://github.com/Haixing-Hu/nju-thesis}{NJU-Thesis}(2013 - 2018)
%  \item 张楚珩(\href{https://github.com/zhangchuheng123}{@zhangchuheng123})基于胡海星模板的\href{https://github.com/zhangchuheng123/NJUThesis}{NJUThesis}(2016)
%  \item 蒋炎岩(\href{http://ics.nju.edu.cn/~jyy/}{@jiangyy})的\href{https://github.com/jiangyy/njuthesis}{南京大学山寨\hologo{LyX}研究生毕业论文模板}(2017)
%  \item \href{https://github.com/njuHan}{@njuHan}基于胡海星模板的\href{https://github.com/njuHan/njuthesis-nju-thesis-template/}{NJU-Thesis}(2018 - 2021)
%  \item 饶安逸(\href{https://anyirao.com/}{@AnyiRao})基于张楚珩模板的\href{https://github.com/AnyiRao/NJUThesis2018/}{NJU Thesis 2018}(2018)
%  \item 赵懿晨(\href{https://fengchendian.github.io/about.html}{@FengChendian})基于饶安逸模板的\href{https://github.com/FengChendian/NJUThesis2021}{NJU Thesis 2021}(2021)
% \end{enumerate}
% 至于不幸而未进行代码版本管理的,甚至于说以压缩包形式流传于各人硬盘中的,就更不可计数了。
%
% 与其让一千个学生做一千种不同的模板,不如有人牵起头来,集中力量办大事。因此,南京大学 Linux User Group 的有志之士在2021年暑期联合起来,参考以上的现成模板,兼顾友校\href{https://ctan.org/pkg/thuthesis}{thuthesis}、\href{https://ctan.org/pkg/fduthesis}{fduthesis}等优秀项目,构建了这一全新模板,力求通过\hologo{LaTeX3}语法和清晰的接口实现良好的易用性和可维护性。
%
% 目前,本模板的主要维护者包括:
%
% \begin{itemize}
%     \item 赵懿晨
%     \item 熊煜
%     \item 马畅
% \end{itemize}
%
% \subsection{君\hologo{LaTeX}本当上手}
% \hologo{LaTeX}并不是一种零门槛的语言,亦不是南京大学学生的必备技能。有同学听到“\emph{给毕业论文交差也得写代码}”这种事情就头疼,实在是我们不愿意见到而必须要面对的情况。目前,中文互联网上的 \hologo{LaTeX} 写作教程不能说屈指可数,起码也是汗牛充栋,比较著名的包括刘海洋的《\hologo{LaTeX}入门》等等都是不错的参考资料。然而如何快速准确找到所需要的用法,尤其是 \hologo{LaTeX3} 的新接口,需要一定的时间或者良好的英文阅读能力。在本文档的写作中,我们无力从盘古开天辟地开始从头构建您的相关知识体系,只能\emph{尽力做到有求必应},在需要的地方顺带提一嘴,保证您少走点弯路。
%
% \subsection{关于本说明手册}
%
% 本模板通过\textsc{DocStrip}进行维护,实际上是一种\emph{文学编程}。文学编程的本体是那些用来说明的文字,按写书写文章的方式组织。
% \file{njuthesis.dtx}包含njuthesis模板的所有信息。前半部分为模板说明,即各种常用命令与必要的使用方法;后半部分为代码实现,为带有详细注释的\hologo{TeX}源代码。后者配合附录,为有意了解本模板细节的同学提供简明的指引。
%
% 下文中将出现若干特殊格式,用来指示代码组件。譬如,\file{file-example.xxx}为文件名,\pkg{pkg-example}为宏包名,\opt{opt-example}为选项名,\env{env-example}为需要|\begin{}|和|\end{}|的环境名,等。
%
% 如果您在使用最新版模板时发现了任何问题,抑或有意向参与本模板的维护,请通过GitHub issue或者QQ群聊联系LUG。
%
% \section{安装}
% \label{sec:setup}
% 本节主要介绍本宏包的获取、安装以及编译方式。
% 
% \subsection{获取模板}
%
% \subsubsection{自动安装}
%
% \href{https://ctan.org/pkg/njuthesis}{\cls{njuthesis}} 已经于2021年9月12日发布在CTAN(Comprehensive \hologo{TeX} Archive Network),将在明年进入\hologo{TeX}\,Live 2022。
% \href{https://ctan.org/pkg/njuvisual}{\pkg{njuvisual}} 也已于同年11月28日发布。
% 目前,南大\hologo{TeX}已预置本模板,详见\ref{subsec:onlinecompile}。
% 您可以通过 \hologo{TeX}\,Live Manager 或者 \hologo{MiKTeX} Console 等
% 图形化包管理器直接安装并使用以上两个宏包最新的稳定版,也可以使用 \pkg{tlmgr}
% \begin{ctexexam}
%   tlmgr install njuthesis
%   tlmgr install njuvisual
% \end{ctexexam}
% 
% 我们强烈建议使用这一类安装方式。
%
% 另一方面,CTAN版需要开发者手动上传,版本更新具有滞后性。如果使用时遇到了问题,推荐使用以下方式获取最新正式版。
% 
% \subsubsection{下载正式版}
% \label{subsubsec:downloadrtm}
%
% 本模板不定期将已有的新功能和问题修复打包为新的正式发行版,下载方式包括:
% \begin{itemize}
%  \item \href{https://github.com/nju-lug/NJUThesis/releases/latest}{Github Releases页面}
%  \item \href{https://mirror.nju.edu.cn/download/app/NJUThesis%20%E8%AE%BA%E6%96%87%E6%A8%A1%E6%9D%BF}{南大镜像下载页}
%\end{itemize}
% 在国内使用时,后者具有显著更快的速度。
%
% \subsubsection{下载源代码}
%
% 最新开发进度会提交在位于Github仓库的源代码。
% 请注意,如果仅仅是希望使用这个模板写论文,请无论如何都不要从编译源代码开始,这样做只会浪费生命中宝贵的数分钟时间。
% 我们只推荐希望参与开发的同学下载\file{dtx}文件。
% \begin{itemize}
%  \item \href{https://github.com/nju-lug/NJUThesis/}{Github 仓库}
%  \item \href{https://git.nju.edu.cn/nju-lug/nju-latex-templates/njuthesis}{NJU Git 同步镜像}
%\end{itemize}
%
% \subsection{文件构成}
%
% \cls{njuthesis}由数量众多的文件组成,\emph{所有可能遇到的}文件如表 \ref{tab:njuthesisfiles} 所示。
% 其中标注为黄色的内容仅供开发使用,并不会在发行版中出现。
%
% \begin{table}[ht]
%   \caption{\cls{njuthesis}文件构成}
%   \label{tab:njuthesisfiles}
%   \centering
%   \begin{tabular}{lp{18em}}
%     \toprule
%     名称 & 说明 \\
%     \midrule
%     \file{.vscode}                        & Visual Studio Code 配置文件 \\
%     \file{latexmkrc}                      & latexmk 配置文件 \\
%     \file{LICENSE}                        & 许可证 \\
%     \file{njuthesis.bib}                  & 示例参考文献列表 \\
%     \file{njuthesis.cls}                  & 模板文档类 \\
%     \color{njuyellow}\file{njuthesis.dtx} & 文档类源代码 \\
%     \color{njuyellow}\file{njuthesis.ins} & 文档类安装脚本 \\
%     \file{njuthesis.pdf}                  & 用户手册(本文档) \\
%     \file{njuthesis-sample.tex}           & 示例文档,不妨以此为基础撰写论文 \\
%     \file{README.md}                      & 自述文件 \\
%     \bottomrule
%   \end{tabular}
% \end{table}
%
% \subsection{本地编译}
% \label{subsec:localcompile}
%
% 本地编译的安装过程分为两个阶段:安装 \hologo{TeX} 发行版以及配置编辑器。前者提供了可以被命令行终端调用的编译程序,后者则提供了语法高亮、自动编译等人性化功能。
%
% \subsubsection{安装\hologo{TeX}发行版}
%
% 首先需要下载并安装 \hologo{TeX} 软件发行版,各操作系统适用情况请参考表\ref {tab:texdistribution}。第一次编译前请务必通过 MiKTeX Console、TeX Live Manager 等图形化程序或 \pkg{tlmgr}\emph{手动更新全部宏包}以避免潜在的兼容性问题。
%
% \begin{table}[H]
%   \centering
%   \caption{\hologo{TeX} 软件发行版一览}
%   \label{tab:texdistribution}
%   \begin{tabular}{cccc}
%     \toprule
%     \hologo{TeX}        & Windows   & macOS     & Linux     \\
%     \midrule
%     \hologo{TeX}\,Live  & $\bullet$ & $\bullet$ & $\bullet$ \\
%     mac\hologo{TeX}     &           & $\bullet$ &           \\
%     \hologo{MiKTeX}     & $\bullet$ & $\bullet$ &           \\
%     \bottomrule
%   \end{tabular}
% \end{table}
%
% 以下是一些值得注意的要点:
% \begin{itemize}
%   \item 校园网环境中访问\href{https://mirror.nju.edu.cn/download/app/TeX%20%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F}{南大镜像站}可以获得最佳的下载体验。
%   \item 使用最新的发行版,即版本号为2021或者21。
%   \item 对于 Windows 和 macOS 用户,更推荐轻量化的 \hologo{MiKTeX} 套件。
%   \item Linux用户请尽可能下载 full 版本,如 |texlive-full|。换言之,下载最大的软件包。
%   \item 对于一部分用到新版本特性的宏包,\cls{njuthesis}内置了版本检查,请确认各宏包已升级至最新版。
% \end{itemize}
%
% \subsubsection{配置编辑器}
% \changes{v0.11}{2021/11/23}{提供TeXstudio配置文件。}
%
% 配置完编译器后,还需要一个\emph{文本编辑器}来完成\file{.tex}文件内容的写作。
%
% 关于具体使用哪一种,至今仍有相当一部分人认为Windows自带的\emph{记事本}是最好的文本编辑器,但对于本项目而言,在此诚心诚意地推荐你使用\emph{更现代更美观更多功能}的编辑器,譬如\emph{安装了 LaTeX Workshop 插件 的 \href{https://code.visualstudio.com/}{Visual Studio Code}}。你也可以根据个人的喜好随意使用 TeXworks、TeXstudio 等编辑器,顺手就行。
%
% \cls{njuthesis} 为一些常见编辑器提供了配置文件,如
% \begin{description}
%   \item[Visual Studio Code] 本模板在\file{.vscode/}中提供一份\hologo{LaTeX} Workshop 插件的简易配置,在打开文件夹后将自动导入,可以省略初始配置步骤直接使用。
%   \item[TeXstudio] 本模板提供 \file{conf.txsprofile},可以使用快捷键 |alt+O+P| 导入配置文件。为了简化流程\footnote{当然,也可以设置为使用 \hologo{XeLaTeX} 编译,然后按照 \ref{subsubsec:compileseq} 内容使用快捷键 |F8| 手动编译参考文献。},该配置文件使用 \pkg{latexmk},第一次编译前请参考下一节内容安装 Perl。
% \end{description}
%
% \subsubsection{编译顺序}
% \label{subsubsec:compileseq}
% \hologo{TeX} 本身是命令行程序,通过不同的命令调用所需的编译引擎。
% 尽管上述的文本编辑器已经提供了自动化编译的方法,为了便于排查运行错误,以下通过具体终端命令简要描述编译过程。
%
% 编译本模板概括为如下步骤:生成初始文档,编译参考文献,生成页码、编号、目录,需要编译4次。
% \emph{假设即将使用的文件名为 \file{mynjuthesis.tex}},
% 应采用以下命令顺序进行编译,以生成内容正确的 \file{mynjuthesis.pdf}。输出的 PDF 文档位于同一目录下。
%
% 编译命令具体为引擎名称加文件名,在编译\file{.tex}文件时,文件扩展名可以省略不写。现阶段 \cls{njuthesis} 仅支持 \hologo{XeLaTeX} 与 \hologo{LuaLaTeX}。请注意,几种命令的输出文件基本相同,可以任取一种;但如果你不清楚这两种编译引擎的区别,我们建议优先使用|latexmk -xelatex|。
%
% \subparagraph{使用 \hologo{XeLaTeX}}
% 
% \begin{ctexexam}
%   xelatex mynjuthesis
%   biber mynjuthesis
%   xelatex mynjuthesis
%   xelatex mynjuthesis
% \end{ctexexam}
%
% \subparagraph{使用 \hologo{LuaLaTeX}}
% \begin{ctexexam}
%   lualatex mynjuthesis
%   biber mynjuthesis
%   lualatex mynjuthesis
%   lualatex mynjuthesis
% \end{ctexexam}
%
% \subparagraph{使用 \pkg{latexmk}}
% \href{https://mg.readthedocs.io/latexmk.html}{\pkg{latexmk}} 是一个基于 Perl 脚本的自动编译工具,宗旨是通过单一命令简化上述的多次编译流程。在使用该命令前,请确保安装了以下软件:
% \begin{description}
%   \item[Perl] 一般预装于 macOS 和 Linux,而 Windows 用户需要单独安装 \href{https://strawberryperl.com/}{Strawberry Perl}。
%   \item[\pkg{latexmk}] \hologo{MiKTeX}已预装;如果终端找不到|latexmk|命令,\hologo{TeX}\,Live 用户需使用 \pkg{tlmgr} 单独安装。
% \end{description}
%
% 该命令的使用方法为
% \begin{ctexexam}
%   latexmk mynjuthesis
% \end{ctexexam}
%
% 如需指定编译器,可以加入|-xelatex|或|-lualatex|参数,例如指定 \hologo{XeLaTeX} 的命令为
% \begin{ctexexam}
%   latexmk -xelatex mynjuthesis
% \end{ctexexam}
%
% 此外可以选择使用以下命令清理编译生成的临时文件。
% \begin{ctexexam}
%   latexmk -c
% \end{ctexexam}
%
% \subsection{在线编译}
% \label{subsec:onlinecompile}
%
% 相信你在接触了本地编译以后,很快就会意识到一些十分显然的事实,譬如\hologo{TeX}编译器安装过程较为漫长\footnote{因此对于 Windows 推荐 \hologo{MiKTeX}。},占用空间过大,而且在一部分处理器性能不佳的电脑上需要较长编译时间\footnote{同一个模板在 Linux 编译可以相对 Windows 节省一半耗时。}。拒绝接受这些麻烦的同学不妨尝试本节介绍的在线编译方法。
%
% \subsubsection{南大\hologo{TeX}平台简介}
% \changes{v0.2}{2021/09/07}{添加对南大\hologo{TeX}的支持。}
%
% \href{https://tex.nju.edu.cn}{南大\hologo{TeX}}基于开源的 ShareLaTeX 平台\footnote{理论上在\href{https://doc.nju.edu.cn/books/latex}{这个网站}能找到一段平台简介,实际上大家都有意无意地鸽了,下次一定补上。},于2021年3月4日正式上线,是 \href{https://sci.nju.edu.cn/}{eScience 中心}为南大在校师生提供的 \hologo{LaTeX} 在线编译平台,首次使用需凭学校邮箱自助注册账号。
%
% \subsubsection{操作步骤}
%
% \begin{enumerate}
%     \item 访问\href{https://tex.nju.edu.cn}{南大\hologo{TeX}},点击界面右上方Register,使用\emph{南京大学邮箱}注册账号并登录
%     \item 在项目页面左上角的Menu中,将编译器改为\hologo{XeLaTeX}或者\hologo{LuaLaTeX}
%     \item 仿照 \file{njuthesis-sample.tex} 编写论文
%     \item 点击Compile按钮进行编译和预览
% \end{enumerate}
%
% 注意,由于南大\hologo{TeX}已预装\cls{njuthesis},可以直接编写正文,无需\file{.cls}等格式文件。如果需要使用新版模板,也可以点击New Project -> Upload Project上传 \ref{subsubsec:downloadrtm} 得到的压缩文件。
%
% \subsubsection{关于Overleaf}
%
% 由于\href{https://www.overleaf.com/}{Overleaf} 平台的\hologo{TeX}\,Live版本停留在2020,\texttt{cleveref}包在引用章节时会生成错误的标签,引发格式错误;而南大\hologo{TeX}通过及时更新规避了若干问题。因此\emph{请务必不要使用Overleaf官网进行编译}。
%
% \subsubsection{关于TeXPage}
%
% \href{https://www.texpage.com/}{TeXPage} 是国人研发的\hologo{LaTeX}在线编辑器,当前版本已具备较为完善的编辑编译功能,而且免费版相对 Overleaf 增加了公式识别、编辑历史等实用工具,也可以作为一个备选项。目前的缺憾是对于 \cls{njuthesis} 的编译速度较慢。 
%
% \section{使用方法}
%
% \subsection{标准结构}
%
% 典型的\cls{njuthesis}主文件结构应该如下所示:
%
% \begin{ctexexam}
%   \documentclass[<options>]{njuthesis}
%   \njusetup { info = {<info>} }
%   \graphicspath{{figure/}}
%   \addbibresource{njuthesis.bib}
%   \begin{document}
%   \maketitle
%   <abstract>
%   <preface>
%   \tableofcontents
%   \listoffigures
%   \listoftables
%   \mainmatter
%   <text>
%   \printbibliography[heading=bibintoc,title=参考文献]
%   <acknowledgement>
%   \appendix
%   <appendix>
%   \end{document}
% \end{ctexexam}
%
% \subsection{模板选项}
%
% 模板选项位于\tn{documentclass}后的方括号内,用于指定模板的行为。
% 下文中尖括号内列出了若干个允许的选项,其中加粗的为默认选项。
%
%
% 
% \subsubsection{学位信息}
% \begin{function}[added=2021-09-07]{degree}
%   \begin{syntax}
%     degree = <(ug)|mg|mf|phd>
%   \end{syntax}
%
% 选择学位,分别为学士、学术型硕士、专业硕士、博士。
% \end{function}
% 
% \begin{function}[added=2021-09-07]{nlcover}
%   \begin{syntax}
%     nlcover = <\TTF>
%   \end{syntax}
%
% 通过此项可选择是否添加国家图书馆封面。由于本科生院文件中并未提及相关规定,故本选项仅对于研究生有效。
% \end{function}  
%
% \begin{function}[added=2021-09-07]{type}
%   \begin{syntax}
%     type = <(thesis)|design>
%   \end{syntax}
%
% 用于选择文档类型并将相关字段输出在封面和摘要页,可选值分别为毕业论文和毕业设计。
% 
% \end{function}
%   
%
%
% \subsubsection{指定字体}
%
% 学校论文格式要求使用的字体一般已经预装在各个操作系统,本模板针对不同平台进行了自动检测适配,可以开箱即用。
%
% 如果希望更改本模板使用的字体,请填写以下两个选项以覆盖操作系统检测得到的设置。
% 
% \begin{function}[added=2021-09-07]{customchinesefont,customlatinfont}
%   \begin{syntax}
%     customchinesefont = <(windows)|macos|fandol|founder|noto|none>
%     customlatinfont = <(windows)|macos|gyre|none>
%   \end{syntax}
%
% 手动指定字体。
% \end{function}
%
%
% 根据学校论文格式的要求,本模板使用的中文字体主要有{\songti 宋体}、{\heiti 黑体}、{\kaishu 楷体}、{\fangsong 仿宋}四种;
% 西文字体主要有衬线体(\textup{serif})、无衬线体(\textsf{sans-serif})和等宽字体(\texttt{monospace})三种。
% 在生成论文时,需要将每一种字体(宋体、楷体)与一种字库(操作系统中的 ttf 文件)相对应。
% 由于不同操作系统自带的字库不同,在不同的操作系统上使用同一套配置会导致缺字、编译出错等后果。
% 因此,本模板对于中文字体和西文字体都提供了多种字体配置。
%
% 本模板提供的中文字体配置如表 \ref{tab:chinesefontset} 所示。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
% (见表中前三行,Windows 和 macOS 以外的系统采用 Fandol 配置)。
% 此外,我们也单独提供了方正和思源两套中文字体配置。
%
% \begin{table}[htbp]
%   \centering
%   \begin{talltblr}[
%   caption = {中文字体配置列表},
%   label = {tab:chinesefontset},
%   note{a} = {使用
%     \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}{方正小标宋}
%     作为方正书宋的粗体,使用
%     \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}{方正黑体}
%     作为方正细黑一的粗体},
%   note{b} = {思源字体并不包含楷书和仿宋,而Adobe楷体和仿宋难以直接下载,
%     因此使用方正字体代替;考虑到获取字体的难易程度,采用
%     \href{https://www.google.com/get/noto}{noto} 字体表示思源字体},
%   ] { cell{2}{2,4} = {njuyellow}, cell{4}{4} = {njuyellow}, colspec = {ccccc} }
%   \toprule
%   配置名称   & 宋体        & 黑体        & 楷书        & 仿宋 \\
%   \midrule
%   Windows    & 中易宋体    & 中易黑体    & 中易楷体    & 中易仿宋 \\
%   macOS      & 华文宋体    & 华文黑体    & 华文楷体    & 华文仿宋 \\
%   \href{https://www.ctan.org/pkg/fandol} {Fandol}           
%              & Fandol宋体  & Fandol黑体  & Fandol楷体  & Fandol仿宋 \\
%   \href{https://www.foundertype.com}     {方正}\TblrNote{a} 
%   & \href{http://www.foundertype.com/index.php/FontInfo/index/id/151}{方正书宋}
%   & \href{http://www.foundertype.com/index.php/FontInfo/index/id/161}{方正细黑一}
%   & \href{http://www.foundertype.com/index.php/FontInfo/index/id/137}{方正楷体}
%   & \href{http://www.foundertype.com/index.php/FontInfo/index/id/128}{方正仿宋} \\
%   \href{https://github.com/adobe-fonts}  {思源}\TblrNote{b} 
%   & \href{https://fonts.google.com/noto/specimen/Noto+Serif+SC}{思源宋体}
%   & \href{https://fonts.google.com/noto/specimen/Noto+Sans+SC}{思源黑体}
%                                          & 方正楷体    & 方正仿宋 \\
%   \bottomrule
%   \end{talltblr}
% \end{table}
%
% 由于各操作系统对自带字体的支持程度不同,本模板对不同字体加粗的方式有所差别,
% 表 \ref{tab:chinesefontset} 中,黄色底色的字体采用算法加粗。
% 除此以外,各种字体在设计上也存在差异,因此本模板在不同操作系统下编译的结果可能存在细微不同,使用时请注意。
% 若想要获得与 Word 版本模板最为贴近的体验,
% 可以通过手动安装 Windows 自带的中易宋体、中易黑体、中易楷体和中易仿宋,并设置使用 Windows 字体来实现。
%
% 本模板提供的西文字体配置如表 \ref{tab:latinfontset} 所示。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置
% (见表中前三行,Windows 和 macOS 以外的系统采用 \opt{gyre} 配置)。
%
% \begin{table}[htbp]
%   \centering
%   \caption{西文字体清单}
%   \label{tab:latinfontset}
%   \begin{tabular}{cccc}
%       \toprule
%       配置名称 & 衬线体 & 无衬线体 & 等宽字体 \\
%       \midrule
%       Windows  & Times~New~Roman           & Arial                   & Courier~New \\
%       macOS    & Times~New~Roman           & Arial                   & Menlo \\
%       \href{http://www.gust.org.pl/projects/e-foundry/tex-gyre}{gyre} 
%                & \Hologo{TeX}~Gyre~Termes  & \Hologo{TeX}~Gyre~Heros & \Hologo{TeX}~Gyre~Cursor \\
%       \bottomrule
%   \end{tabular}
% \end{table}
%
% 若要手动选择字体,则需将字体设置为 \opt{none},再通过 \pkg{fontspec} 宏包或 \pkg{ctex} 宏包中给出的命令来实现。
%
% 最后,出于统一格式的需要,本模板还选取了与正文字体相似度最高的数学字体(\href{https://github.com/aliftype/xits}{XITS 字体})用于公式排版。
%
% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、两种思源字体和四种Fandol字体能够\emph{免费商用};
% 英文字库中只有 Times New Roman、XITS 和三种\Hologo{TeX} Gyre字体能够\emph{免费商用}。
% 因此,若需要将本模板用于商业相关的活动,请咨询专业人士。
%
% \subsection{个人信息}
%
% \begin{function}[updated=2021-10-01]{\njusetup}
%   \begin{syntax}
%     \tn{njusetup}\Arg{键值列表}
%   \end{syntax}
% 
%
% 以下为各项个人信息,其中带星号的为对应的英文名称。
% 有空格的内容需要将空格替换为波浪线或者两端加上大括号,不需要的项目不填即可。
%
% \end{function}
%
% \begin{function}{info/titlea,info/titleb,info/titlec,info/title*}
%   \begin{syntax}
%     titlea = \Arg{第一行标题}
%     titleb = \Arg{第二行标题}
%     titlec = \Arg{第三行标题}
%     title* = \Arg{英文标题}
%   \end{syntax}
% 题目。由于封面上提供给中文题目的横线长度有限(单行最长为15个汉字),这里将中文题目进行手动拆分,请自行选择合适的断行处。如果题目较短不需要二三行,留空即可。
% \end{function}
%
% \begin{function}{info/keywords,info/keywords*}
%   \begin{syntax}
%     keywords = \Arg{关键词}
%     keywords* = \Arg{英文关键词}
%   \end{syntax}
% 关键词列表。关键词之间需要使用英文半角逗号隔开,含有空格的关键字需要使用花括号包裹以避免歧义。可以参照示例模板中的填写方式。
% \end{function}
%
% \begin{function}{info/grade}
%   \begin{syntax}
%     grade = \Arg{20XX}
%   \end{syntax}
% 年级,推荐格式为“20XX”。
% \end{function}
%
% \begin{function}{info/student-id}
%   \begin{syntax}
%     student-id = \Arg{学号}
%   \end{syntax}
% 学号。南京大学本科生为9位数字学号,研究生为两位大写字母标识加上八位数字组成的学号。
% \end{function}
%
% \begin{function}{info/author,info/author*}
%   \begin{syntax}
%     author = \Arg{你的名字}
%     author* = \Arg{姓名拼音}
%   \end{syntax}
% 姓名。
% \end{function}
% 
% \begin{function}{info/department,info/department*}
%   \begin{syntax}
%     department = \Arg{院系}
%     department* = \Arg{院系}
%   \end{syntax}
% 院系。
% \end{function}
% 
% \begin{function}{info/major,info/major*}
%   \begin{syntax}
%     major = \Arg{专业}
%     major* = \Arg{专业}
%   \end{syntax}
% 专业。
% \end{function}
% 
% \begin{function}{info/field,info/field*}
%   \begin{syntax}
%     field = \Arg{方向}
%     field* = \Arg{方向}
%   \end{syntax}
% 研究领域。只有研究生有研究领域的说法。
% \end{function}
%  
% \begin{function}{info/supervisora,info/supervisora*,info/supervisora-title,info/supervisora-title*}
%   \begin{syntax}
%     supervisora = \Arg{导师}
%     supervisora* = \Arg{导师}
%     supervisora-title = \Arg{导师职称}
%     supervisora-title* = \Arg{导师职称}
%   \end{syntax}
% 导师,如果有第二导师,填写第二导师时将A替换为B即可。
% \end{function}
%
%
% \begin{function}{info/submit-date,info/submit-date*}
%   \begin{syntax}
%     submit-date = \Arg{提交日期}
%     submit-date* = \Arg{提交日期}
%   \end{syntax}
% 提交日期。
% \end{function}
%
% \begin{function}{info/defend-date,info/chairman,info/reviewer}
%   \begin{syntax}
%     defend-date = \Arg{答辩日期}
%     chairman = \Arg{答辩主席}
%     reviewer = \Arg{评委姓名职称}
%   \end{syntax}
% 答辩相关的内容,只对研究生有效,包括答辩日期,评审委员会主席及四位成员的姓名加职称。其中,四位评审成员是以列表的形式存储的,填写方法同关键词。
% \end{function}
%
% \begin{function}{info/clc,info/secret-level,info/udc,info/supervisor-contact}
%   \begin{syntax}
%     clc = \Arg{中图分类号}
%     secret-level = <不涉密|秘密|机密|绝密>
%     udc = \Arg{udc}
%     supervisor-contact = \Arg{导师联系方式}
%   \end{syntax}
% 国家图书馆封面相关,包括中图分类号、密级、udc和导师联系方式。
% \end{function}
%
% \subsubsection{输入示范}
%
% 本科生可以参考如下列表输入个人信息。注意不能有空行。
%
% \begin{ctexexam}
%   \njusetup {
%       info = {
%           titlea = 第一行标题,
%           titleb = 第二行标题,
%           title* = {My title in English}, 
%           keywords = {我,就是,充数的,关键词},
%           keywords* = {Dummy,Keywords,Here,{it is}},
%           grade = 2018,
%           student-id = 189114514,
%           author = 周煜华,
%           author* = Zhou~Yuhua,
%           department = 拉太赫科学与技术学院,
%           department* = School~of~\hologo{LaTeX},
%           major = 拉太赫语言学,
%           major* = \hologo{LaTeX}~Linguistics,
%           supervisora = 李成殿,
%           supervisora*= Li~Chengdian,
%           supervisora-title = 教授,
%           supervisora-title* = Professor,
%           supervisorb = 孙赫弥,
%           supervisorb* = Sun~Hemi,
%           supervisorb-title = 副教授,
%           supervisorb-title* = Associate professor,
%           submit-date = 2021年8月10日,
%       }
%   }
% \end{ctexexam}
%
% 研究生可以参考如下列表输入个人信息
%
% \begin{ctexexam}
%   \njusetup {
%       info = {
%           titlea = 第一行标题,
%           titleb = 第二行标题,
%           titlec = 第三行标题,
%           title* = {My title in English}, 
%           keywords = {我,就是,充数的,关键词},
%           keywords* = {Dummy,Keywords,Here,{it is}},
%           grade = 2018,
%           student-id = dz18114514,
%           author = 周煜华,
%           author* = Zhou~Yuhua,
%           department = 拉太赫科学与技术学院,
%           department* = School~of~\hologo{LaTeX},
%           major = 拉太赫语言学,
%           major* = \hologo{LaTeX}~Linguistics,
%           field = 拉太赫语言在现当代的使用, 
%           field* = Contemporary~Usage~of~the~\hologo{LaTeX}~Language, 
%           supervisora = 李成殿,
%           supervisora*= Li~Chengdian,
%           supervisora-title = 教授,
%           supervisora-title* = Professor,
%           submit-date = 2021年8月10日,
%           submit-date* = {Aug 10, 2021}, 
%           defend-date = 2021年9月19日,
%           chairman = 张晓山~教授,
%           reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授},
%           clc = 0175.2,
%           secret-level = 限制,
%           udc = 004.72,
%           supervisor-contact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514},
%       }
%   }
% \end{ctexexam}
%
%
%
% \subsection{编写正文}
%
% 与导言区相对的是正文,位于\env{document}环境内。
% 
% \begin{ctexexam}
%   \begin{document}
%     text
%   \end{document}
% \end{ctexexam}
%
% 加上空行就可以另起一段。
%
% 
% 在页面布局方面,本科生无页眉,页面编号居中位于页脚;研究生无页脚,页眉包括章节名和页面编号(尚未确定)。
%
% \subsubsection{文字}
%
% \begin{function}[added=2021-09-22]{\njuline}
%   \begin{syntax}
%     \tn{njuline}\Arg{文字}
%   \end{syntax}
%
% 为了避免原生\tn{uline}命令在中文环境下不能正常换行的问题,本模板使用\tn{njuline}作为替代方案,分别对\hologo{XeLaTeX} 的\pkg{xeCJKfntef}包和\hologo{LuaLaTeX}的\pkg{lua-ul}包中的下划线命令进行了包装。
% \end{function}
%
% \begin{function}{\footnote}
%   \begin{syntax}
%     \tn{footnote}\Arg{脚注}
%   \end{syntax}
%
% 添加脚注
% \end{function}
%
% 
%  \subsubsection{图片}
%
% \begin{function}{\graphicspath}
%   \begin{syntax}
%     \tn{graphicspath}\{\marg{路径1}\marg{路径2}\}
%   \end{syntax}
% 使用自己的图片时,需要在导言区通过本命令添加图片存放路径,允许的文件名包括\file{*.jpg}, \file{*.png}, \file{*.pdf}, \file{*.eps}。
% \end{function}
%
%
% 下面这个例子展示了如何插入一张名称为\file{myfig.jpg},宽度占页面文字宽度一半的图片。注意标签命令\tn{label}必须放在图注命令\tn{caption}之后。
%
% \begin{ctexexam}
%   \begin{figure}[h]
%       \includegraphics[width=0.5\textwidth]{myfig}
%       \caption{我的图}
%       \label{fig:myfig}
%   \end{figure}
% \end{ctexexam}
%
% 
% 对于较为瘦长,或者仅起到辅助作用的图像,可以使用\env{wrapfigure}实现文字环绕效果。注意这个环境后紧跟的一行不能为空。
%
% \begin{ctexexam}
%   \begin{wrapfigure}{r}{0cm}
%       \includegraphics[width=0.15\textwidth]{myfig}
%       \caption{我的图}
%       \label{fig:myfig}
%   \end{wrapfigure}
%   <text>
% \end{ctexexam}
% 
% TODO:使用\pkg{subcaption}的\env{subfigure}实现多张图片并排的效果。较为老旧的\pkg{subfigure}并不在此受到支持。
%
% \begin{ctexexam}
%   \begin{figure}
%       \begin{subfigure}{.32\textwidth}
%          \centering
%          \includegraphics[width=\textwidth]{fig1}  
%          \caption{fig1}
%       \end{subfigure}
%       \begin{subfigure}{.32\textwidth}
%          \centering
%           \includegraphics[width=\textwidth]{fig2}  
%           \caption{fig2}
%       \end{subfigure}
%       \begin{subfigure}{.32\textwidth}
%           \centering
%           \includegraphics[width=\textwidth]{fig3}  
%           \caption{fig3}
%       \end{subfigure}
%       \caption{subfigures}
%   \end{figure}
% \end{ctexexam}
%
% \subsubsection{表格}
%
% 下面这个例子展示了如何插入一张表格。通过 \pkg{booktabs} 提供的 \tn{toprule}、\tn{midrule} 和 \tn{bottomrule},我们可以很轻松地绘制出一张漂亮规范的三线表。
% \begin{ctexexam}
%   \begin{table}[htbp]
%       \caption{我的表}
%       \label{tab:testtab}
%       \begin{tabular}{ccc}
%           \toprule
%           OS & TeX & 测试情况 \\
%           \midrule
%           南大TeX & Overleaf & √ \\
%           \bottomrule
%       \end{tabular}
%   \end{table}
% \end{ctexexam}
%
% \begin{function}{\multirow,\multicolumn}
%   \begin{syntax}
%     \tn{multirow}\Arg{nrows}\oarg{bigstructs}\Arg{width}[\oarg{fixup}\Arg{text}
%     \tn{multicolumn}\Arg{nrows}\Arg{width}\Arg{text}
%   \end{syntax}
%
% TODO:\pkg{multirow}\pkg{multicol}合并单元格
% \url{http://www.ctex.org/documents/packages/table/multirow.htm}
%
% \end{function}
%
% \subsubsection{代码}
%
% 由\pkg{listings}提供代码排版。代码块\env{lstlisting},注意这个环境中的缩进空格会如实输出
% \begin{ctexexam}
%   \begin{lstlisting}
%   <code>
%   \end{lstlisting}
% \end{ctexexam}
%
% 行间代码|\lstinline!<code>!|,其中包裹代码的两个感叹号并不是绝对的,可以替换成任何两个相同的没有在这段代码中出现过的符号。
%
%
% \subsubsection{数学}
%
% 符号表可以参考\url{https://www.caam.rice.edu/~heinken/latex/symbols.pdf}。单位请参考\pkg{siunitx}。\pkg{siunitx}是一个更新频繁的包,可能会引发兼容性问题。
%
% 行内公式形如|$\mathrm{e}^{(a+2b)x}$|
%
% 带有编号的行间公式\env{equation}
% \begin{ctexexam}
%   \begin{equation}\label{eq:myeqlabel}
%       \pi
%   \end{equation}
% \end{ctexexam}
%
% 如不需要编号,可以用\env{equation*}或者 |\[<eq>\]|
%
% 本模板也提供了一系列的数学环境。证明环境会在结尾添加证毕符号
% \begin{ctexexam}
%   \begin{proof}
%       证明我是我
%   \end{proof}
% \end{ctexexam}
%
% 普通环境
% \begin{ctexexam}
%   \begin{definition}[他人]
%       定义他人即地狱
%   \end{definition}
% \end{ctexexam}
% 
% 
% \subsubsection{引用}
% 
% \begin{function}{\cref}
%   \begin{syntax}
%     \tn{cref}\Arg{标签}
%   \end{syntax}
%
% 使用\pkg{cleveref}宏包实现了带图、表等项目名称的智能引用。
% 
% \end{function}
%
% \begin{function}{\href,\url}
%   \begin{syntax}
%     \tn{href}\Arg{链接}\Arg{名称}
%     \tn{url}\Arg{链接}
%   \end{syntax}
%
% 超链接。\tn{href}会将特定字符显示为可点击的超链接,\tn{url}会输出可点击的链接原文。
% 
% \end{function}
% 
% 
% \subsection{特殊页面}
% 
% 本模板还提供一系列环境用于生成所需的特殊页面
%
% \subsubsection{封面}
%
% \begin{function}{\maketitle}
%
% 用于生成封面。
% 本科生仅会生成中文封面;研究生会生成中英文封面。
% 如果选择了\opt{nlcover},也会生成研究生的国家图书馆封面。
% 
% \end{function}
%
%
% \subsubsection{摘要页}
% \changes{v0.11}{2021/10/01}{简化了摘要的编写方式。}
%
% 
% \begin{ctexexam}
%   \begin{abstract}
%       我的中文摘要
%   \end{abstract}
%
%   \begin{abstract*}
%       My abstract in English
%   \end{abstract*}
% \end{ctexexam}
%
%
% \subsubsection{前言页}
% 
% \begin{function}{preface}       
% 使用\env{preface}环境定义
% \end{function}
% 
% \begin{ctexexam}
%   \begin{preface}
%       我的前言
%       \vspace{1cm}
%       \begin{flushright}
%       我的名字\\
%       时间地点
%       \end{flushright}
%   \end{preface}
% \end{ctexexam}
%
% \subsubsection{目录页}
%
% \begin{function}{\tableofcontents,\listoffigures,\listoftables}
%
% 分别生成目录、图片清单和表格清单。
% 
% \end{function}
% 
%
% \subsubsection{致谢页}
%
% \begin{function}{acknowledgement}
% 同前言,使用\env{acknowledgement}环境
% \end{function}
% 
% \begin{ctexexam}
%   \begin{acknowledgement}
%       感谢NJU LUG
%   \end{acknowledgement}
% \end{ctexexam}
%
% \subsubsection{参考文献页}
%
% 使用以下命令,\opt{bibintoc}可以将参考文献页插入目录
% 
% \begin{ctexexam}
%   \printbibliography[heading=bibintoc,title=参考文献]
% \end{ctexexam}
% 
% \subsubsection{附录页}
%
% \begin{function}{\appendix}
%
% 附录放在本命令后,以英文字母进行编号,编写方式同正文
% \end{function}
%
% 是否需要索引?
% 
% 
% \subsubsection{成果列表}
%
% \begin{function}{\njupaperlist,\njupaperlist*}
%   \begin{syntax}
%     \tn{njupaperlist}\Arg{文献}
%   \end{syntax}
% 成果列表,分别为发表文章目录与合作文章目录。\Arg{文献}的填写方式同\tn{cite},多个文献需要使用英文半角逗号隔开。
% \end{function}
%
% \subsection{参考文献}
%
% 符合GB7714-2015规范。使用\hologo{biber}作为\hologo{BibTeX}后端。需要使用|biber|命令手动编译才会显示
%
% \begin{function}{\addbibresource}
%   \begin{syntax}
%     \tn{addbibresource}\Arg{文件}
%   \end{syntax}
%
% 默认参考文献存储于主目录下的\file{njuthesis.bib},直接向其中粘贴新的参考文献即可。如果希望额外添加参考文献列表,可以在导言区中多次调用\tn{addbibresource}命令。注意本命令与|\bibliography{bibfile1,bibfile2}|不同,不可以用逗号分隔多个输入文件,且必须使用带扩展名的完整文件名。
% \end{function}
%
% 
% \subsubsection{使用EndNote}
%
% 南京大学信息化建设管理服务中心已购买\href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote}供全校师生免费试用,最新版为EndNote 20。
%
%
% \subsubsection{使用Zotero}
%
% \href{https://www.zotero.org/}{Zotero}是一款免费的文献管理软件,支持所有桌面平台。
%
% 在保持Zotero程序运行的情况下,点击浏览器工具栏的Zotero Connector插件即可自动从网页抓取参考文件信息。Zotero可以通过\href{https://github.com/l0o0/jasminum}{jasminum插件}支持中文参考文献的识别。在选中希望使用的文献后右键导出文献条目即可生成\file{.bib}文件。
%
% \subsubsection{文段内引用}
%
% \begin{function}{\cite,\citeauthor,\citeyear}
%   \begin{syntax}
%     \tn{cite}\Arg{文献}
%     \tn{citeauthor}\Arg{文献}
%     \tn{citeyear}\Arg{文献}
%   \end{syntax}
% 引用文献
% \end{function}
%
% \subsection{视觉识别系统}
%
% 视觉识别系统 \pkg{njuvisual} 现已被分离为独立宏包,基本使用方法举例如下:
% \begin{ctexexam}
%   \njuemblem{!}{3cm}                           % 默认生成指定大小的紫色南大校徽
%   \njuname{4cm}{!}                             % 默认生成指定大小的紫色南大中文校名
%   \njuname*{4cm}{!}                            % 默认生成指定大小的紫色南大英文校名
%   \njuemblem[black]{!}{3cm}                    % 黑色的南大校徽
%   \njuemblem[department=dii]{!}{4cm}           % 紫色匡院徽标
%   \njuemblem[department=cs,color=blue]{!}{3cm} % 纯蓝色计科徽标
% \end{ctexexam}
%
% 本宏包的详细使用方法请参考其\href{http://mirrors.ctan.org/macros/latex/contrib/njuvisual/njuvisual.pdf}{说明文档}。
%
% \end{documentation}
%
% \begin{implementation}
%
% \section{代码实现}
% \changes{v0.10}{2021/09/26}{对代码实现部分进行了整理。}
%
% 本模板使用 \hologo{LaTeX3} 语法编写,依赖 \pkg{expl3} 环境,
% 并需调用 \pkg{l3packages} 中的相关宏包。
%
% 以下代码中有一些形如 |<*class>|
% 的标记,这是 \pkg{DocStrip} 中的“guard”,用来选择性地提取文件。
% “|*|”和“|/|”分别表示该部分的开始和结束。不含
% “|*|”和“|/|”的 guard 出现在行号右侧,它们用来确定
% 单独一行代码的归属。这些 guard 的颜色深浅不一,用以明确嵌套关系。
%
% 另有若干包含|@@|的guard,在 \pkg{l3docstrip} 中表示名空间(模块)。
% 在删除注释生成格式文件时,变量名称中的|@@|会被等号后的字段替换,
% 譬如在本模板\cls{njuthesis}中 |@@=nju|。
%
% \subsection{准备}
%
%    \begin{macrocode}
%<*class>
%<@@=nju>
%    \end{macrocode}
%
% \changes{v0.11}{2021/10/23}{添加了若干环境检查与警告信息。}
% 检查 \hologo{LaTeX3} 编程环境。
%    \begin{macrocode}
\RequirePackage { xtemplate, l3keys2e }
\msg_new:nnn { njuthesis } { l3-too-old }
  {
    Package~ "#1"~ is~ too~ old. \\\\
    Please~ update~ an~ up-to-date~ version~ of~ \\
    the~ bundles "l3kernel"~ and~ "l3packages"~ \\
    using~ your~ TeX~ package manager~ or~ from~ \\
    CTAN.
  }
\clist_map_inline:nn { xtemplate, l3keys2e }
  {
    \@ifpackagelater {#1} { 2021/08/27 }
      { } { \msg_error:nnn { njuthesis } { l3-too-old } {#1} }
  }

%    \end{macrocode}
%
% 目前 \cls{njuthesis} 仅支持 \hologo{XeTeX} 和 \hologo{LuaTeX}。
%    \begin{macrocode}
\msg_new:nnn { njuthesis } { unsupported-engine }
  {
    The~ njuthesis~ class~ requires~ either~ \\
    XeTeX~ or~ LuaTeX. \\\\
    "#1"~ is~ not~ supported~ at~ present.~ \\
    You~ must~ change your~ typesetting~ engine~ \\
    to~ "xelatex"~ or~ "lualatex".
  }
\sys_if_engine_xetex:F
  {
    \sys_if_engine_luatex:F
      {
        \msg_fatal:nnx { njuthesis } { unsupported-engine }
          { \c_sys_engine_str }
      }
  }
%    \end{macrocode}
%
% \subsection{定义常量}
%
% \begin{variable}{\c_@@_name_type_clist,
%   \c_@@_name_degree_clist,\c_@@_name_degree_en_clist}
% 论文类型与学位类型。
%    \begin{macrocode}
\clist_const:Nn \c_@@_name_type_clist
  { 毕业论文, 毕业设计 }
\clist_const:Nn \c_@@_name_degree_clist
  { 学士, 硕士, 硕士专业, 博士 }
\clist_const:Nn \c_@@_name_degree_en_clist
  { Bachelor, Master, Master, Doctor~of~Philosophy }
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}{\@@_define_name:nn,\@@_define_name:nnn}
% 用来定义默认名称的辅助函数。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_define_name:nn #1#2
  { \tl_const:cn { c_@@_name_ #1 _tl } {#2} }
\cs_new_protected:Npn \@@_define_name:nnn #1#2#3
  {
    \tl_const:cn { c_@@_name_ #1    _tl } {#2}
    \tl_const:cn { c_@@_name_ #1 _en_tl } {#3}
  }
%    \end{macrocode}
% \end{macro}
%
% 默认名称。注意空格是忽略掉的。
%    \begin{macrocode}
\clist_map_inline:nn
  {
    { pdf_creator     } { LaTeX~ with~ njuthesis~ class },
  }
  { \@@_define_name:nn #1 }
\clist_map_inline:nn
  {
    { keywords } { 关键词:    } { Keywords:         },
  }
  { \@@_define_name:nnn #1 }
%    \end{macrocode}
%
% \subsection{模板选项}
% \changes{v0.11}{2021/11/15}{进行了效率优化。}
%
% \begin{variable}{\g_@@_info_degree_int,\g_@@_info_type_int,
%   \g_@@_info_diploma_tl}
% 用于存储学位名称的变量,注意宏的命名,l代表局部变量,g代表全局变量
%    \begin{macrocode}
\int_new:N \g_@@_info_degree_int
\int_new:N \g_@@_info_type_int
\tl_new:N \g_@@_info_diploma_tl
%    \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_latin_fontset_tl,\g_@@_cjk_fontset_tl}
% 用于存储所使用字体名称的全局变量
%    \begin{macrocode}
\tl_new:N \g_@@_latin_fontset_tl
\tl_new:N \g_@@_cjk_fontset_tl
%    \end{macrocode}
% \end{variable}
%
% 学位信息的设置
%    \begin{macrocode}
\keys_define:nn { nju }
{
%    \end{macrocode}
%
% \begin{macro}{degree}
% 学位类型。
%    \begin{macrocode}
  degree            .choices:nn   =
  { ug, mg, mf, phd }
  { \int_set_eq:NN \g_@@_info_degree_int \l_keys_choice_int },  
  degree            .initial:n    =   ug,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{type}
% 论文类型。
%    \begin{macrocode}
  type              .choices:nn   =
  { thesis, design }
  { \int_set_eq:NN \g_@@_info_type_int   \l_keys_choice_int }, 
  type              .initial:n    =   thesis,
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{nlcover}
% 是否需要国家图书馆封面的设置。
%    \begin{macrocode}
  nlcover           .bool_set:N   =   \g_@@_nlcover_bool,
  nlcover           .initial:n    =   false,
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{customlatinfont,customchinesefont}
% 定义字体选项
%    \begin{macrocode}
  customlatinfont   .choices:nn   =
  { gyre, macos, windows, none }
  { \tl_set_eq:NN \g_@@_latin_fontset_tl \l_keys_choice_tl },  
  customchinesefont .choices:nn   =
  { fandol, founder, macos, noto, windows, none }
  { \tl_set_eq:NN \g_@@_cjk_fontset_tl   \l_keys_choice_tl },
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ProcessKeysOptions}
% 在定义完全部设置以后从tex文件导言区输入参数。
%    \begin{macrocode}
\ProcessKeysOptions { nju }
%    \end{macrocode}
% \end{macro}
%
% 进行学位的判断。
%    \begin{macrocode}
\int_compare:nTF { \g_@@_info_degree_int == 1 }
  { \tl_set:Nn \g_@@_info_diploma_tl { ug } }
  { \tl_set:Nn \g_@@_info_diploma_tl { g } }
%    \end{macrocode}
% 
%
%
% \subsection{个人信息}
% 输入个人信息的区域。
%    \begin{macrocode}
\keys_define:nn { nju }
{
  info.meta:nn = { nju / info } { #1 }
}
%    \end{macrocode}
%
%    \begin{macrocode}
\keys_define:nn { nju / info }
{
%    \end{macrocode}
%
% \begin{macro}{info/titlea,info/titleb,info/titlec,info/title*}
% 题目。以下标注星号(*)的为对应的英文字段。
%    \begin{macrocode}
  titlea            .tl_set:N = \l_@@_info_title_a_tl,
  titleb            .tl_set:N = \l_@@_info_title_b_tl,
  titlec            .tl_set:N = \l_@@_info_title_c_tl,
  title*            .tl_set:N = \l_@@_info_title_en_tl,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/keywords,info/keywords*}
% \changes{v0.11}{2021/10/01}{修改了添加关键词的方式。}
% 关键词列表。
%    \begin{macrocode}
keywords         .clist_set:N = \l_@@_info_keywords_clist,
keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{info/grade,info/student-id,info/author,info/author*}
% 年级、学号、姓名。
%    \begin{macrocode}
  grade             .tl_set:N = \l_@@_info_grade_tl,
  student-id        .tl_set:N = \l_@@_info_id_tl,
  author            .tl_set:N = \l_@@_info_author_tl,
  author*           .tl_set:N = \l_@@_info_author_en_tl,
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{info/department,info/department*,info/major,info/major*,info/field,info/field*}
% 院系、专业、方向。
%    \begin{macrocode}
  department        .tl_set:N = \l_@@_info_dept_tl,
  department*       .tl_set:N = \l_@@_info_dept_en_tl,
  major             .tl_set:N = \l_@@_major_tl,
  major*            .tl_set:N = \l_@@_major_en_tl,
  field             .tl_set:N = \l_@@_field_tl,
  field*            .tl_set:N = \l_@@_field_en_tl,
%    \end{macrocode}
% \end{macro}
%  
% \begin{macro}{info/supervisora,info/supervisora*,info/supervisora-title,info/supervisora-title*}
% 导师
%    \begin{macrocode}
  supervisora       .tl_set:N = \l_@@_info_supv_a_tl,
  supervisora*      .tl_set:N = \l_@@_info_supv_a_en_tl,
  supervisora-title .tl_set:N = \l_@@_info_supv_a_title_tl,
  supervisora-title*.tl_set:N = \l_@@_info_supv_a_title_en_tl,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/supervisorb,info/supervisorb*,info/supervisorb-title,info/supervisorb-title*}
% 第二导师
%    \begin{macrocode}
  supervisorb       .tl_set:N = \l_@@_info_supv_b_tl,
  supervisorb*      .tl_set:N = \l_@@_info_supv_b_en_tl,
  supervisorb-title .tl_set:N = \l_@@_info_supv_b_title_tl,
  supervisorb-title*.tl_set:N = \l_@@_info_supv_b_title_en_tl,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/submit-date,info/submit-date*}
% 提交日期
%    \begin{macrocode}
  submit-date       .tl_set:N = \l_@@_submit_date_tl,
  submit-date*      .tl_set:N = \l_@@_submit_date_en_tl,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/defend-date,info/chairman,info/reviewer}
% 答辩信息。
%    \begin{macrocode}
  defend-date       .tl_set:N = \l_@@_defend_date_tl,
  chairman          .tl_set:N = \l_@@_info_chairman_tl,
  reviewer       .clist_set:N = \l_@@_info_reviewer_clist,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/clc,info/secret-level,info/udc,info/supervisor-contact}
% 国家图书馆封面相关信息。
%    \begin{macrocode}
  clc               .tl_set:N = \l_@@_info_clc_tl,
  secret-level      .tl_set:N = \l_@@_info_seclv_tl,
  udc               .tl_set:N = \l_@@_info_udc_tl,
  supervisor-contact.tl_set:N = \l_@@_info_supv_cont_tl,
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\njusetup}
% \changes{v0.6}{2021/09/10}{改用键值对输入信息。}
% \changes{v0.11}{2021/10/01}{将个人信息变量名改为小写字母加连字符的形式。}
% 定义用于设置个人信息的命令
%    \begin{macrocode}
\NewDocumentCommand \njusetup { m }
{ \keys_set:nn { nju } { #1 } }
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{载入宏包}
% 
% 使用\pkg{ctexbook}作为基础文档类。
%    \begin{macrocode}
\LoadClass[
  a4paper,
  twoside,
  UTF8,
  scheme=chinese,
%    \end{macrocode}
% 关于行距,\hologo{LaTeX}默认1.2行距,word默认行距是1.3,要求1.5倍word行距,故
% $1.5\times\frac{1.3}{1.2} = 1.625$
%    \begin{macrocode}
  linespread=1.625,
%    \end{macrocode}
% 默认不载入任何字体,供模板自行设置
%    \begin{macrocode}
  fontset=none,
  zihao=-4
  ]{ctexbook}[2018/04/01]
%    \end{macrocode}
%
% 载入各种宏包。
% \pkg{emptypage}用于清除空白页的页码。
%    \begin{macrocode}
\RequirePackage
{
  geometry,
  caption,
  floatrow,
  setspace,
  lastpage,
  emptypage,
  fancyhdr,
}
\RequirePackage[titles]{tocloft}
\RequirePackage[hyphens]{url} % generate better linebreaks in the url
%    \end{macrocode}
%
%
% 用于特定学科的包。
%    \begin{macrocode}
\RequirePackage{siunitx} % 用于书写单位符号
\RequirePackage[version=4]{mhchem} % 用于绘制分子式
%    \end{macrocode}
%
% 用于生成可以被插入书签的LaTeX logo,TODO: 使用hologo创建|latex{}|命令
%    \begin{macrocode}
\RequirePackage{hologo} 
%    \end{macrocode}
%
%    \begin{macrocode}
% Required to prevent page break right after a sectioning command
% \RequirePackage{needspace} 
% \RequirePackage{xspace} % Better print trailing whitespace
%    \end{macrocode}
%
% \begin{macro}{\njuline}
% 针对编译引擎,使用不同的宏包构建可以对中文正常换行的下划线命令。\pkg{lua-ul}中需要在结尾使用\tn{null}保护尾部空白。
%    \begin{macrocode}
\sys_if_engine_xetex:T
{
    \RequirePackage{xeCJKfntef,microtype}
    \newcommand{\njuline}[1]{\CJKunderline{#1}}
}
\sys_if_engine_luatex:T
{
    \RequirePackage{lua-ul,dashundergaps}
    \newcommand{\njuline}[1]{\underLine{#1}\null}
}
%    \end{macrocode}
% \end{macro}
%
% 数学,\pkg{amsmath}必须在\pkg{unicode-math}前加载。
% \pkg{unicode-math}指定了\hologo{XeTeX}和\hologo{LuaTeX}下所使用的数学字体。
% 用于配置数学环境的\pkg{mathtools}会与\pkg{unicode-math}发生冲突,此处手动消除其警告。
%    \begin{macrocode}
\RequirePackage{amsmath,amsthm,mathtools,thmtools}
\RequirePackage[
    warnings-off={
        mathtools-colon,
        mathtools-overbracket}
        ]{unicode-math}
%    \end{macrocode}
%
% 配置图片、表格、代码、列表环境
%    \begin{macrocode}
\RequirePackage{graphicx,subcaption,wrapfig,tikz}
\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png}
\RequirePackage{booktabs,multirow,multicol,listings,enumitem}
%    \end{macrocode}
%
% 必须以该顺序加载以下两个关于引用的包。
%    \begin{macrocode}
\RequirePackage[hidelinks,bookmarksnumbered=true]{hyperref}
\RequirePackage[capitalise,nameinlink,noabbrev]{cleveref}
%    \end{macrocode}
%
% 载入南京大学识别视觉系统。
%    \begin{macrocode}
\RequirePackage{njuvisual}
%    \end{macrocode}
% 
% 生成用于测试的大段填充文字。
%    \begin{macrocode}
\RequirePackage{blindtext,zhlipsum} 
%    \end{macrocode}
%
% \begin{macro}{\@@_check_package:nnn}
% 检查过时宏包。
%    \begin{macrocode}
\msg_new:nnn { njuthesis } { package-too-old }
  {
    Package~ "#1"~ is~ too~ old. \\
    The~ njuthesis~ class~ only~ supports~ "#1"~ with~  \\
    a~ version higher~ than~ v#2. \\\\
    Please~ update~ an~ up-to-date~ version~ of~ it~ \\
    using~ your TeX~ package~ manager~ or~ from~ CTAN.
  }
\cs_new_protected:Npn \@@_check_package:nnn #1#2#3
  {
    \@ifpackagelater {#1} {#2}
      { } { \msg_error:nnnn { njuthesis } { package-too-old } {#1} {#3} }
  }
%    \end{macrocode}
% \end{macro}
%
% 检查绘制下划线所需的 \pkg{luatexja} 包版本。该宏包在2021-09-18的解决了下划线中断问题,然而在2021-10-24的更新才提供了正确的内嵌日期。
%    \begin{macrocode}
\sys_if_engine_luatex:T
  { \@@_check_package:nnn { luatexja } { 2021/10/24 } { 20211024.0 } }
%    \end{macrocode}
%
% \subsection{字体设置}
%
% \pkg{fontspec}已在C\hologo{TeX}套件中包含,无需另外载入。
%
% \subsubsection{操作系统检测}
%
% \begin{variable}{\g_@@_load_system_fontset_bool}
% 定义用于判断是否需要载入系统预装字体的变量。
%    \begin{macrocode}
\bool_new:N \g_@@_load_system_fontset_bool
%    \end{macrocode}
% \end{variable}
% 判断用户是否自定义了中英文字体。如果其中任意一种未被定义,
% 则使用系统预装字体覆盖字体选项。
%    \begin{macrocode}
\tl_if_empty:NTF \g_@@_latin_fontset_tl
  { \bool_gset_true:N \g_@@_load_system_fontset_bool }  
{  
  \tl_if_empty:NT \g_@@_cjk_fontset_tl
    { \bool_gset_true:N \g_@@_load_system_fontset_bool }  
}
%    \end{macrocode}
%
% 进行系统检测。
% 检测 Windows 的命令由\pkg{l3kernal}提供,
% 检测 macOS 的命令由\pkg{ctex}提供,
% 这两种情况外的系统被判断为 Linux,一律使用自由字体。
%    \begin{macrocode}
\bool_if:NT \g_@@_load_system_fontset_bool
{
  \sys_if_platform_windows:TF
  {
    \tl_set:Nn \g_@@_latin_fontset_tl { windows }
    \tl_set:Nn \g_@@_cjk_fontset_tl   { windows }
  }
  {
    \ctex_if_platform_macos:TF
    {
      \tl_set:Nn \g_@@_latin_fontset_tl { macos }
      \tl_set:Nn \g_@@_cjk_fontset_tl   { macos }
    }
    {
      \tl_set:Nn \g_@@_latin_fontset_tl { gyre }
      \tl_set:Nn \g_@@_cjk_fontset_tl { fandol }
    }
  }
}
%    \end{macrocode}
%
% \subsubsection{定义英文字库}
%
% 接下来逐个定义所需要使用的字库。
%
% \begin{macro}{\@@_load_latin_font_windows:}
% Windows 西文字体
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_latin_font_windows:
{
  \setmainfont{Times~New~Roman}
  \setsansfont{Arial}
  \setmonofont{Courier~New}[Scale=MatchLowercase]
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_load_latin_font_macos:}
% macOS 西文字体。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_latin_font_macos:
{
  \setmainfont{Times~New~Roman}
  \setsansfont{Arial}
  \setmonofont{Menlo}[Scale=MatchLowercase]
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_load_latin_font_gyre:}
% 开源的 gyre 西文字体。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_latin_font_gyre:
{
  \setmainfont{texgyretermes}[
    Extension=.otf,
    UprightFont=*-regular,
    BoldFont=*-bold,
    ItalicFont=*-italic,
    BoldItalicFont=*-bolditalic]
  \setsansfont{texgyreheros}[
    Extension=.otf,
    UprightFont=*-regular,
    BoldFont=*-bold,
    ItalicFont=*-italic,
    BoldItalicFont=*-bolditalic]
  \setmonofont{texgyrecursor}[
    Extension=.otf,
    UprightFont=*-regular,
    BoldFont=*-bold,
    ItalicFont=*-italic,
    BoldItalicFont=*-bolditalic,
    Scale=MatchLowercase,
    Ligatures=CommonOff]
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{定义中文字库}
%
% \begin{macro}{\@@_load_cjk_font_windows:}
% Windows 中文字体。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_cjk_font_windows:
{
  \setCJKmainfont{SimSun}[
    AutoFakeBold=2.17, 
    ItalicFont=KaiTi]
  \setCJKsansfont{SimHei}
  \setCJKmonofont{FangSong}
  \setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold=2.17]
  \setCJKfamilyfont{zhhei}{SimHei}
  \setCJKfamilyfont{zhfs}{FangSong}
  \setCJKfamilyfont{zhkai}{KaiTi}[AutoFakeBold=2.17]
  % \setCJKfamilyfont{zhnewhei}{Microsoft~YaHei}[
  %   BoldFont=Microsoft~YaHei~Bold]
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_load_cjk_font_macos:}
% macOS 字体。
% TODO: 参考CTeX手册第9节 LuaLATEX 下的中文支持方式解决 issue \#5 问题。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_cjk_font_macos:
{
  % 移除 does not contain script "CJK" 警告
  \msg_redirect_name:nnn {fontspec} {no-script} {info} 
  \setCJKmainfont{Songti~SC~Light}[
    BoldFont=Songti~SC~Bold,
    ItalicFont=Kaiti~SC,
    BoldItalicFont=Kaiti~SC~Bold]
  \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
  \setCJKmonofont{STFangsong}
  \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
  \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
  \setCJKfamilyfont{zhfs}{STFangsong}
  \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
  \setCJKfamilyfont{zhnewhei}{PingFang~SC}
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_load_cjk_font_fandol:}
% Fandol 字体
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_cjk_font_fandol:
{
  % 移除 does not contain script "CJK" 警告
  \msg_redirect_name:nnn {fontspec} {no-script} {info} 
  \setCJKmainfont{FandolSong-Regular}[
    Extension=.otf,
    BoldFont=FandolSong-Bold,
    ItalicFont=FandolKai-Regular]
  \setCJKsansfont{FandolHei-Regular}[
    Extension=.otf,
    BoldFont=FandolHei-Bold]
  \setCJKmonofont{FandolFang-Regular}[Extension=.otf]
  \setCJKfamilyfont{zhsong}{FandolSong-Regular}[
    Extension=.otf,
    BoldFont=FandolSong-Bold]
  \setCJKfamilyfont{zhhei}{FandolHei-Regular}[
    Extension=.otf,
    BoldFont=FandolHei-Bold]
  \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf]
  \setCJKfamilyfont{zhkai}{FandolKai-Regular}[
    Extension=.otf,
    AutoFakeBold=2.17]
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_load_cjk_font_founder:}
% 方正字库(简繁扩展)
% FZYouHK_508R \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑508R} 设计师非商免费,
% FZYouHK_511M \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑511M} 设计师非商免费
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_cjk_font_founder:
{
  \sys_if_engine_luatex:T
  {
    % 在 LuaTeX 中调整方正字体括号位置
    % XeTeX 暂无好的解决方法
    \defaultCJKfontfeatures{JFM={zh_CN/{quanjiao,fzpr}}}
  }
  \setCJKmainfont{FZSSK}[% 方正书宋
    Extension=.ttf,
    BoldFont=FZXBSK,% 方正小标宋
    ItalicFont=FZKTK]% 方正楷体
  \setCJKsansfont{FZXH1K}[% 方正细黑一
    Extension=.ttf,
    BoldFont=FZHTK]% FZHTK 方正黑体
  \setCJKmonofont{FZFSK}[Extension=.ttf]% 方正仿宋
  \setCJKfamilyfont{zhsong}
    {FZSSK}[
      Extension=.ttf,
      BoldFont=FZXBSK]
  \setCJKfamilyfont{zhhei}
    {FZHTK}[
      Extension=.ttf,
      AutoFakeBold=2.17]
  \setCJKfamilyfont{zhfs}
    {FZFSK}[Extension=.ttf]
  \setCJKfamilyfont{zhkai}
    {FZKTK}[Extension=.ttf]
  % \setCJKfamilyfont{zhnewhei}
  %   {FZYouHK_508R}[% 方正悠黑508R
  %     Extension=.ttf,
  %     BoldFont=FZYouHK_511M]% 方正悠黑511M
  \defaultCJKfontfeatures{}
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_load_cjk_font_noto:}
% 思源字体。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_cjk_font_noto:
{
  % 思源宋体
  \setCJKmainfont[
    UprightFont=NotoSerifSC-Regular,
    BoldFont=NotoSerifSC-Bold,
    ItalicFont=NotoSerifSC-Regular,
    BoldItalicFont=NotoSerifSC-Bold,
    ItalicFeatures=FakeSlant,
    BoldItalicFeatures=FakeSlant]{Noto~Serif~SC}

  % 思源黑体
  \setCJKsansfont[
    UprightFont=NotoSansSC-Regular,
    BoldFont=NotoSansSC-Bold,
    ItalicFont=NotoSansSC-Regular,
    BoldItalicFont=NotoSansSC-Bold,
    ItalicFeatures=FakeSlant,
    BoldItalicFeatures=FakeSlant]{Noto~Sans~SC}

  \setCJKmonofont{FZFSK}[Extension=.ttf]% 方正仿宋

  \setCJKfamilyfont{zhsong}{Noto~Serif~SC}
  \setCJKfamilyfont{zhhei}{Noto~Sans~SC}
  \setCJKfamilyfont{zhfs}
    {FZFSK}[Extension=.ttf]
  \setCJKfamilyfont{zhkai}
    {FZKTK}[Extension=.ttf]
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{载入指定字库}
%
% 载入字体命令。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_load_font:
{
  \use:c { @@_load_latin_font_ \g_@@_latin_fontset_tl : }
  \use:c { @@_load_cjk_font_   \g_@@_cjk_fontset_tl   : }
%    \end{macrocode}
% 自行定义C\hologo{TeX}中的四类字体命令。
%    \begin{macrocode}
  \NewDocumentCommand\songti{}{\CJKfamily{zhsong}}
  \NewDocumentCommand\heiti{}{\CJKfamily{zhhei}}
  \NewDocumentCommand\fangsong{}{\CJKfamily{zhfs}}
  \NewDocumentCommand\kaishu{}{\CJKfamily{zhkai}}
}
%    \end{macrocode}
%
% 载入设置的字体。
%    \begin{macrocode}
\@@_load_font:
%    \end{macrocode}
%
% \changes{v0.10}{2021/09/28}{修正了数学字体。}
%
% 设置数学字体 (XITS, 或者 \href{https://www.stixfonts.org}{STIX}, 与 Times New Roman 最为相近)
%    \begin{macrocode}
% \setmathfont{STIXTwoMath-Regular}[Extension = .otf]
\setmathfont{XITSMath-Regular}[
  BoldFont = XITSMath-Bold,
  Extension = .otf]
\setmathfont{latinmodern-math.otf}[range={cal,bb,frak}]
%    \end{macrocode}
%
%
% \subsection{页面布局}
%
% \subsubsection{页边距}
%
% 使用\pkg{geometry}设置页边距。
%    \begin{macrocode}
\geometry{
  vmargin    = 2.5 cm,
  hmargin    = 3.2 cm, 
  headheight = 15 pt
}
%    \end{macrocode}
%
% \subsubsection{页眉页脚}
%
% 
% 本科生页眉页脚。要求无页眉,页脚居中,页码使用五号新罗马体数字。
%    \begin{macrocode}
\fancypagestyle{njuplain}{
   \fancyhead{}               
   \fancyfoot[C]{\zihao{5}\thepage}
}
%    \end{macrocode}
%
% 
% TODO: 研究生页眉页脚 
%    \begin{macrocode}
\fancypagestyle{njuheadings}{%
   \fancyhead{}               
   \fancyfoot[C]{\zihao{5}\thepage}        
}
%    \end{macrocode}
%
% 载入页眉页脚设置。此处\tn{flushbottom}是为了防止目录页出现underfull \tn{vbox}信息。
%    \begin{macrocode}
\int_compare:nTF { \g_@@_info_degree_int == 1 } 
{
  % the header line
  \tl_set:Nn \headrulewidth {0pt}
  % the footer line
  \tl_set:Nn \footrulewidth {0pt}
  \AtBeginDocument{\pagestyle{njuplain}\flushbottom} % 本科无页眉页脚
}
{
  % the header line
  \tl_set:Nn \headrulewidth {1pt}
  % the footer line
  \tl_set:Nn \footrulewidth {0pt}
  \AtBeginDocument{\pagestyle{fancy}\flushbottom} % 研究生有页眉页脚
}
%    \end{macrocode}
%
% \subsection{章节标题格式}
% 
%    \begin{macrocode}
\ctexset{
    chapter/format = \zihao{4}\heiti\centering\selectfont,
    chapter/beforeskip = 10pt,
    chapter/afterskip = 60pt,
    section/format = \zihao{4}\heiti\raggedright\selectfont,
    subsection/format = \zihao{4}\heiti\raggedright\selectfont,
    subsubsection/format = \zihao{4}\heiti\raggedright\selectfont,
}
%    \end{macrocode}
%
% \subsection{目录格式}
% 设定目录标题名称。
%    \begin{macrocode}
\ctexset{
    contentsname = 目录,
    listfigurename = 插图清单, 
    listtablename = 表格清单,
}
%    \end{macrocode}
%
% 使用\pkg{tocloft}定制目录文字格式。
%    \begin{macrocode}
\cftsetpnumwidth{2em}
\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}
\renewcommand{\cftchapdotsep}{\cftdotsep}
\renewcommand{\cftchapfont}{\heiti\zihao{4}}
\setlength{\cftsecindent}{2em}
\setlength{\cftsubsecindent}{52pt}
\setlength{\cftsubsecnumwidth}{2em}
%    \end{macrocode}
%
% \begin{macro}{\tableofcontents}
  % 重定义目录命令,修改标题格式并插入书签。
%    \begin{macrocode}
\renewcommand\tableofcontents{%
  \cleardoublepage
  \raggedbottom
  \begingroup
    \ctexset{
      contentsname = {目\hspace{2em}录},
      chapter/format = {\centering\songti\bf\zihao{3}\selectfont},
    }%
    \chapter*{\contentsname}%
  \endgroup
  \addcontentsline{toc}{chapter}{\contentsname}
  \vskip 20pt 
  \@starttoc{toc}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\listoffigures}
% 重定义插图目录命令,修改标题格式并插入书签。
%    \begin{macrocode}
\renewcommand\listoffigures{%
  \cleardoublepage
  \begingroup
  \ctexset{
    chapter/format = {\centering\songti\bf\zihao{3}\selectfont},
  }%
  \chapter*{\listfigurename}%
  \endgroup
  \addcontentsline{toc}{chapter}{\listfigurename}
  \vskip 20pt 
  \@starttoc{lof}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\listoftables}
% 重定义表格目录命令,修改标题格式并插入书签。
%    \begin{macrocode}
\renewcommand\listoftables{%
  \cleardoublepage
  \begingroup
  \ctexset{
    chapter/format = {\centering\songti\bf\zihao{3}\selectfont},
  }%
  \chapter*{\listtablename}%
  \endgroup
  \addcontentsline{toc}{chapter}{\listtablename}
  \vskip 20pt 
  \@starttoc{lot}%
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{前言致谢}
% 
% \begin{environment}{preface}
% 单独制作的前言页。
%    \begin{macrocode}
\NewDocumentEnvironment{preface}{}
{%
  \chapter*{前言}
  \addcontentsline{toc}{chapter}{前言}
}{\cleardoublepage}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{acknowledgement}
% 单独制作的致谢页。
%    \begin{macrocode}
\NewDocumentEnvironment{acknowledgement}{}
{%
  \chapter*{致谢}
  \addcontentsline{toc}{chapter}{致谢}
}{\cleardoublepage}
%    \end{macrocode}
% \end{environment}
%
%
% \begin{macro}{\njupaperlist}
% \changes{v0.10}{2021/09/29}{新增了成果列表页面。}
% 发表文章目录与合作文章目录。
%    \begin{macrocode}
\NewDocumentCommand\njupaperlist { t* m }
{  
  \begin{refsection} 
    \nocite{#2}
    \IfBooleanTF {#1}
    { \printbibliography[heading=subbibliography,title=合作文章目录] }
    { \printbibliography[heading=subbibliography,title=发表文章目录] }
  \end{refsection}
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{参考文献}
% 
% biblatex设置
%    \begin{macrocode}
\RequirePackage[
    style=gb7714-2015,
    %style=numeric-comp,
    %citestyle=authortitle-icomp,
    % citestyle=numeric-comp,
    %bibstyle=authoryear,
    % bibstyle=numeric,
    sorting=none,
    %sorting=nyt,
    %sortcites=true,
    %autocite=footnote,
    backend=biber, % Compile the bibliography with biber
    hyperref=true,
    backref=false,
    citecounter=true,
    pagetracker=true,
    citetracker=true,
    ibidtracker=context,
    autopunct=true,
    autocite=plain,
    % gbpub=false,         % Uncomment if you do NOT want '[S.l. : s.n.]' 
                           % in reference entries, GitHub Issue (#47)
    % gbnamefmt=lowercase, % Uncomment if you do NOT want uppercase author 
                           % names in reference entries, GitHub Issue (#23)
]{biblatex}
%    \end{macrocode}
%
% 忽略不需要的文献信息。
%    \begin{macrocode}
\AtEveryBibitem{
	\clearfield{abstract}
	\clearfield{issn}
	\clearfield{isbn}
	\clearfield{archivePrefix}
	\clearfield{arxivId}
	\clearfield{pmid}
	\clearfield{eprint}
	\ifentrytype{online}{}{\ifentrytype{misc}{}{\clearfield{url}}}
	% \ifentrytype{book}{\clearfield{doi}}{}
}
%    \end{macrocode}
%
% \subsection{引用}
% 
% 修改标签名称。默认在名称后面添加空格,删除公式编号的括号
%    \begin{macrocode}
\crefdefaultlabelformat{#2#1#3\,}

\crefname{figure}{图}{图}
\crefname{table}{表}{表}
% \crefname{equation}{公式}{公式}
\crefformat{equation}{公式~#2#1#3~}

\crefformat{chapter}{第#2#1#3章}
\crefformat{section}{第~#2#1#3~节}
\crefformat{subsection}{第~#2#1#3~小节}
\crefformat{subsubsection}{第~#2#1#3~小节}
\crefname{appendix}{附录}{附录}

% \crefname{definition}{定义}{定义}
% \crefname{axiom}{公理}{公理}
% \crefname{property}{性质}{性质}
% \crefname{proposition}{命题}{命题}
% \crefname{lemma}{引理}{引理}
% \crefname{corollary}{推论}{推论}
% \crefname{remark}{注解}{注解}
% \crefname{condition}{条件}{条件}
% \crefname{conclusion}{结论}{结论}
% \crefname{assumption}{假设}{假设}
%    \end{macrocode}
%
% \pkg{hyperref} 
% \changes{v0.11}{2021/10/01}{写入PDF元数据。}
%    \begin{macrocode}
\ctex_at_end_preamble:n
{
  \hypersetup
    {
      bookmarksnumbered = true,
      psdextra          = true,
      unicode           = true,
%    \end{macrocode}
% 填写 PDF 元信息。
%    \begin{macrocode}
      pdftitle    = \l_@@_info_title_tl,
      pdfauthor   = \l_@@_info_author_tl,
      pdfkeywords = \l_@@_info_keywords_clist,
      pdfcreator  = \c_@@_name_pdf_creator_tl
    }
}
%    \end{macrocode}
%
% \subsection{图表浮动体}
% 
% \subsubsection{图片表格}
% 
% 图表位置调整
%    \begin{macrocode}
\floatsetup[figure]{ % Captions for figures
	capposition=bottom,%
	margins=centering,%
	floatwidth=\textwidth%
}
\floatsetup[table]{ % Captions for tables
	capposition=above,%
	margins=centering,%
	floatwidth=\textwidth%
}
%    \end{macrocode}
% 
% 图表标题样式
%    \begin{macrocode}
\DeclareCaptionFont{songticap}{\zihao{5}\bf\songti}
\captionsetup{
  font=small,%
  labelfont=songticap,
	textfont=songticap,
	strut=no,%
	hypcap=true, % Links point to the top of the figure
	% indention=0pt, % Suppress indentation
	% % parindent=0pt, % Suppress space between paragraphs
	aboveskip=6pt, % Increase the space between the figure and the caption
	belowskip=6pt, % Increase the space between the caption and the table
}
%    \end{macrocode}
%
% 
% \subsubsection{代码}
% 
% 代码样式
%    \begin{macrocode}
\floatsetup[lstlisting]{ % Captions for lstlistings
	capposition=above,%
	margins=centering,%
	floatwidth=\textwidth%
}
\lstset{
	basicstyle=\ttfamily\linespread{1}\small\selectfont,
    keywordstyle=\bfseries,% use bold style for keywords
    commentstyle=\rmfamily\itshape,% use italic style for comments
    stringstyle=\ttfamily,% 字符串风格
    flexiblecolumns,% ?
    numbers=left,% left-aligned numbering
    showspaces=false,% hide markers for spaces
    showstringspaces=false,
    captionpos=t,% place the caption at the top
	% frame=lrtb,% show all four sides of the frame
	% linewidth=.8\textwidth,
	% breakatwhitespace=true,
	breaklines=true,
	xleftmargin=2em,xrightmargin=2em,% set the width of the code environment
}
%    \end{macrocode}
%
% 
%    \begin{macrocode}
\lstdefinestyle{LaTeX}{
  language=TeX,
  morekeywords={
    begin, caption, label, mathrm, frac, 
    toprule, midrule, bottomrule, includegraphics}
}
%    \end{macrocode}
%
% 
% \subsubsection{列表}
% 
% 列表环境
%    \begin{macrocode}
\renewcommand{\labelitemi}{\tiny$\blacktriangleright$}
\renewcommand{\labelitemii}{\textbullet}

\setlist[itemize]{noitemsep}
\setlist[enumerate]{noitemsep}
\setlist[description]{noitemsep}
%    \end{macrocode}
%
% 
% \subsection{定理环境}
%
% \begin{macro}{\mathbi}
% Math bold italic letters
%    \begin{macrocode}
\NewDocumentCommand\mathbi{m}{\textbf{\em #1}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\declaretheoremstyle[
    	%spaceabove=.5\thm@preskip,
    	%spacebelow=.5\thm@postskip,
    	headfont=\bf\songti,%\scshape,
    	notefont=\songti,% notebraces={ (}{)},
    	bodyfont=\songti,
    	%headformat={\NAME\space\NUMBER\space\NOTE},
    	headpunct={},
    	%postheadspace={.5em plus .1em minus .1em},
    	%prefoothook={\hfill\qedsymbol}
    ]{njuthm}

\theoremstyle{njuthm}
%    \end{macrocode}
%
% 修改证明环境标题 
%    \begin{macrocode}
\let\oldproofname=\proofname
\renewcommand*{\proofname}{\rm\bf\songti{\oldproofname}} 
%    \end{macrocode}
%
% TODO: 简化数学环境的定义方法
%    \begin{macrocode}
\declaretheorem[
	name=算法,
	style=njuthm,
	refname={算法,算法},
	Refname={算法,算法},
	% numberwithin=section,
]{algorithm}
\declaretheorem[
	name=假设,
	style=njuthm,
	refname={假设,假设},
	Refname={假设,假设},
	% numberwithin=section,
]{assumption}
\declaretheorem[
	name=公理,
	style=njuthm,
	refname={公理,公理},
	Refname={公理,公理},
	% numberwithin=section,
]{axiom}
\declaretheorem[
	name=结论,
	style=njuthm,
	refname={结论,结论},
	Refname={结论,结论},
	% numberwithin=section,
]{conclusion}
\declaretheorem[
	name=条件,
	style=njuthm,
	refname={条件,条件},
	Refname={条件,条件},
	% numberwithin=section,
]{condition}
\declaretheorem[
	name=推论,
	style=njuthm,
	refname={推论,推论},
	Refname={推论,推论},
	% numberwithin=section,
]{corollary}
\declaretheorem[
	name=定义,
	style=njuthm,
	refname={定义,定义},
	Refname={定义,定义},
	% numberwithin=section,
]{definition}
\declaretheorem[
    	name=例,
    	style=njuthm,
    	refname={例,例},
    	Refname={例,例},
    	% numberwithin=section,
]{example}
\declaretheorem[
	name=引理,
	style=njuthm,
	refname={引理,引理},
	Refname={引理,引理},
	% numberwithin=section,
]{lemma}
\declaretheorem[
	name=性质,
	style=njuthm,
	refname={性质,性质},
	Refname={性质,性质},
	% numberwithin=section,
]{property}
\declaretheorem[
	name=命题,
	style=njuthm,
	refname={命题,命题},
	Refname={命题,命题},
	% numberwithin=section,
]{proposition}
\declaretheorem[
	name=注解,
	style=njuthm,
	refname={注解,注解},
	Refname={注解,注解},
	% numberwithin=section,
]{remark}
\declaretheorem[
	name=定理,
	style=njuthm,
	refname={定理,定理},
	Refname={定理,定理},
	numberwithin=section,
]{theorem}
%    \end{macrocode}
%
% \subsection{封面}
%
% \subsubsection{内部命令}
% 拼合标题
%    \begin{macrocode}
\tl_const:Nn \l_@@_info_title_tl 
{
  \l_@@_info_title_a_tl
  \l_@@_info_title_b_tl
  \l_@@_info_title_c_tl
}
%    \end{macrocode}
%
% \begin{variable}{\l_@@_info_supv_full_tl,\l_@@_info_supv_full_en_tl}
% 用于存储导师姓名加职称的变量,旧版编译器不支持字符串中含有|\hspace{.5em}|这样的空白空间命令
%    \begin{macrocode}
\tl_new:N \l_@@_info_supv_full_tl
\tl_new:N \l_@@_info_supv_full_en_tl
%    \end{macrocode}
% \end{variable}
%
% 拼合双导师的姓名和职称。
%    \begin{macrocode}
\tl_set:Nn \l_@@_info_supv_full_tl
{
  \l_@@_info_supv_a_tl\ 
  \l_@@_info_supv_a_title_tl\ \ 
  \l_@@_info_supv_b_tl\ 
  \l_@@_info_supv_b_title_tl
}
\tl_set:Nn \l_@@_info_supv_full_en_tl
{
  \l_@@_info_supv_a_title_en_tl\ 
  \l_@@_info_supv_a_en_tl\ \ 
  \l_@@_info_supv_b_title_en_tl\ 
  \l_@@_info_supv_b_en_tl
}
%    \end{macrocode}
%
% \begin{variable}{\l_@@_name_degree_tl,\l_@@_name_degree_en_tl}
% 用于存储学位名称的变量
%    \begin{macrocode}
\tl_new:N \l_@@_name_degree_tl
\tl_new:N \l_@@_name_degree_en_tl
%    \end{macrocode}
% \end{variable}
%
% 判断学位进行命令定义
%    \begin{macrocode}
\int_compare:nTF { \g_@@_info_degree_int == 1 } 
{
  % 本科
  \tl_const:Nn \c_@@_name_title_tl { 题\hfill 目 }
  
  \tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt }
  \tl_const:Nn \c_@@_cover_uline_len_b_tl { 90pt }
  \tl_const:Nn \c_@@_cover_uline_font_tl { \songti }
  \tl_const:Nn \c_@@_cover_uline_style_tl { \bf }
  \tl_const:Nn \c_@@_cover_uline_bskip_tl {}

  \tl_const:Nn \c_@@_cover_box_len_tl { 4.2em }

  % 本科强制不打印国家图书馆封面
  \bool_set_false:N \g_@@_nlcover_bool
} 
{ 
  % 本科以外都是研究生 
  \tl_const:Nn \c_@@_name_title_tl { 论\hfill 文\hfill 题\hfill 目 }

  \tl_const:Nn \c_@@_cover_uline_len_a_tl { 250pt }
  \tl_const:Nn \c_@@_cover_uline_len_b_tl { 14em }
  \tl_const:Nn \c_@@_cover_uline_font_tl { \kaishu }
  \tl_const:Nn \c_@@_cover_uline_style_tl {}
  \tl_const:Nn \c_@@_cover_uline_bskip_tl { \hspace{1em} }

  \tl_const:Nn \c_@@_cover_box_len_tl { 6em }
}
%    \end{macrocode}
% \begin{macro}{\@@_spread_box:nn}
% 来自\cls{fduthesis}:分散对齐的水平盒子。
% \begin{arguments}
%   \item   宽度
%   \item   内容
% \end{arguments}
% 利用 \cs{tl_map_inline:nn} 在字符间插入 \tn{hfil};紧随其后的 \tn{unskip}
% 将会去掉最后一个 \tn{hfil}。见 \url{https://tex.stackexchange.com/q/169689}。
% |#2| 需要完全展开以避免 underfull 警告。
%    \begin{macrocode}
\cs_generate_variant:Nn \tl_map_inline:nn       { xn }
\cs_new_protected:Npn \@@_spread_box:nn #1#2
  {
    \mode_leave_vertical:
    \hbox_to_wd:nn {#1}
      { \tl_map_inline:xn {#2} { ##1 \hfil } \unskip }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_cover_uline_a:n}
% 在封面绘制下划线
%    \begin{macrocode}
\cs_new:Npn \@@_cover_uline_a:n #1
{
  \uline{\makebox[\c_@@_cover_uline_len_a_tl]
    {\rm\c_@@_cover_uline_font_tl #1 }}
}
\cs_new:Npn \@@_cover_uline_b:n #1
{
  \uline{\makebox[\c_@@_cover_uline_len_b_tl]
    {\rm\c_@@_cover_uline_font_tl #1 }}
}
\cs_new:Npn \@@_cover_uline_nl:nn #1 #2
{
  \uline{\makebox[#1]
    {\rm\c_@@_cover_uline_font_tl #2 }}
}
%    \end{macrocode}
% \end{macro}
%
% 
% \begin{macro}{\@@_cover_box:n}
% 封面表格边框
%    \begin{macrocode}
\cs_new:Npn \@@_cover_box:n #1 
{
  \makebox[\c_@@_cover_box_len_tl][s]{
    #1\c_@@_cover_uline_bskip_tl}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_cover_degree:}
% 学位类型。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_cover_degree:
{
  { (申请 }
  \clist_item:Nn \c_@@_name_degree_clist { \g_@@_info_degree_int }
  { 学位) }
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{封面组件}
%
% \begin{macro}{\@@_cover_title_breakline:}
% 对标题进行自动判断,如果某行标题空则不输出接下来的若干行,得到多行标题。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_cover_title_breakline:
{
  \@@_cover_box:n {\c_@@_name_title_tl}
  & \@@_cover_uline_a:n 
  { \c_@@_cover_uline_style_tl \l_@@_info_title_a_tl } \\
  \tl_if_empty:NF \l_@@_info_title_b_tl
  {
    \tl_if_empty:NTF \l_@@_info_title_c_tl
      { 
        & \@@_cover_uline_a:n  
        {\c_@@_cover_uline_style_tl \l_@@_info_title_b_tl } \\ 
      }
      {
        & \@@_cover_uline_a:n  
        { \c_@@_cover_uline_style_tl \l_@@_info_title_b_tl } \\
        & \@@_cover_uline_a:n  
        { \c_@@_cover_uline_style_tl \l_@@_info_title_c_tl } \\
      }
  }
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_print_covertab:}
% 封面信息栏
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_covertab:
{%
\int_compare:nTF { \g_@@_info_degree_int == 1 } 
  {
    \begin{tabular}{p{4.2em}c}
      \@@_cover_box:n {院\hfill 系}
      & \@@_cover_uline_a:n  {\l_@@_info_dept_tl} \\
      \@@_cover_box:n {专\hfill 业}
      & \@@_cover_uline_a:n  {\l_@@_major_tl} \\
      \@@_cover_title_breakline:
    \end{tabular}\\
  
    \begin{tabular}{p{4.2em}cp{4.2em}c}
      \@@_cover_box:n {年\hfill 级}
      & \@@_cover_uline_b:n {\l_@@_info_grade_tl}
      & \@@_cover_box:n {学\hfill 号}
      & \@@_cover_uline_b:n {\l_@@_info_id_tl}\\
    \end{tabular}\\
    
    \begin{tabular}{p{4.2em}c}
      \@@_cover_box:n {学\hfill 生\hfill 姓\hfill 名}
      & \@@_cover_uline_a:n  {\l_@@_info_author_tl}
    \end{tabular}\\
    \begin{tabular}{p{4.2em}cp{4.2em}c}
      \@@_cover_box:n {导\hfill 师}
      & \@@_cover_uline_b:n {\l_@@_info_supv_a_tl}
      & \@@_cover_box:n {职\hfill 称}
      & \@@_cover_uline_b:n {\l_@@_info_supv_a_title_tl}\\
  
      % 第二导师
      \tl_if_empty:NF \l_@@_info_supv_b_tl
      {
        \@@_cover_box:n {第\hfill 二\hfill 导\hfill 师}
        & \@@_cover_uline_b:n {\l_@@_info_supv_b_tl}
        & \@@_cover_box:n {职\hfill 称}
        & \@@_cover_uline_b:n {\l_@@_info_supv_b_title_tl}\\
      }
    \end{tabular}\\
  
    \begin{tabular}{p{4.2em}c}
      \@@_cover_box:n {提\hfill 交\hfill 日\hfill 期}
      & \@@_cover_uline_a:n  {\l_@@_submit_date_tl}\\
    \end{tabular}  
  } 
  { 
    \begin{tabular}{p{6em}c}    
      \@@_cover_title_breakline:
      \@@_cover_box:n {作\hfill 者\hfill 姓\hfill 名}
      & \@@_cover_uline_a:n  {\@@_spread_box:nn {4em}{\l_@@_info_author_tl}}\\
      \@@_cover_box:n {专\hfill 业\hfill 名\hfill 称}
      & \@@_cover_uline_a:n  {\l_@@_major_tl}\\
      \@@_cover_box:n {研\hfill 究\hfill 方\hfill 向}
      & \@@_cover_uline_a:n  {\l_@@_field_tl}\\
      \@@_cover_box:n {指\hfill 导\hfill 教\hfill 师}
      & \@@_cover_uline_a:n  {\l_@@_info_supv_full_tl}\\
    \end{tabular}
  } 
}
%    \end{macrocode}
% \end{macro}
%
% 
%
% \subsubsection{绘制封面}
%
% 
% \begin{macro}{\@@_print_cover_nl:}
% 按需绘制国家图书馆封面,修改自胡海星模板
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_nl:
{
  \thispagestyle{empty}
  \pdfbookmark[0]{国家图书馆封面}{nl}
  {
    % 顶端
    \noindent\null\vskip -20mm \hskip -15mm
    \songti\zihao{-4}
    \makebox[40pt][l]{分类号}
    \@@_cover_uline_b:n {\l_@@_info_clc_tl}
    \hfill
    \makebox[40pt][l]{密级}
    \@@_cover_uline_b:n {\l_@@_info_seclv_tl}
    \vskip 10pt \hskip -15mm
    \makebox[40pt][l]{udc}
    \@@_cover_uline_b:n {\l_@@_info_udc_tl}
  }

  % 中部
  \vskip\stretch{2}
  \begin{center}
    \def\ULthickness{1pt}
    {\kaishu\zihao{-0} 学\hspace{0.5em}位\hspace{0.5em}论\hspace{0.5em}文}
    {
      \kaishu\zihao{1}
      \vskip \stretch{1}
      \@@_cover_uline_b:n {\l_@@_info_title_a_tl}\\
      \@@_cover_uline_b:n {\l_@@_info_title_b_tl}\\
      \@@_cover_uline_b:n {\l_@@_info_title_c_tl}\\
    }
    \vskip \stretch{1}
    {\kaishu\zihao{4}(题名和副题名)}
    \vskip \stretch{1} \vskip 5mm
    {\kaishu\zihao{1}\uline{\makebox{\l_@@_info_author_tl}}}
    \vskip \stretch{1}
    {\kaishu\zihao{4}(作者姓名)}
  \end{center}

  % 底部
  \vskip\stretch{1}\kaishu\zihao{4}
  \noindent 指导教师姓名、职务、职称、学位、单位名称及地址%
  \@@_cover_uline_nl:nn {94pt}{\l_@@_info_supv_a_tl}\par
  \noindent \@@_cover_uline_nl:nn {\textwidth}{%
  \l_@@_info_supv_cont_tl}\par
  \noindent 申请学位级别%
  \@@_cover_uline_nl:nn {9em}{\l_@@_name_degree_tl}%
  \noindent 专业名称%
  \uline{\hfill\l_@@_major_tl\hfill}\par
  \noindent 论文提交日期%
  \@@_cover_uline_nl:nn {9em}{\l_@@_submit_date_tl}%
  \noindent 论文答辩日期%
  \uline{\hfill\l_@@_defend_date_tl\hfill}\par
  \noindent 学位授予单位和日期\uline{\hfill}\par
  \begin{flushright}
    答辩委员会主席:
    \@@_cover_uline_nl:nn {9em}{ \l_@@_info_chairman_tl }\par
    评阅人:
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {1} }\par
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {2} }\par
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {3} }\par
    \@@_cover_uline_nl:nn {9em}
      { \clist_item:Nn \l_@@_info_reviewer_clist {4} }\par
  \end{flushright}
  \begin{center}
    \kaishu\zihao{3}\hspace{2em} 年\hspace{1em} 月\hspace{1em} 日
  \end{center}
  \vskip -10mm
  \cleardoublepage
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_print_cover_ug:}
% 本科封面
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_ug:
{
  \thispagestyle{empty}
  \pagenumbering{Roman}
  % Start
  \pdfbookmark{封面}{cover} % 将封面插入pdf书签
  \begin{spacing}{1.25}
  \noindent\null\hspace{-10mm}
  \njuemblem{!}{3cm}\smallskip 
  \begin{center}
    \njuname{!}{3.35cm}
    \vskip 10mm 
    {\zihao{1}\bf\songti\@@_spread_box:nn {9em}{本科毕业论文}}
    \vfill
    \vskip\stretch{0}
    {\bgroup
    \kaishu\zihao{3}
    \def\tabcolsep{1pt}
    \def\arraystretch{1.5}
    % 绘制信息框
    \@@_print_covertab: 
    \egroup}
    \vfill
  \end{center}
  \end{spacing}
  \cleardoublepage
}
%    \end{macrocode}
% \end{macro}
%
% 
% \begin{macro}{\@@_print_cover_g:}
% 研究生封面
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_cover_g:
{
  \thispagestyle{empty}
  \pagenumbering{Roman}
  % Start
  \pdfbookmark{封面}{cover} % 将封面插入pdf书签
  \begin{spacing}{1.25}
  \begin{center}
    \noindent\null\vskip 5mm
    \njuemblem{!}{1.9cm}
    \vskip 10mm 
    \njuname{4.4cm}{!}
    \par\vskip -2mm 
    \njuname*{4.4cm}{!}
    \vskip 15mm 
    \bgroup
      \zihao{1}\bf\kaishu
      \@@_spread_box:nn {10em}{研究生毕业论文}
      \vskip 5mm
      \@@_cover_degree:
    \egroup
    \par\vfill\vskip\stretch{0}
    \bgroup
      \bf\kaishu\zihao{3}
      \def\tabcolsep{1pt}
      \def\arraystretch{1.5}
      \vskip 10mm
      \@@_print_covertab:
    \egroup
    \vfill
    \vskip 10mm
    \bf\kaishu\zihao{4}\l_@@_submit_date_tl
    \vskip 15mm
  \end{center}
  \end{spacing}

  \newpage % 封面背面
  \thispagestyle{empty}
  \begin{spacing}{1.625}
    % TODO: 等待调整格式
    \null\vfill
    {\bgroup
    \kaishu\zihao{3}
    \makebox[6em][s]{\bf\kaishu 学\hfill 号}:\MakeUppercase{\l_@@_info_id_tl}
    \par
    \makebox[6em][s]{\bf\kaishu 论文答辩日期}:\l_@@_defend_date_tl
    \par
    \makebox[6em][s]{\bf\kaishu 指\hfill 导\hfill 教\hfill 师}:\hspace{50mm}(签字)
    \par
    \egroup}
    \vskip 15mm
  \end{spacing}
  \cleardoublepage
  
% 研究生英文封面
  \thispagestyle{empty}
  \pdfbookmark{英文封面}{cover-en} % 将封面插入pdf书签
  \begin{center}
    \noindent\vspace*{20pt}
    \bf\sffamily\zihao{2}\l_@@_info_title_en_tl
    \vskip \stretch{1}
    \normalfont\rmfamily\zihao{4}{by}
    \vskip 3pt
    \bf\sffamily\zihao{4}\l_@@_info_author_en_tl
    \vskip\stretch{1}
    \normalfont\rmfamily\zihao{4}{Supervised~by}
    \vskip 3pt
    \normalfont\sffamily\zihao{4}
    \l_@@_info_supv_a_title_en_tl
    \hspace{.5em}\l_@@_info_supv_a_en_tl\\
    \l_@@_info_supv_b_title_en_tl
    \hspace{.5em}\l_@@_info_supv_b_en_tl
    \vskip\stretch{1}
    \normalsize\rmfamily{
      A~dissertation~submitted~to\\
      the~graduate~school~of~Nanjing~University\\
      in~partial~fulfilment~of~the~requirements~for~the~degree~of\\
      \textsc{
        \clist_item:Nn \c_@@_name_degree_en_clist { \g_@@_info_degree_int }
        }\\
      in\\
      {\l_@@_major_en_tl}
    }
    \vskip\stretch{2}
    \njuemblem{2.5cm}{!}\par
    \vskip 3mm
    \normalfont\l_@@_info_dept_en_tl\\
    {Nanjing~University}
    \vskip 30pt
    \normalfont\normalsize\l_@@_submit_date_en_tl
  \end{center}
  \normalfont
  \cleardoublepage
}
%    \end{macrocode}
% \end{macro}
%
% 
% \begin{macro}{\maketitle}
% 重定义maketitle生成封面
%    \begin{macrocode}
\tl_set:Nn \maketitle 
{
  \bool_if:NT \g_@@_nlcover_bool { \@@_print_cover_nl: } % 国家图书馆封面
  \use:c { @@_print_cover_ \g_@@_info_diploma_tl : } 
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{摘要绘制}
%
% \begin{macro}{\@@_print_keywords:,\@@_print_keywords_en:}
% 中英文关键词
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_keywords:
{
  \par\vspace{2ex}
  \bgroup
    \noindent
    \c_@@_name_keywords_tl
    \clist_use:Nn \l_@@_info_keywords_clist {;} 
    \par
  \egroup
}
\cs_new_protected:Npn \@@_print_keywords_en:
{
  \par\vspace{2ex}
  \bgroup
    \noindent
    \c_@@_name_keywords_en_tl\hspace{0.5em}
    \clist_use:Nn \l_@@_info_keywords_en_clist {;}
    \par
  \egroup
}
%    \end{macrocode}
% \end{macro}
%
%   
% \begin{macro}{\@@_print_abstract_ug:,\@@_print_abstract_en_ug:}
% 输出本科摘要格式。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_abstract_ug:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{中文摘要}{abstract-zh}
  \begin{center}
    \kaishu\zihao{-2}{\textbf{
      \uuline{南京大学本科生毕业论文(设计、作品)中文摘要}}}
  \end{center}
  \bgroup
    \noindent\kaishu\zihao{-4}
    题目: \l_@@_info_title_tl \\
    院系: \l_@@_info_dept_tl \\
    专业: \l_@@_major_tl \\
    本科生姓名: \l_@@_info_author_tl \\
    指导教师(姓名、职称):\l_@@_info_supv_full_tl \\
    摘要:
  \egroup
  \kaishu\zihao{-4}\par%
}
\cs_new_protected:Npn \@@_print_abstract_en_ug:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{英文摘要}{abstract-en}
  \begin{center}
      \kaishu\zihao{-2}{\textbf{\uuline{
        南京大学本科生毕业论文(设计、作品)英文摘要}}}
  \end{center}
  {
    \bgroup
    THESIS: ~~\l_@@_info_title_en_tl \\
    DEPARTMENT: ~~\l_@@_info_dept_en_tl \\
    SPECIALIZATION: ~~\l_@@_major_en_tl \\
    UNDERGRADUATE:~~\l_@@_info_author_en_tl \\
    MENTOR:~~\l_@@_info_supv_full_en_tl \\
    ABSTRACT:
    \egroup
  }
  \zihao{-4}\par%
}
%    \end{macrocode}
% \end{macro}
%
% 
% \begin{macro}{\@@_print_abstract_g:,\@@_print_abstract_en_g:}
% 输出研究生摘要格式。
%    \begin{macrocode}
\cs_new_protected:Npn \@@_print_abstract_g:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{中文摘要}{abstract-zh}
  \begin{center}
    \kaishu\zihao{-2}{\textbf{\uuline{
      南京大学研究生毕业论文中文摘要首页用纸}}}
  \end{center}
  \bgroup
    \noindent\kaishu\zihao{4}
    毕业论文题目:\hspace{0.5em}\njuline{\l_@@_info_title_tl\hfill}\\
    \njuline{\makebox[11em]{\l_@@_major_tl}}专业
    \njuline{\makebox[4em]{\l_@@_info_grade_tl}}级
    \int_compare:nTF { \g_@@_info_degree_int == 4} { 博 } { 硕 }
    士生姓名:\njuline{\hfill\l_@@_info_author_tl\hfill}\\
    指导教师(姓名、职称):\njuline{\hfill\l_@@_info_supv_full_tl\hfill}\par
  \egroup
  \kaishu\zihao{4}\par%
}
\cs_new_protected:Npn \@@_print_abstract_en_g:
{
  \thispagestyle{plain}
  \pdfbookmark[0]{英文摘要}{abstract-en}
  \begin{center}
      \kaishu\zihao{-2}{\textbf{\uuline{
        南京大学研究生毕业论文英文摘要首页用纸}}}
  \end{center}
  {
    \bgroup
    \zihao{4}
    THESIS: ~~\l_@@_info_title_en_tl \\
    SPECIALIZATION: ~~\l_@@_major_en_tl \\
    POSTGRADUATE:~~\l_@@_info_author_en_tl \\
    MENTOR:~~\l_@@_info_supv_full_en_tl\par
    \egroup
  }
  \zihao{4}\par%
}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{abstract}
% 中文摘要环境。
%    \begin{macrocode}
\NewDocumentEnvironment{abstract} { +b }
  { \use:c { @@_print_abstract_ \g_@@_info_diploma_tl : } #1 }
  { \@@_print_keywords: \newpage }
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{abstract*}
% 英文摘要环境。\pkg{xparse} 目前不支持合并带有星号的环境,因此需要单独定义。
%    \begin{macrocode}
\NewDocumentEnvironment{abstract*} { +b }
  { \use:c { @@_print_abstract_en_ \g_@@_info_diploma_tl : } #1 }
  { \@@_print_keywords_en: \cleardoublepage }
%</class>
%    \end{macrocode}
% \end{macro}
%
% \end{implementation}
%