-
Notifications
You must be signed in to change notification settings - Fork 18
/
beamerthemescu.sty
1334 lines (1277 loc) · 47 KB
/
beamerthemescu.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
% This is file `beamerthemescu.sty'.
% Copyright (C) 2021-2024 by Linrong Wu.
% Version: 2024/10/31 v1.3e (Original Version: 2021/11/30 v1.0a).
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/licenses/LICENSE for more details.
%
% Provide options:
% MathFont = LM | XITS
% ColorDisplay = JXred | BSblue | Custom
% CodeDisplay = listing | minted
% MintedStyle = lightmode | darkmode | <custom>
% BlockDisplay = colorful | followtheme | allgrey
% Miniframes = follow | separate | negate
% LanguageMode = cn | en
% BIBMode = biber | none
% BIBStyle = biber-gb7714
% ContentMuticols = true | false
% Background = true | false
%
% 本文件为 SCU_Beamer_Slide-demo 宏包文件.
% !请勿轻易改动此文档中代码.
%%%% ----------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{beamerthemescu}[2024/10/31 v1.3e, SCU Beamer Theme(Main Theme)]
%%%% ----------------------------------------------------------------
% ----------------
% Declare of Commands
% Confirmed in v1.3e(2024/10/31).
% Established in v1.3b(2022/04/13).
% Updated in v1.3e(2024/10/31).
% ----------------
\def\mycopyright{\vspace{2ex}Copyright\enspace\copyright\enspace2021-2024 by LR Wu.}% 版权声明.
\def\myestablish#1#2{Establish: \textcolor{scugreen}{#1 (#2)}}
\def\myupdate#1#2{Update: \textcolor{scugreen}{#1 (#2)}}
\def\kvtcb@label@sep{:}% tcolorbox 中 label 分隔符.
% 定义执行命令. 修改自 sjtubeamer.
\def\EqualOptionsBeamer{%
\relax\fi\ifEqualOptionsBeamer%
}
\def\ifEqualOptionsBeamer#1#2{%
% #1:: Option - Key.
% #2:: Option - Value.
\newif\ifoption@tmp%
\edef\optionkey@tmp{%
\csname beamer@scu@#1\endcsname%
}%
\edef\optionvalue@tmp{#2}%
\ifx\optionkey@tmp\optionvalue@tmp\option@tmptrue%
\else\option@tmpfalse\fi%
\ifoption@tmp%
}
% 定义命令写法. 修改自 lshort-zh-cn.
\DeclareRobustCommand*\cmd[1]{\alert{\texttt{\char`\\#1}}}
\DeclareRobustCommand*\env[1]{\alert{\texttt{#1}}}
\DeclareRobustCommand*\pkg[1]{\alert{\textsf{#1}}}
\DeclareRobustCommand*\cls[1]{\alert{\textsf{#1}}}
\DeclareRobustCommand*\marg{\@ifstar\@marg\@margmeta}
\DeclareRobustCommand*\oarg{\@ifstar\@oarg\@oargmeta}
\DeclareRobustCommand*\Arg[1]{\@meta{#1}}
\def\@oarg#1{\textcolor{scugrey}{\texttt{[#1]}}}
\def\@oargmeta#1{\@oarg{\@meta{#1}}}
\def\@marg#1{\texttt{\{#1\}}}
\def\@margmeta#1{\@marg{\@meta{#1}}}
\def\@meta#1{$\m@th\langle$\textnormal{\textit{#1}}$\m@th\rangle$}
% 定义字体命令.
\def\setfontscu#1{\fontsize{#1}{4}\selectfont}
% ----------------
% ----------------
% Declare of Options
% Confirmed in v1.3e(2024/10/31).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/31), v1.2a(2022/03/10), v1.3a(2022/03/16), v1.3b(2022/04/13), v1.3c(2024/04/16), v1.3d(2024/05/18), v1.3e(2024/10/31).
% ----------------
% CMD:: \DeclareOptionBeamer - 声明参数.
% CMD:: \ExecuteOptionsBeamer - 预执行参数.
% CMD:: \ProcessOptionsBeamer - 处理参数.
% ----------------
% 定义新的 if.
\newif\ifbeamer@scu@contentmuticols
\newif\ifbeamer@scu@background
% KEY:: MathFont.
% VALUE:: XITS | LM.
\DeclareOptionBeamer{MathFont}{\def\beamer@scu@MathFont{#1}}
% KEY:: BlockDisplay.
% VALUE:: colorful | followtheme | allgrey.
\DeclareOptionBeamer{BlockDisplay}{\def\beamer@scu@BlockDisplay{#1}}
% KEY:: CodeDisplay.
% VALUE:: minted | listing.
\DeclareOptionBeamer{CodeDisplay}{\def\beamer@scu@CodeDisplay{#1}}
% KEY:: MintedStyle [BASED:: CodeDisplay].
% VALUE:: lightmode | darkmode | <custom>.
\DeclareOptionBeamer{MintedStyle}{\def\beamer@scu@MintedStyle{#1}}
% KEY:: ColorDisplay [PASSTO:: beamercolorthemescu.sty].
% VALUE:: JXred | BSblue.
\DeclareOptionBeamer{ColorDisplay}{\PassOptionsToPackage{ColorDisplay=#1}{beamercolorthemescu}}
% KEY:: Miniframes [PASSTO:: beamerouterthemescu.sty].
% VALUE:: follow | separate | negate.
\DeclareOptionBeamer{Miniframes}{\PassOptionsToPackage{Miniframes=#1}{beamerouterthemescu}}
% KEY:: NavigationTool [PASSTO:: beamerouterthemescu.sty].
% VALUE:: negate | 1 | 2 | 3 | 1-2 | 1-3 | 2-3 | 1-2-3.
\DeclareOptionBeamer{NavigationTool}{\PassOptionsToPackage{NavigationTool=#1}{beamerouterthemescu}}
% KEY:: LanguageMode.
% VALUE:: cn | en.
\DeclareOptionBeamer{LanguageMode}{\def\beamer@scu@LanguageMode{#1}}
% KEY:: BIBMode.
% VALUE:: biber | none.
\DeclareOptionBeamer{BIBMode}{\def\beamer@scu@BIBMode{#1}}
% KEY:: BIBStyle [BASED:: BIBMode].
% VALUE:: biber-gb7714.
\DeclareOptionBeamer{BIBStyle}{\def\beamer@scu@BIBStyle{#1}}
\DeclareOptionBeamer{ContentMuticols}{\csname beamer@scu@contentmuticols#1\endcsname}
\DeclareOptionBeamer{Background}{\csname beamer@scu@background#1\endcsname}
%\PassOptionsToClass{aspectratio=169}{beamer}
\ExecuteOptionsBeamer{%
MathFont=LM,%
BlockDisplay=colorful,%
CodeDisplay=listing,%
ColorDisplay=JXred,%
Miniframes=follow,%
NavigationTool=1-2-3,%
LanguageMode=cn,%
BIBMode=biber,%
ContentMuticols=true,%
Background=true%
}
\ProcessOptionsBeamer
\if\EqualOptionsBeamer{CodeDisplay}{minted}%
\ExecuteOptionsBeamer{MintedStyle=lightmode}%
\fi
\if\EqualOptionsBeamer{BIBMode}{biber}%
\ExecuteOptionsBeamer{BIBStyle=biber-gb7714}
\fi
\ProcessOptionsBeamer
% ----------------
% ----------------
% Declare of Packages
% Confirmed in v1.3e(2024/10/31).
% Established in v1.3b(2022/04/13).
% Updated in v1.3c(2024/04/16), v1.3d(2024/05/18), v1.3e(2024/10/31).
% ----------------
% CMD:: \RequirePackage - 调用宏包.
% ----------------
\if\EqualOptionsBeamer{LanguageMode}{cn}
\RequirePackage[fontset=none]{ctex}% ctex: 提供统一的 LaTeX 中文文档框架.
\else\if\EqualOptionsBeamer{LanguageMode}{en}
\RequirePackage[fontset=none, scheme=plain]{ctex}% ctex: 提供统一的 LaTeX 中文文档框架.
\fi\fi
\RequirePackage{fontspec}% fontspec: 字体设置.
\RequirePackage{amsmath,amsfonts,amssymb} % math equations, symbols
\RequirePackage{mathtools}
\RequirePackage{unicode-math}% unicode-math: OpenType 数学字体.
\RequirePackage{tikz}% tikz: 绘制图像.
\RequirePackage{comment}% comment: 提供注释环境.
\RequirePackage{xparse}% xparse: 指定命令参数.
\RequirePackage{varioref}% varioref: 交叉引用.
\if\EqualOptionsBeamer{LanguageMode}{en}%
\PassOptionsToPackage{english}{cleveref}
\fi
\RequirePackage{cleveref}% cleveref: 交叉引用.
\RequirePackage{tcolorbox}% tcolorbox: 绘制彩色文本框.
\if\EqualOptionsBeamer{CodeDisplay}{minted}%
% minted 临时文件存储在 mintedbuild 文件夹
\PassOptionsToPackage{outputdir=./mintedbuild}{minted}
\RequirePackage{minted}% minted: 代码高亮.
\tcbuselibrary{skins, breakable, xparse, listings, minted}
\PackageWarningNoLine{beamerthemescu}{%
Option [CodeDisplay=minted] is loaded. %
Please add `-shell-escape' and `-8bit' parameters to XeLaTeX}
\else\if\EqualOptionsBeamer{CodeDisplay}{listing}%
\tcbuselibrary{skins, breakable, xparse, listings}
\PackageWarningNoLine{beamerthemescu}{%
Option [CodeDisplay=listing] is loaded. %
If you have configured Python environment, %
you are recommended to set [CodeDisplay=minted] option and %
install Pygments through pip. %
Additionally, add `-shell-escape' and `-8bit' parameters to XeLaTeX}
\fi\fi
\RequirePackage{ifthen}% ifthen: 控制结构语句.
\RequirePackage{fontawesome5}% fontawesome5: 提供可缩放矢量图标.
\RequirePackage{tabularx}% tabularx: 智能表格环境.
\if\EqualOptionsBeamer{BIBMode}{biber}%
\PassOptionsToPackage{backend=biber}{biblatex}% 后端 biber 引擎.
\if\EqualOptionsBeamer{BIBStyle}{biber-gb7714}%
\PassOptionsToPackage{autolang=hyphen,%
style=gb7714-2015,%
gbalign=gb7714-2015,%style=gb7714-2015ms
gbstyle=false, url=false, doi=false, isbn=false,%
sorting=none}{biblatex}%
\fi
\RequirePackage{biblatex}% biblatex: 参考文献.
\else\if\EqualOptionsBeamer{BIBMode}{none}%
\relax
\fi\fi
\RequirePackage{calc}% biblatex: 参考文献.
% ----------------
\mode<presentation>
% ----------------
% Some Settings
% ----------------
%\hyperref{urlcolor=scugreen}
% 调整左右边距.
\setbeamersize{text margin left=0.03\paperwidth, text margin right=0.03\paperwidth}% 0.036, 0.036
% 设置目录深度为 2 (显示至 subsection).
\setcounter{tocdepth}{2}
% 设置图片路径为项目文件夹下 `image' `images' `figure' `figures'.
\graphicspath{{image/}{images/}{figure/}{figures/}{resources/}}
% 半透明化尚未出现的内容.
\setbeamercovered{transparent}
% 导航栏为空.
\beamertemplatenavigationsymbolsempty
% ----------------
% ----------------
% Theme Layout
% Confirmed in v1.3c(2024/04/16).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/31), v1.2a(2022/03/10), v1.3a(2022/03/16), v1.3b(2022/04/13), v1.3c(2024/04/16).
% ----------------
% 包含外部主题, 内部主题, 颜色主题.
% ----------------
% 设置 "SCUname.pdf" 为图片 "logo".
\pgfdeclareimage[width=40pt]%
{lg}{./resources/SCUname.pdf}
% 设置 "SCUname.pdf" 为图片 "logo".
\pgfdeclareimage[height=36pt]%
{lg-name}{./resources/SCUlogo_name.pdf}
\pgfdeclareimage[height=80pt]%
{building}{./resources/SCUbuilding.png}
\pgfdeclareimage[height=30pt]%
{verify}{./resources/SCUverify.png}
% 颜色主题 - scu.
\usecolortheme{scu}
% 外部主题 - scu.
\useoutertheme{scu}
% 内部主题 - scu.
\useinnertheme{scu}
% 取消 itemize 环境编号.
\setbeamertemplate{itemize items}[square]
% 设置 enumerate 环境编号为圆形.
\setbeamertemplate{enumerate items}[square]
% 设置目录中章节编号为圆形.
\setbeamertemplate{sections/subsections in toc}[square]
% 图标题编号.
\setbeamertemplate{caption}[numbered]
% 定理标题编号.
\setbeamertemplate{theorems}[numbered]
% 设置 blocks 区块为 rounded (圆形边框).
\setbeamertemplate{blocks}[rounded]
% 压缩模式.
\beamer@compresstrue
% ----------------
% ----------------
% Background Layout
% Confirmed in v1.3c(2024/04/16).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/31), v1.2a(2022/03/10), v1.3a(2022/03/16), v1.3c(2024/04/16).
% ----------------
% 设置了主题背景选项 "background=true" & "background=false".
% 设置了页眉 logo.
% ----------------
\ifbeamer@scu@background%
% 设置 "background.png" 为图片 "bg".
\pgfdeclareimage[width=\paperwidth]%
{bg}{./resources/background.png}
% 设置图片 "bg" 为背景图片.
\usebackgroundtemplate{\pgfuseimage{bg}}
% 设置 "backgroundofsubsectiontocpage.png" 为图片 "bgofsubsectoc".
\pgfdeclareimage[width=\paperwidth]%
{bgofsubsectoc}{./resources/backgroundofsubsectiontocpage.png}
% 设置 "backgroundoftitlepage.png" 为图片 "bgoftitle".
% \pgfdeclareimage[width=\paperwidth]%
% {bgoftitle}{./resources/backgroundoftitlepage.png}
\pgfdeclareimage[width=\paperwidth]%
{bgoftitle}{./resources/backgroundoftitlepage(Empty).png}
\else%
% 设置 "backgroundoftitlepage(Light).png" 为图片 "bgoftitle".
% \pgfdeclareimage[width=\paperwidth]%
% {bgoftitle}{./resources/backgroundoftitlepage(Light).png}
\pgfdeclareimage[width=\paperwidth]%
{bgoftitle}{./resources/backgroundoftitlepage(Empty).png}
\fi
% ----------------
% ----------------
% Font Layout
% Confirmed in v1.3d(2024/05/18).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/31), v1.2a(2022/03/10), v1.3d(2024/05/18).
% ----------------
% 设置了主题数学字体选项 "mathdisplay=XITS" & "mathdisplay=LM".
% ----------------
%\newfontfamily\cmcsc{cmcsc10.mf}
%\def\scshape{\cmcsc}
%\setmainfont[SmallCapsFont]{cmcsc10.mf}
% 设置无衬线字体为 Computer Modern Unicode Bright 字体族(Opentype 格式).
%\setsansfont{CMU Sans Serif}
\setsansfont{Kurier}
% 数学字体设置.
\if\EqualOptionsBeamer{MathFont}{XITS}%
% 数学字体 - XITS Math.
\setmathfont{XITS Math}
\else\if\EqualOptionsBeamer{MathFont}{LM}%
% 数学字体 - Latin Modern Math.
\setmathfont{Latin Modern Math}
\fi\fi
% 设置中文无衬线字体为项目文件夹下 "fonts" 中 "simkai.ttf" (楷体), 加粗为 "simhei.ttf" (黑体).
%\setCJKsansfont[Path="fonts/",BoldFont={simhei.ttf}]{simkai.ttf}
\setCJKsansfont[Scale=0.956]{Microsoft YaHei}
% \setCJKsansfont{LXGWWenKai-Bold.ttf}[Path="fonts/",Scale=0.956,BoldFont={SourceHanSansSC-Medium.otf}]
% \setCJKsansfont{LXGW WenKai Bold}[Scale=0.956,BoldFont={Source Han Sans SC Medium}]
%\usefonttheme{professionalfonts}
% ----------------
% ----------------
% Font Sizes Layout
% ----------------
% 幻灯标题字体设置.
\setbeamerfont{frametitle}{size=\large,series=\bfseries}
\setbeamerfont{framesubtitle}{size=\scriptsize,series=\bfseries}
% 封页字体设置.
\setbeamerfont{title}{size=\LARGE,series=\bfseries}
\setbeamerfont{subtitle}{size=\small,series=\bfseries}
\setbeamerfont{author}{size=\small,series=\bfseries}
\setbeamerfont{date}{size=\footnotesize,series=\bfseries}
\setbeamerfont{block title}{size=\normalsize}
\setbeamerfont{structure}{size=\normalsize,series=\bfseries}
% 脚注字号设置.
\setbeamerfont{footnote}{size=\scriptsize}
% 页眉页脚字体设置.
\setbeamerfont{section in head/foot}{size=\scriptsize,series=\bfseries}
\setbeamerfont{subsection in head/foot}{size=\scriptsize,series=\bfseries}
\setbeamerfont{institute in head/foot}{size=\scriptsize,series=\bfseries}
\setbeamerfont{author in head/foot}{size=\tiny,series=\mdseries}
\setbeamerfont{title in head/foot}{size=\tiny,series=\bfseries}
\setbeamerfont{framenumber in head/foot}{size=\scriptsize,series=\bfseries}
% itemize 环境序号设置.
% \setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\textbullet}}
% \setbeamertemplate{itemize subitem}{\scriptsize\raise1.25pt\hbox{\textbullet}}
% \setbeamertemplate{itemize subsubitem}{\scriptsize\raise1.25pt\hbox{\textbullet}}
% ----------------
% ----------------
% Bibliography Layout
% Confirmed in v1.3b(2022/04/13).
% Established in v1.3b(2022/04/13).
% Updated in v1.3d(2024/05/18).
% ----------------
\if\EqualOptionsBeamer{BIBMode}{biber}%
% 参考文献 bib 库.
\addbibresource[location=local]{ref.bib}
% 参考文献设置.
\beamertemplatetextbibitems
% 设置 bibliography 列表为 text 显示模式.
\setbeamertemplate{bibliography item}[text]
% 设置 bibitem 间距.
\setlength{\bibitemsep}{0.75ex}
% 参考文献目录字号设置为6号.
\renewcommand*{\bibfont}{\footnotesize}
\fi
% 设置参考文献脚注引用.
\newcommand{\footfullcitetext}[2][]{%
\footnotetext{%
\ifstrempty{#1}{\fullcite{#2}}{\fullcite[{[#1]}]{#2}}%
}}
% ----------------
% ----------------
% Tcolorbox Style Layout
% Confirmed in v1.3b(2022/04/13).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/30), v1.2a(2022/03/10), v1.3a(2022/03/16).
% ----------------
% 定义了多种 Tcolorbox 盒子的基础样式. 修改自 Tcolorbox 手册.
% ----------------
% 盒子基础样式定义.
% 普通盒子基础样式定义.
\def\beamer@scu@tcbstyle#1#2#3{%
% #1: 关键字 - 样式类型.
% #2: 上部颜色.
% #3: 下部颜色.
\tcbset{tcb#1style/.style={%
enhanced jigsaw,%
arc=1.5mm,%
toprule=1mm, leftrule=1mm,%
boxsep=-.5mm,%
left=1.8mm, right=2mm, top=2.5mm,%
fonttitle=\normalsize\bfseries,%
fontupper=\usebeamercolor[fg]{nomal text},%
fontlower=\usebeamercolor[fg]{nomal text},%
frame style={%
upper left=#2, upper right=#2!50,%
lower left=#3!50, lower right=#3%
},%
interior style={white, opacity=.8},%
segmentation style={%
black, solid,%
opacity=.2, line width=1pt%
},%
breakable, break at=.78\textheight,%
pad at break=.5ex
}}%
}
% 定理盒子基础样式定义.
\def\beamer@scu@tcbstyletheo#1#2{%
% #1: 关键字 - 样式类型.
% #2: 颜色.
\tcbset{tcb#1style/.style={empty,%
attach boxed title to top left,%
boxed title style={empty,%
% colback=white!98!#2, opacityback=0.96, enhanced,%
% fuzzy shadow={-0.2mm}{0.2mm}{0mm}{0.2mm}{white!90!#2},%
% fuzzy shadow={0.2mm}{-0.2mm}{0mm}{0.2mm}{black!90!#2},%
size=minimal,%
toprule=2pt, top=4pt, left=1pt, right=1pt,%
overlay={%
\draw [#2, line width=2.5pt, rounded corners=1pt]%
([yshift=-1pt]frame.north west) -- ([yshift=-1pt]frame.north east);
\draw [white!80!#2, line width=2.5pt, rounded corners=1pt]%
([xshift=.25em,yshift=-1pt]frame.north west)%
-- ([xshift=.5em, yshift=-1pt]frame.north west);
},%
},%
coltitle=#2!90!black, fonttitle=\normalsize\bfseries,%
before=\par\medskip\noindent, vfill before first,%
parbox=false, boxsep=0pt,%
top=4pt, bottom=4pt, left=0pt, right=2mm,%
fontupper=\usebeamercolor[fg]{nomal text},%
fontlower=\usebeamercolor[fg]{nomal text},%
breakable, break at=.78\textheight,%
pad at break*=.5ex,%
overlay unbroken={%
\draw [#2, line width=1pt, rounded corners=1pt]%
([yshift=-1pt]title.north east)%
-- ([xshift=-0.5pt,yshift=-1pt]title.north-|frame.east)%
-- ([xshift=-0.5pt]frame.south east) -- (frame.south west);
\draw [white!80!#2, line width=1pt, rounded corners=1pt]%
([xshift=2em]frame.south west) -- ([xshift=5em]frame.south west);
},%
overlay first={%
\draw [#2, line width=1pt, rounded corners=1pt]%
([yshift=-1pt]title.north east)%
-- ([xshift=-0.5pt,yshift=-1pt]title.north-|frame.east)%
-- ([xshift=-0.5pt]frame.south east);
},%
overlay middle={%
\draw [#2, line width=1pt, rounded corners=1pt]%
([xshift=-0.5pt]frame.north east) -- ([xshift=-0.5pt]frame.south east);
},%
overlay last={%
\draw [#2, line width=1pt, rounded corners=1pt]%
([xshift=-0.5pt]frame.north east) -- ([xshift=-0.5pt]frame.south east)%
-- (frame.south west);
\draw [white!80!#2, line width=1pt, rounded corners=1pt]%
([xshift=2em]frame.south west) -- ([xshift=5em]frame.south west);
}%
}}%
}
% 代码盒子基础样式定义.
\def\beamer@scu@tcbstylecode#1{%
% #1: 关键字 - 样式类型.
% #2: 颜色.
\tcbset{codestyle/.style={empty,%
attach boxed title to top left,%
boxed title style={empty,%
% colback=white!98!#1, opacityback=0.96, enhanced,%
% fuzzy shadow={-0.2mm}{0.2mm}{0mm}{0.2mm}{white!90!#1},%
% fuzzy shadow={0.2mm}{-0.2mm}{0mm}{0.2mm}{black!90!#1},%
size=minimal,%
toprule=2pt, top=4pt, left=1pt, right=1pt,%
overlay={%
\draw [#1, line width=2.5pt, rounded corners=1pt]%
([yshift=-1pt]frame.north west) -- ([yshift=-1pt]frame.north east);
\draw [white!80!#1, line width=2.5pt, rounded corners=1pt]%
([xshift=.25em,yshift=-1pt]frame.north west)%
-- ([xshift=.5em, yshift=-1pt]frame.north west);
},%
},%
coltitle=#1!90!black, fonttitle=\normalsize\bfseries,%
before=\par\medskip\noindent, vfill before first,%
parbox=false, boxsep=0pt,%
top=4pt, bottom=4pt, left=1pt, right=2mm,%
fontupper=\usebeamercolor[fg]{nomal text},%
fontlower=\usebeamercolor[fg]{nomal text},%
breakable, break at=.78\textheight,%
pad at break*=.5ex,%\\
listing only,%
overlay unbroken={%
\draw [#1, line width=1pt, rounded corners=1pt]%
([yshift=-1pt]title.north east)%
-- ([xshift=-0.5pt,yshift=-1pt]title.north-|frame.east)%
-- ([xshift=-0.5pt]frame.south east) -- (frame.south west);
\draw [white!80!#1, line width=1pt, rounded corners=1pt]%
([xshift=2em]frame.south west) -- ([xshift=5em]frame.south west);
\node [anchor=north east] at ([xshift=-1.5pt,yshift=-2pt]title.north-|frame.east) {%
\textcolor{#1}{\normalsize ##1}%\faCode\faFileCode[regular]
};
},%
overlay first={%
\draw [#1, line width=1pt, rounded corners=1pt]%
([yshift=-1pt]title.north east)%
-- ([xshift=-0.5pt,yshift=-1pt]title.north-|frame.east)%
-- ([xshift=-0.5pt]frame.south east);
},%
overlay middle={%
\draw [#1, line width=1pt, rounded corners=1pt]%
([xshift=-0.5pt]frame.north east) -- ([xshift=-0.5pt]frame.south east);
},%
overlay last={%
\draw [#1, line width=1pt, rounded corners=1pt]%
([xshift=-0.5pt]frame.north east) -- ([xshift=-0.5pt]frame.south east)%
-- (frame.south west);
\draw [white!80!#1, line width=1pt, rounded corners=1pt]%
([xshift=2em]frame.south west) -- ([xshift=5em]frame.south west);
}%
}}
}
% 基础样式应用.
\beamer@scu@tcbstyle{rb}{scured} {scublue}
\beamer@scu@tcbstyle{yg}{scuyellow}{scugreen}
\if\EqualOptionsBeamer{BlockDisplay}{colorful}%
\beamer@scu@tcbstyletheo{theo}{PrimaryC}%
\beamer@scu@tcbstyletheo{exa} {BlockExampleC}%
\beamer@scu@tcbstyletheo{def} {BlockDefinitionC}%
\beamer@scu@tcbstyletheo{lem} {BlockLemmaC}%
\beamer@scu@tcbstyletheo{cond}{BlockConditionC}%
\beamer@scu@tcbstylecode{PrimaryC}%
\else\if\EqualOptionsBeamer{BlockDisplay}{followtheme}%
\beamer@scu@tcbstyletheo{theo}{PrimaryC}%
\beamer@scu@tcbstyletheo{exa} {PrimaryC}%
\beamer@scu@tcbstyletheo{def} {PrimaryC}%
\beamer@scu@tcbstyletheo{lem} {PrimaryC}%
\beamer@scu@tcbstyletheo{cond}{PrimaryC}%
\beamer@scu@tcbstylecode{PrimaryC}%
\else\if\EqualOptionsBeamer{BlockDisplay}{allgrey}%
\beamer@scu@tcbstyletheo{theo}{BlockExampleC}%
\beamer@scu@tcbstyletheo{exa} {BlockExampleC}%
\beamer@scu@tcbstyletheo{def} {BlockExampleC}%
\beamer@scu@tcbstyletheo{lem} {BlockExampleC}%
\beamer@scu@tcbstyletheo{cond}{BlockExampleC}%
\beamer@scu@tcbstylecode{BlockExampleC}%
\fi\fi\fi
% ----------------
% ----------------
% Tcolorbox Layout
% Confirmed in v1.3a.
% ----------------
% 定义了两个渐变样式( rb 为红蓝渐变, yg 为黄绿渐变)的 Tcolorbox.
% #1: <可选>附加参数.
% #2: 标题.
% ----------------
\newtcolorbox{scutcbrb}[2][]{%
tcbrbstyle, title={#2}, #1%
}
\newtcolorbox{scutcbyg}[2][]{%
tcbygstyle, title={#2}, #1%
}
% ----------------
% ----------------
% Theorem Layout
% Confirmed in v1.3b(2022/04/13).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/30), v1.2a(2022/03/10), v1.3a(2022/03/16).
% ----------------
% 使用 tcolorbox 重定义定理环境, 原始的不带 scu 前缀的定理环境仍可使用.
% ----------------
% 定理区块名称设置.
\if\EqualOptionsBeamer{LanguageMode}{cn}%
\def\beamer@scu@theonametheorem {定理}
\def\beamer@scu@theonameexample {例}
\def\beamer@scu@theonamealgorithm {算法}
\def\beamer@scu@theonamedefinition {定义}
\def\beamer@scu@theonameaxiom {公理}
\def\beamer@scu@theonameproperty {性质}
\def\beamer@scu@theonameproposition{命题}
\def\beamer@scu@theonamelemma {引理}
\def\beamer@scu@theonamecorollary {推论}
\def\beamer@scu@theonamecondition {条件}
\def\beamer@scu@theonameconclusion {结论}
\def\beamer@scu@theonameassumption {假设}
\def\beamer@scu@theonameremark {注}
\def\beamer@scu@theonameproof {证明}
%
\def\beamer@scu@theonametheorem@pl {定理}
\def\beamer@scu@theonameexample@pl {例}
\def\beamer@scu@theonamealgorithm@pl {算法}
\def\beamer@scu@theonamedefinition@pl {定义}
\def\beamer@scu@theonameaxiom@pl {公理}
\def\beamer@scu@theonameproperty@pl {性质}
\def\beamer@scu@theonameproposition@pl{命题}
\def\beamer@scu@theonamelemma@pl {引理}
\def\beamer@scu@theonamecorollary@pl {推论}
\def\beamer@scu@theonamecondition@pl {条件}
\def\beamer@scu@theonameconclusion@pl {结论}
\def\beamer@scu@theonameassumption@pl {假设}
\def\beamer@scu@theonameremark@pl {注}
\def\beamer@scu@theonameproof@pl {证明}
\else\if\EqualOptionsBeamer{LanguageMode}{en}%
\def\beamer@scu@theonametheorem {Theorem}
\def\beamer@scu@theonameexample {Example}
\def\beamer@scu@theonamealgorithm {Algorithm}
\def\beamer@scu@theonamedefinition {Definition}
\def\beamer@scu@theonameaxiom {Axiom}
\def\beamer@scu@theonameproperty {Property}
\def\beamer@scu@theonameproposition{Proposition}
\def\beamer@scu@theonamelemma {Lemma}
\def\beamer@scu@theonamecorollary {Corollary}
\def\beamer@scu@theonamecondition {Condition}
\def\beamer@scu@theonameconclusion {Conclusion}
\def\beamer@scu@theonameassumption {Assumption}
\def\beamer@scu@theonameremark {Remark}
\def\beamer@scu@theonameproof {Proof}
%
\def\beamer@scu@theonametheorem@pl {Theorems}
\def\beamer@scu@theonameexample@pl {Examples}
\def\beamer@scu@theonamealgorithm@pl {Algorithms}
\def\beamer@scu@theonamedefinition@pl {Definitions}
\def\beamer@scu@theonameaxiom@pl {Axioms}
\def\beamer@scu@theonameproperty@pl {Properties}
\def\beamer@scu@theonameproposition@pl{Propositions}
\def\beamer@scu@theonamelemma@pl {Lemmas}
\def\beamer@scu@theonamecorollary@pl {Corollaries}
\def\beamer@scu@theonamecondition@pl {Conditions}
\def\beamer@scu@theonameconclusion@pl {Conclusions}
\def\beamer@scu@theonameassumption@pl {Assumptions}
\def\beamer@scu@theonameremark@pl {Remarks}
\def\beamer@scu@theonameproof@pl {Proofs}
\fi\fi
% theorem, example, algorithm, definition, axiom, property, proposition, lemma, corollary, condition, conclusion, assumption 设置.
% 计数器 - 定理环境.
\newcounter{beamer@scu@theorem@count}
\newcounter{beamer@scu@example@count}
\newcounter{beamer@scu@algorithm@count}
\newcounter{beamer@scu@definition@count}
\newcounter{beamer@scu@axiom@count}
\newcounter{beamer@scu@property@count}
\newcounter{beamer@scu@proposition@count}
\newcounter{beamer@scu@lemma@count}
\newcounter{beamer@scu@corollary@count}
\newcounter{beamer@scu@condition@count}
\newcounter{beamer@scu@conclusion@count}
\newcounter{beamer@scu@assumption@count}
% 定理区块参数设置.
\def\beamer@scu@theo#1#2#3{%
% #1: 后缀 - 环境名称.
% #2: 前缀 - 样式类型.
% #3: 前缀 - 标签.
% 无*环境.
\DeclareTColorBox[use counter=beamer@scu@#1@count,%
% ##1: <可选>附加参数 - Tcolorbox.
% ##2: 标题.
% ##3: <可选>模式选择 - 带 * 即不显示区块标题头.
% ##4: <可选>后缀 - 标签.
number within=section, reset counter on overlays]%
{beamerscuoriginal#1}{ O{} m !s !O{} }{%
title={%
\IfBooleanTF{##3}{\ifstrempty{##2}{}{##2}}{%
\csname beamer@scu@theoname#1\endcsname%
~\thetcbcounter\ifstrempty{##2}{}{:~##2}%
}%
},%
IfValueT={##4}{label={#3\kvtcb@label@sep##4}},%
nameref={##2}, #2style, ##1%
}%
% 带*环境.
\DeclareTColorBox[no counter]%
% ##1: <可选>附加参数 - Tcolorbox.
% ##2: 标题.
% ##3: <可选>模式选择 - 带*即不显示区块标题头.
% ##4: <可选>后缀 - 标签.
{beamerscuoriginal#1*}{ O{} m !s !O{} }{%
title={%
\IfBooleanTF{##3}{\ifstrempty{##2}{}{##2}}{%
\csname beamer@scu@theoname#1\endcsname%
\ifstrempty{##2}{}{:~##2}%
}%
},%
IfValueT={##4}{label={#3\kvtcb@label@sep##4}},%
nameref={##2}, #2style, ##1%
}%
\DeclareDocumentEnvironment{scu#1}%
% ##1: <可选>模式选择 - 带 * 即不显示序号 (目前已实现带星号环境不参与计数器递进).
% ##2: <可选>Overlay选择 - Beamer.
% ##3: <可选>附加参数 - Tcolorbox.
% ##4: 标题.
% ##5: <可选>模式选择 - 带 * 即不显示区块标题前缀.
% ##6: <可选>后缀 - 标签.
{ s D<>{1-} O{} m !s !O{} }{%
\begin{actionenv}<##2>%
\IfBooleanTF{##1}%
{\IfBooleanTF{##5}%
{\begin{beamerscuoriginal#1*}[##3]{##4}*[##6]}%
{\begin{beamerscuoriginal#1*}[##3]{##4}[##6]}}%
{\IfBooleanTF{##5}%
{\begin{beamerscuoriginal#1}[##3]{##4}*[##6]}%
{\begin{beamerscuoriginal#1}[##3]{##4}[##6]}}%
}{\IfBooleanTF{##1}%
{\end{beamerscuoriginal#1*}}%
{\end{beamerscuoriginal#1}}%
\end{actionenv}%
}%
}
\beamer@scu@theo{theorem} {tcbtheo}{theo}
\beamer@scu@theo{example} {tcbexa} {exam}
\beamer@scu@theo{algorithm} {tcbexa} {algo}
\beamer@scu@theo{definition} {tcbdef} {def}
\beamer@scu@theo{axiom} {tcbtheo}{axio}
\beamer@scu@theo{property} {tcbdef} {prope}
\beamer@scu@theo{proposition}{tcbdef} {propo}
\beamer@scu@theo{lemma} {tcblem} {lemm}
\beamer@scu@theo{corollary} {tcblem} {coro}
\beamer@scu@theo{condition} {tcbcond}{cond}
\beamer@scu@theo{conclusion} {tcblem} {conc}
\beamer@scu@theo{assumption} {tcbcond}{assu}
% scuremark 设置.
% 计数器 - 定理环境.
\newcounter{beamer@scu@remark@count}
% 定理区块参数设置.
\DeclareTColorBox[use counter=beamer@scu@remark@count,%
% #1: <可选>附加参数 - Tcolorbox.
% #2: 标题.
% #3: <可选>后缀 - 标签.
no counter]{beamerscuoriginalremark}{ O{} m !O{} }{%
title={\beamer@scu@theonameremark%
\ifstrempty{#2}{}{:~#2}%
},%
IfValueT={#3}{label={rema:#3}},%
nameref={#2}, tcbexastyle, #1%
}
\DeclareDocumentEnvironment{scuremark}%
% #1: <可选>Overlay选择 - Beamer.
% #2: <可选>附加参数 - Tcolorbox.
% #3: 标题.
% #4: <可选>后缀 - 标签.
{ D<>{1-} O{} m !O{} }{%
\begin{actionenv}<#1>%
\begin{beamerscuoriginalremark}[#2]{#3}[#4]%
}{\end{beamerscuoriginalremark}\end{actionenv}}%
% scuproof 设置.
% 计数器 - 定理环境.
\newcounter{beamer@scu@proof@count}
% 定理区块参数设置.
\providecommand\pushQED{\def\beamer@qed}
\DeclareTColorBox[use counter=beamer@scu@proof@count,%
% #1: <可选>附加参数 - Tcolorbox.
% #2: 标题.
% #3: <可选>后缀 - 标签.
no counter]{beamerscuoriginalproof}{ O{} m !O{} }{%
title={% \@addpunct: Be intelligently omitted when punctuation is already present.
\ifblank{#2}{\beamer@scu@theonameproof}{#2}\@addpunct{.}%
},%
IfValueT={#3}{label={rema:#3}},%
nameref={#2}, tcbexastyle, #1%
}
\DeclareDocumentEnvironment{scuproof}%
% #1: <可选>Overlay选择 - Beamer.
% #2: <可选>附加参数 - Tcolorbox.
% #3: 标题.
% #4: <可选>后缀 - 标签.
{ D<>{1-} O{} m !O{} }{%
\begin{actionenv}<#1>%
\begin{beamerscuoriginalproof}[#2]{#3}[#4]%
\pushQED{\qed}%
}{\popQED\end{beamerscuoriginalproof}\end{actionenv}}%
% Beamer 下原始 proof 环境.
%\renewenvironment<>{SCUproof}[1][证明]{%
% \par
% \def\insertproofname{#1\@addpunct{.}}%
% \pushQED{\qed}
% \usebeamertemplate{proof begin}#2}
%{\popQED\usebeamertemplate{proof end}}
% 智能引用名称定义.
\Crefname{beamer@scu@theorem@count}%
{\beamer@scu@theonametheorem}%
{\beamer@scu@theonametheorem@pl}
\Crefname{beamer@scu@example@count}%
{\beamer@scu@theonameexample}%
{\beamer@scu@theonameexample@pl}
\Crefname{beamer@scu@algorithm@count}%
{\beamer@scu@theonamealgorithm}%
{\beamer@scu@theonamealgorithm@pl}
\Crefname{beamer@scu@definition@count}%
{\beamer@scu@theonamedefinition}%
{\beamer@scu@theonamedefinition@pl}
\Crefname{beamer@scu@axiom@count}%
{\beamer@scu@theonameaxiom}%
{\beamer@scu@theonameaxiom@pl}
\Crefname{beamer@scu@property@count}%
{\beamer@scu@theonameproperty}%
{\beamer@scu@theonameproperty@pl}
\Crefname{beamer@scu@proposition@count}%
{\beamer@scu@theonameproposition}%
{\beamer@scu@theonameproposition@pl}
\Crefname{beamer@scu@lemma@count}%
{\beamer@scu@theonamelemma}%
{\beamer@scu@theonamelemma@pl}
\Crefname{beamer@scu@corollary@count}%
{\beamer@scu@theonamecorollary}%
{\beamer@scu@theonamecorollary@pl}
\Crefname{beamer@scu@condition@count}%
{\beamer@scu@theonamecondition}%
{\beamer@scu@theonamecondition@pl}
\Crefname{beamer@scu@conclusion@count}%
{\beamer@scu@theonameconclusion}%
{\beamer@scu@theonameconclusion@pl}
\Crefname{beamer@scu@assumption@count}%
{\beamer@scu@theonameassumption}%
{\beamer@scu@theonameassumption@pl}
\Crefname{beamer@scu@remark@count}%
{\beamer@scu@theonameremark}%
{\beamer@scu@theonameremark@pl}
\Crefname{beamer@scu@proof@count}%
{\beamer@scu@theonameproof}%
{\beamer@scu@theonameproof@pl}
% ----------------
% ----------------
% Listing Layout
% Confirmed in v1.3c(2024/04/16).
% Established in v1.0a(2021/12/03).
% Updated in v1.1a(2021/12/30), v1.2a(2022/03/10), v1.3a(2022/03/16), v1.3c(2024/04/16).
% ----------------
% 定义了一个用作代码演示的 Listing, 和一个不带计数的 Listing.
% ----------------
% 代码区块名称设置.
\if\EqualOptionsBeamer{LanguageMode}{cn}%
\def\beamer@scu@codename{源码}
\def\beamer@scu@codename@pl{源码}
\else\if\EqualOptionsBeamer{LanguageMode}{en}%
\def\beamer@scu@codename{Source Code}
\def\beamer@scu@codename@pl{Source Codes}
\fi\fi
% scucode 设置.
% 计数器 - 定理环境.
\newcounter{beamer@scu@code@count}
% 定理区块参数设置.
\if\EqualOptionsBeamer{CodeDisplay}{minted}%
\if\EqualOptionsBeamer{MintedStyle}{lightmode}%
\tcbset{minted style=default}%
\else\if\EqualOptionsBeamer{MintedStyle}{darkmode}%
\tcbset{minted style=rrt}%
\else\if\EqualOptionsBeamer{MintedStyle}{\beamer@scu@MintedStyle}%
\edef\set@MintedStyle{\noexpand%
\pgfkeys{/tcb, minted style=\beamer@scu@MintedStyle}}%
\set@MintedStyle%
\fi\fi\fi
\renewcommand{\theFancyVerbLine}{%
\sffamily\textcolor{PrimaryC}{%
\tiny\oldstylenums{\arabic{FancyVerbLine}}%
}}%
\DeclareTCBListing[use counter=beamer@scu@code@count,%
% #1: <可选>附加参数 - Tcolorbox.
% #2: 标题.
% #3: <可选>模式选择 - 带 * 即不显示区块标题前缀.
% #4: <可选>后缀 - 标签.
% #5: 抄录语言.
% #6: <可选>附加参数 - minted.
% #7: 注释定界符.
number within=section, reset counter on overlays]%
{scucode}{ O{} m s O{} m !O{} !D''{||} }{%
listing engine=minted,%
minted language={#5},%
minted options={%
autogobble, tabsize=2,%
highlightcolor=HighlightCodeLineC,%
beameroverlays, escapeinside=#7,%
mathescape, texcl,%
breaklines, breakbytokenanywhere,%
linenos, numbersep=2pt,%
fontsize=\scriptsize\ttfamily, #6%
},%
title={%
\IfBooleanTF{#3}{\ifstrempty{#2}{}{#2}}{%
\beamer@scu@codename~\thetcbcounter%
\ifstrempty{#2}{}{:~#2}%
}%
},%
IfValueT={#4}{label={code\kvtcb@label@sep#4}},%
nameref={#2}, codestyle={\faCode}, #1%
}%
\DeclareTCBListing[no counter]%
% #1: <可选>附加参数 - Tcolorbox.
% #2: 标题.
% #3: <可选>模式选择 - 带 * 即不显示区块标题前缀.
% #4: <可选>后缀 - 标签.
% #5: 抄录语言.
% #6: <可选>附加参数 - minted.
% #7: 注释定界符.
{scucode*}{ O{} m s O{} m !O{} !D''{||} }{%
listing engine=minted,%
minted language={#5},%
minted options={%
autogobble, tabsize=2,%
highlightcolor=HighlightCodeLineC,%
beameroverlays, escapeinside=#7,%
mathescape, texcl,%
breaklines, breakbytokenanywhere,%
linenos, numbersep=2pt,%
fontsize=\scriptsize\ttfamily, #6%
},%
title={%
\IfBooleanTF{#3}{\ifstrempty{#2}{}{#2}}{%
\beamer@scu@codename\ifstrempty{#2}{}{:~#2}%
}%
},%
IfValueT={#4}{label={code\kvtcb@label@sep#4}},%
nameref={#2}, codestyle={\faCode}, #1%
}%
\DeclareTCBInputListing[use counter=beamer@scu@code@count,%
% #1: <可选>附加参数 - Tcolorbox.
% #2: 标题.
% #3: <可选>模式选择 - 带 * 即不显示区块标题前缀.
% #4: <可选>后缀 - 标签.
% #5: 抄录语言.
% #6: <可选>附加参数 - minted.
% #7: 文件名.
% #8: 注释定界符.
number within=section, reset counter on overlays]%
{\scucodeinput}{ O{} m s O{} m O{} m !D''{||} }{%
listing file={./sourcecode/#7},%
listing engine=minted,%
minted language={#5},%
minted options={%
autogobble, tabsize=2,%
highlightcolor=HighlightCodeLineC,%
beameroverlays, escapeinside=#7,%
mathescape, texcl,%
breaklines, breakbytokenanywhere,%
linenos, numbersep=2pt,%
fontsize=\scriptsize\ttfamily, #6%
},%
title={%
\IfBooleanTF{#3}{\ifstrempty{#2}{}{#2}}{%
\beamer@scu@codename~\thetcbcounter%
\ifstrempty{#2}{}{:~#2}%
}%
},%
before upper=\scriptsize{以下是文件\texttt{#7}中包含的源码:\vspace{.75ex}},%
IfValueT={#4}{label={code\kvtcb@label@sep#4}},%
nameref={#2}, codestyle={\faFileCode[regular]}, #1%
}
\DeclareTCBInputListing[no counter]%
% #1: <可选>附加参数 - Tcolorbox.
% #2: 标题.
% #3: <可选>模式选择 - 带 * 即不显示区块标题前缀.
% #4: <可选>后缀 - 标签.
% #5: 抄录语言.
% #6: <可选>附加参数 - minted.
% #7: 文件名.
% #8: 注释定界符.
{\scucodeinputnocounter}{ O{} m s O{} m O{} m !D''{||} }{%
listing file={./sourcecode/#7},%
listing engine=minted,%
minted language={#5},%
minted options={%
autogobble, tabsize=2,%