-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmissing.sty
686 lines (627 loc) · 20.5 KB
/
missing.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{missing}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 引入宏包
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[inner=1.25in,outer=1in,vmargin=1in]{geometry}
\RequirePackage{cmbright}
\RequirePackage[quiet]{fontspec}
\RequirePackage{amsmath,amssymb}
\RequirePackage{relsize}
\RequirePackage{tabularray}
\RequirePackage{graphicx,float,wrapfig,caption}
\RequirePackage[x11names]{xcolor}
\RequirePackage{tikz,pdfpages}
\RequirePackage{tcolorbox}
\RequirePackage[fontset=none,zihao=false,scheme=chinese,heading=true,punct=kaiming]{ctex}
\RequirePackage{xeCJKfntef}
\RequirePackage[os=win]{menukeys}
\RequirePackage{pst-barcode}
\RequirePackage{ifplatform}
\RequirePackage{fancyvrb}
\RequirePackage{cprotect}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 部分宏包选项
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TikZ 包
\usetikzlibrary{calc, shapes.geometric}
% tabularray 包
\UseTblrLibrary{booktabs, counter}
% tcolorbox 包
\tcbuselibrary{skins, raster, theorems, breakable, hooks, minted}
\tcbset{%
listing engine = minted,
minted language = C++,
minted style = colorful,
default minted options = {
tabsize = 4,
autogobble,
breaklines,
},
}
% menukeys 包
\renewmenumacro{\keys}[+]{roundedkeys}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 格式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 《你缺计课》代表色
\definecolor[named]{missing}{HTML}{1876C9} % C88 M41 Y0 K21
\definecolor[named]{MissingSkyBlue}{HTML}{BFECFB} % C24 M6 Y0 K2
\definecolor[named]{MissingAquamarine}{HTML}{6BECCD} % C55 M0 Y13 K7
\definecolor[named]{MissingRed}{HTML}{ED2200} % C0 M86 Y100 K7
\definecolor[named]{MissingOrange}{HTML}{FF8100} % C0 M49 Y100 K0
\definecolor[named]{MissingYellow}{HTML}{FFED3B} % C0 M7 Y76 K0
\definecolor[named]{MissingLightYellow}{HTML}{FFFFAD} % C0 M0 Y32 K0
\definecolor[named]{MissingGreen}{HTML}{2DAB41} % C74 M2 Y95 K0
\RequirePackage{fixfoot, xurl}
\RequirePackage{hyperref}
\hypersetup{
% colorlinks,%
% linkcolor=red!80!black,%
bookmarksnumbered=true%
}
\renewcommand{\figurename}{图}
\renewcommand{\figureautorefname}{图}
\renewcommand{\tablename}{表}
\renewcommand{\tableautorefname}{表}
\newcommand{\chapref}[1]{%
\tcbox[enhanced,tcbox raise base,left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=1mm,arc=1mm,colback=MissingLightYellow,frame hidden,nobeforeafter,hyperref={#1}]{\raisebox{.13ex}{\MissingIcons\larger\ref*{#1}} \nameref*{#1}}%
}
\RequirePackage{bookmark}
% 字体
\setmainfont{Inter}[Numbers = Monospaced]
\setsansfont{Inter}[Numbers = Monospaced]
\setmonofont{等距更纱黑体 Slab SC}
\newfontfamily\MissingIcons[ExternalLocation=resources/]{MissingIcons-Regular.otf}
\xeCJKsetup{
underline/skip = false,
AutoFakeSlant = true
}
\xeCJKDeclareSubCJKBlock{Icons}{"E001 -> "E781, "E783 -> "EC64, "EC6C -> "F8B3}
\xeCJKDeclareSubCJKBlock{Symbols}{"22EF, "2261, "278A -> "2793}
\xeCJKDeclareSubCJKBlock{Cross}{"2715}
\setCJKmainfont{思源黑体}[BoldFont=思源黑体 Bold, Icons=Segoe Fluent Icons, Mapping=quote, Symbols=思源黑体, Cross=等距更纱黑体 Slab SC]
\setCJKsansfont{思源黑体}[BoldFont=思源黑体 Bold, Icons=Segoe Fluent Icons, Mapping=quote, Symbols=思源黑体, Cross=等距更纱黑体 Slab SC]
\setCJKmonofont{等距更纱黑体 Slab SC}
% 如果单纯用 punct=kaiming,实际上部分句末点号的宽度还是撑不到 1em。
% 所以手动指派这三个句末点号的宽度好了。
\xeCJKsetwidth{。?!}{1em}
\xeCJKsetkern{」}{?}{1pt}
\xeCJKsetkern{】}{。}{1pt}
% 页眉页脚
\RequirePackage{fancyhdr}
\fancyhf{}
\fancyhead[OR]{\bfseries\color{missing}\rightmark}
\fancyhead[EL]{\bfseries\color{missing}\leftmark}
\fancyfoot[OR]{%
\begin{tikzpicture}[remember picture, overlay]
\fill[fill=MissingAquamarine] (current page.south east) rectangle +(-35mm, 22mm);
\end{tikzpicture}%
\bfseries\large\color{missing}\thepage
}
\fancyfoot[EL]{%
\begin{tikzpicture}[remember picture, overlay]
\fill[fill=MissingAquamarine] (current page.south west) rectangle +(35mm, 22mm);
\end{tikzpicture}%
\bfseries\large\color{missing}\thepage%
}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\headrule}{%
{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
\color{missing}\hrule\@height\headrulewidth\@width\headwidth
\vskip-\headrulewidth}%
}
\setlength{\headheight}{12.5pt}
\pagestyle{fancy}
% 目录
\renewcommand\@pnumwidth{2em}
\renewcommand\tableofcontents%
{\renewcommand\thefootnote{\fnsymbol{footnote}}%
\chapter{\contentsname%
\protect\@mkboth{\contentsname}{\contentsname}}%
\@starttoc{toc}%
\addfontfeatures{RawFeature=-tnum}
\renewcommand\thefootnote{\arabic{footnote}}%
}
% 抄来的「部分」的目录条目的样式
\renewcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus\p@}%
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\begin{tcolorbox}[
colback=missing,
colframe=missing,
colupper=white,
boxrule=0mm,
right=0.5ex,
left=0cm,
arc=.5mm,
width=\textwidth,
enlarge top initially by=-1em,
enlarge bottom finally by=-1em,
grow to right by=0.3em,
grow to left by=0.3em,
]
\leavevmode
\large \bfseries \vbox{\bfseries#1}%
\hb@[email protected]{\hss #2}
\end{tcolorbox}
\vspace*{1ex}
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi
}
%
% 部分、章节的标题
%
% 修复 \chapter* 的页眉问题
\renewcommand{\@schapter}[1]{%
\CTEX@ifnamefalse
\CTEX@makeanchor@schapter{\Hy@chapapp*}%
\CTEX@gettitle{#1}%
\chaptermark{#1}%
\if@twocolumn
\@topnewpage[\@makeschapterhead{#1}]%
\else
\@makeschapterhead{#1}%
\@afterheading
\fi
}
% 「部分」的格式
\newcommand{\partformat}[1]{
\raggedright
\tikz[remember picture,overlay] \node at (current page.center) {\includegraphics{assets/missing-parts-bg.pdf}};
\hspace*{5cm}\parbox[t][19cm]{98mm}{#1}
}
\newcommand{\partaftername}{
\CTEXifname{
\par
\begingroup
\color{missing}
\rule[4pt]{98mm}{1.6mm}
\raggedleft\fontsize{24pt}{12pt}\selectfont
PART \thepart\par
\endgroup
\vskip17mm
}{
\par
\begingroup
\color{missing}
\rule[4pt]{98mm}{1.6mm}
\raggedleft\fontsize{24pt}{12pt}\selectfont
APPENDIX\par
\endgroup
\vskip17mm
}
}
\def\partintro{}
\newcommand{\partaftertitle}{%
\par\vskip40mm%
\begingroup
\ifx\partintro\empty
\else
\fontsize{14pt}{17pt}\normalfont\selectfont
\begin{partintrobox}
\partintro
\end{partintrobox}
\fi
\endgroup
}
% 自定义图标
\newcounter{noheadchap}
\def\noheadsymb#1{\expandafter\@noheadsymb\csname c@#1\endcsname}
\def\@noheadsymb#1{%
\ifcase#1%
\or 0\or 1\or 2%
\else\@ctrerr
\fi
}
\renewcommand\thenoheadchap{\noheadsymb{noheadchap}}
\setcounter{noheadchap}{0}
\def\chaptersymb#1{\expandafter\@chaptersymb\csname c@#1\endcsname}
\def\@chaptersymb#1{%
\ifcase#1%
% 按照「部分」分割
A\or B\or C\or D\or E\or F\or G\or% 第一部分
H\or I\or J\or K\or L\or M\or% 第二部分
N\or O\or P\or Q\or R\or S\or% 第三部分
T\or U\or V\or W% 第四部分
\else\@ctrerr
\fi
}
% 「章节」的格式
\newcommand{\chapterformat}[1]{
\CTEXifname{%
\bfseries\raggedright#1%
}{%
\begin{tikzpicture}[remember picture, overlay]
\fill[fill=missing] (current page.north east) -- +(0, -53.8mm) -- +(-140mm, -53.8mm) -- +(-140mm, 0) -- cycle;
\fill[fill=MissingAquamarine] (current page.north west) -- +(0, -77mm) -- +(63mm, -77mm) -- +(88mm, 0) -- cycle;
\draw[color=missing, line width=1.8pt] ($(current page.north west) + (31.8mm, -53.5mm)$) -- +(38.9mm, 0);
\draw[color=MissingAquamarine, line width=1.8pt] ($(current page.north west) + (70.7mm, -53.5mm)$) -- +(114mm, 0);
\end{tikzpicture}%
\stepcounter{noheadchap}
\bfseries\noindent
\begingroup
\Huge\raggedleft\color{white}
\MissingIcons\thenoheadchap\par
\endgroup
\vskip6mm\relax%
#1
}
}
\newcommand{\chapternumberformat}[1]{\sbox0{#1}\chinese{chapter}}
\newcommand{\chapternameformat}[1]{%
\begin{tikzpicture}[remember picture, overlay]
\fill[fill=missing] (current page.north west) -- +(0, -53.8mm) -- +(88mm, -53.8mm) -- +(88mm, 0) -- cycle;
\fill[fill=MissingAquamarine] (current page.north east) -- +(0, -77mm) -- +(-148mm, -77mm) -- +(-122mm, 0) -- cycle;
\draw[color=MissingAquamarine, line width=1.8pt] ($(current page.north west) + (31mm, -53.5mm)$) -- +(39mm, 0);
\draw[color=missing, line width=1.8pt] ($(current page.north west) + (70mm, -53.5mm)$) -- +(116mm, 0);
\end{tikzpicture}%
\huge\noindent\raggedleft\color{white}%
\parbox{5.5em}{#1}
}
\newcommand{\chapteraftername}{\hspace*{3mm}%
\begingroup\fontsize{28pt}{30pt}\selectfont\color{missing}\MissingIcons\chaptersymb{chapter}\par\endgroup%
\vskip6mm\relax%
}
\ctexset{
part = {
pagestyle = empty,
format = \partformat,
nameformat = \bfseries\fontsize{36pt}{38pt}\selectfont\noindent\color{missing},
aftername = \partaftername,
titleformat = \bfseries\fontsize{64pt}{72pt}\selectfont\centering,
aftertitle = \partaftertitle,
},
chapter = {
format = \chapterformat,
number = \chaptersymb{chapter},
numberformat= \chapternumberformat,
nameformat = \chapternameformat,
aftername = \chapteraftername,
titleformat = \Huge\CTEXifname{\raggedleft}{\raggedright},
beforeskip = 18pt,
tocline = {\CTEXifname{\protect\numberline{第\chinese{chapter}章\hspace{.3em}}}{}#2},
},
}
\renewcommand{\chaptermark}[1]{%
\markboth{\CTEXifname{第\chinese{chapter}章}{}\hspace{1em}#1}{\CTEXifname{第\chinese{chapter}章}{}\hspace{1em}#1}%
}
% 切换到附录时要重定义许多东西
\let\oldappendix\appendix
\renewcommand{\appendix}{
\oldappendix%
\renewcommand{\chapternumberformat}[1]{\sbox0{##1}\Alph{chapter}}%
\renewcommand{\chapteraftername}{\hspace*{3mm}%
\begingroup\fontsize{28pt}{30pt}\selectfont\color{missing}\MissingIcons\alph{chapter}\par\endgroup%
\vskip6mm\relax%
}
\ctexset{
chapter = {
number = \appendixsymb{chapter},
tocline = {\CTEXifname{\protect\numberline{附录 \Alph{chapter}\hspace{.3em}}}{}##2},
}
}
\renewcommand{\chaptermark}[1]{%
\markboth{\CTEXifname{附录 \Alph{chapter}}{}\hspace{1em}##1}{\CTEXifname{附录 \Alph{chapter}}{}\hspace{1em}##1}%
}
}
% 把「部分导读」塞到 \part 里面
\let\oldpart\part
\RenewDocumentCommand\part{m+o}{
\IfNoValueTF{#2}{%
\def\partintro{}%
}{%
\def\partintro{#2}%
}%
\oldpart{#1}
\def\partintro{}
}
% 列表
\renewcommand{\theenumii}{\Alph{enumii}}
% 禁止随意断词
\hyphenation{macOS}
% 禁止乱加空格
\let\oldtexttt\texttt
\def\clearglue{\xeCJKsetup{CJKecglue = {}}}
\def\restoreglue{\xeCJKsetup{CJKecglue = { }}}
\renewcommand{\texttt}[1]{
\protect\clearglue
\oldtexttt{#1}
\protect\restoreglue
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 空白双数页
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cleardoublepage}
{\clearpage
\if@twoside
\ifodd
\c@page
\else
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn
\hbox{}
\newpage
\fi
\fi
\fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 自定义命令
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 强调文字
\newcommand{\regcolor}[1]{\textbf{{\color{missing} #1}}}
% Windows 徽标
\newcommand\Windows{
\begin{tikzpicture}[scale=1, menukeys key symbol, yshift=-.25ex]
\draw[fill=black] (0,0) rectangle (.8ex, .8ex);
\draw[fill=black] (1.1ex,0) rectangle (1.9ex, .8ex);
\draw[fill=black] (0,1.1ex) rectangle (.8ex, 1.9ex);
\draw[fill=black] (1.1ex,1.1ex) rectangle (1.9ex, 1.9ex);
\end{tikzpicture}%
}
\newcommand\WindowsTen{
\begin{tikzpicture}[scale=1.1, menukeys key symbol, yshift=.7ex]
\draw[fill=black] (0.25ex,0) -- (.85ex, 0) -- (.85ex, .55ex) -- (0.25ex, .444ex) -- cycle;
\draw[fill=black] (1.1ex,0) -- (1.95ex, 0) -- (1.95ex, .744ex) -- (1.1ex, .594ex) -- cycle;
\begin{scope}[yshift=-.25ex]
\draw[fill=black] (0.25ex,0) -- (.85ex, 0) -- (.85ex, -.55ex) -- (0.25ex, -.444ex) -- cycle;
\draw[fill=black] (1.1ex,0) -- (1.95ex, 0) -- (1.95ex, -.744ex) -- (1.1ex, -.594ex) -- cycle;
\end{scope}
\end{tikzpicture}%
}
% 标题页
\renewcommand{\maketitle}{%
\begin{titlepage}
\pdfbookmark{标题页}{title}
\thispagestyle{empty}
\includepdf[pages=1]{assets/missing-cover.pdf}
\clearpage
\pdfbookmark{版权信息页}{copyright}
\setlength{\parskip}{0.3cm}
\setlength{\parindent}{0em}
排版时间:\@date \\
排版环境:
\ifwindows
Windows \\
\fi
\iflinux
Linux \\
\fi
\ifmacosx
macOS \\
\fi
内容提交哈希:\texttt{\input{chapters/commit}} \\
小样提交哈希:\texttt{\input{.git/refs/heads/main}} \\
\begin{pspicture}(2in,0.6in)
\psbarcode[file]{.git/refs/heads/main}{height=0.4}{pdf417}
\end{pspicture}
\vfill
\includegraphics[width=4cm]{assets/CC_sign.pdf}\par
《你缺失的那门计算机课》开源 PDF 版\\版权所有 \textcopyright{} 2021--\the\year{} Hans Wan 和 Windy Deng。\vskip3mm\relax\par
\setlength{\parskip}{0pt plus 1pt}
\setlength{\parindent}{2em}
《你缺失的那门计算机课》开源 PDF 版(下称「本作品」)中的所有原创内容及设计整体,除非特别说明,均以知识共享署名—非商业性使用—相同方式共享 4.0 协议国际版(CC BY-NC-SA 4.0)协议授权。要查看该许可协议,可访问 \url{https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh}。您可以在协议允许的范围内自由地分享、复制本作品的内容及基于本作品内容进行创作,但必须注明原作者和链接,并且不得用于任何商业目的。请参阅「二次创作指南」一章了解更多信息。\par
\begin{danger}
本作品可免费获取。如果您从任何渠道购买了此开源 PDF 版本,请尽快要求退款并向我们举报。本作品的实体书版本将由清华大学出版社正式出版,如有购买意向,敬请关注我们的网站获取最新资讯。
\end{danger}
本作品所有内容「按原样」提供,并且不含有任何明示或者暗示的担保。我们不保证本作品中任何部分的绝对正确。若您认为本文中叙述的内容与您从其他地方看到的不同甚至相悖,请遵循您自己的判断。本作品所涉及的知识和操作均基于 Windows 操作系统。如果您使用其他操作系统,本作品中的内容可能不适用。\par
为便于进行讲解,本作品中使用了一些来自互联网的图片等素材,它们的具体来源和许可已在「借物表」一章中逐一列明。本作品中出现的所有商标、标志及相关知识产权,无论是否标注有 ® 或 ™ 及其他标识,均归属它们各自的权利持有人所有。引用这些商标或标志仅用于识别和介绍相关产品、服务或公司,并无意侵犯其商标或版权。本作品为了教学和演示目的,提及并展示了一些计算机软件。这些软件的所有权利均归各自的版权所有者所有。\par
\clearpage
\end{titlepage}
}%
% 练习
\newcommand{\practice}{\section*{练习 \thechapter}\addcontentsline{toc}{section}{练习 \thechapter}}
% 自定义盒子
\newtcolorbox{note}{
enhanced,
colback=MissingSkyBlue,
colframe=missing,
toprule=0pt,
bottomrule=0pt,
leftrule=11mm,
rightrule=0pt,
arc=2.5mm,
height from=1.2cm to 30cm,
left=3mm,
right=3mm,
valign=center,
breakable=true,
before upper={\parindent2em},
frame code app={%
\node[regular polygon, regular polygon sides=6, color=white, fill, draw, line width=8pt, line join=round, minimum size=.8cm, rotate=90, yscale=.7333] at ($(frame.west) + (5.2mm,0)$) {};
\draw[color=missing, line width=2pt, line cap=round] ($(frame.west) + (5.2mm,0) - (36:.38)$) -- +(36:.76);
\node[color=missing] at ($(frame.west) + (5.2mm,0) + (120:.23)$) {\bfseries\Large?};
\node[color=missing] at ($(frame.west) + (5.2mm,0) - (130:.25)$) {\bfseries\Large!};
},
extras broken={%
overlay={%
\node[regular polygon, regular polygon sides=6, color=white, fill, draw, line width=8pt, line join=round, minimum size=.8cm, rotate=90, yscale=.7333] at ($(frame.west) + (5.2mm,0)$) {};
\draw[color=missing, line width=2pt, line cap=round] ($(frame.west) + (5.2mm,0) - (36:.38)$) -- +(36:.76);
\node[color=missing] at ($(frame.west) + (5.2mm,0) + (120:.23)$) {\bfseries\Large?};
\node[color=missing] at ($(frame.west) + (5.2mm,0) - (130:.25)$) {\bfseries\Large!};
},
},
}
\newtcolorbox{quoting}{
enhanced,
colback=MissingLightYellow,
frame hidden,
enlarge top initially by=2mm,
enlarge bottom finally by=2mm,
left=3mm,
right=3mm,
arc=2.5mm,
before upper={\parindent2em},
overlay={
\node[color=gray] at ($(frame.north west) + (0,-8mm)$) {\fontsize{70pt}{70pt}“};
\node[color=gray] at ($(frame.south east) + (0,-6mm)$) {\fontsize{70pt}{70pt}”};
},
}
\newtcolorbox{partintrobox}{
enhanced,
colback=MissingAquamarine,
frame hidden,
left=1ex,
right=1ex,
top=1.2ex,
bottom=1.2ex,
text width=100mm,
grow to right by=12mm,
grow to left by=-12mm,
arc=2.5mm,
before upper={\parindent2em},
}
\newtcolorbox{intro}{
enhanced,
colback=MissingSkyBlue,
colframe=missing,
colbacktitle=MissingSkyBlue,
coltitle=missing,
sharp corners=northwest,
enlarge top initially by=-1cm,
left=3mm,
right=3mm,
attach boxed title to top left={yshift=-.5mm},
boxed title style={
skin=enhancedfirst jigsaw,
boxrule=.5mm,
},
fonttitle=\bfseries\large,
title=本章导览,
before upper={\parindent2em},
}
\newtcolorbox{warning}{
enhanced,
breakable=true,
top=3mm,
left=3mm,
right=3mm,
colframe=MissingOrange,
colback=white,
colbacktitle=MissingOrange,
coltext=MissingOrange,
coltitle=white,
attach boxed title to top left={xshift=.5cm, yshift=-\tcboxedtitleheight/2},
fonttitle=\bfseries,
fontupper=\bfseries,
boxed title style={
top=-1mm,
bottom=-1mm,
left=1mm,
right=0mm,
},
title={
\tikz {
\draw[rounded corners=.5pt, line width=.8pt, draw=black, fill=MissingYellow] (0,0) -- (0:10pt) -- (60:10pt) -- cycle;
\draw[line width=1pt, line cap=round, draw=black] (5pt,3pt) -- (5pt,6pt);
\fill[black] (5pt,1.5pt) circle [radius=.7pt];
\node[color=white] at (25pt, 4.7pt) {\bfseries 注意};
}
},
before upper={\parindent2em},
}
\newtcolorbox{danger}{
enhanced,
breakable=true,
top=3mm,
left=3mm,
right=3mm,
colframe=MissingRed,
colback=white,
colbacktitle=MissingRed,
coltext=MissingRed,
coltitle=white,
attach boxed title to top center={yshift=-\tcboxedtitleheight/2},
fonttitle=\bfseries,
fontupper=\bfseries,
boxed title style={
top=-1mm,
bottom=-1mm,
left=1mm,
right=0mm,
},
title={
\tikz {
\draw[rounded corners=.5pt, line width=.8pt, draw=black, fill=MissingYellow] (0,0) -- (0:10pt) -- (60:10pt) -- cycle;
\draw[line width=1pt, line cap=round, draw=black] (5pt,3pt) -- (5pt,6pt);
\fill[black] (5pt,1.5pt) circle [radius=.7pt];
\node[color=white] at (25pt, 4.7pt) {\bfseries 警告};
}
},
before upper={\parindent2em},
}
\NewTotalTCBox{\MissingTT}{ m }{%
fontupper=\ttfamily,
nobeforeafter,
tcbox raise base,
arc=0pt,
outer arc=0pt,
top=0pt,
bottom=0pt,
left=0mm,
right=0mm,
leftrule=0pt,
rightrule=0pt,
toprule=0.3mm,
bottomrule=0.3mm,
boxsep=0.5mm,
colback=MissingSkyBlue,
colframe=missing,
before upper={\clearglue},
after upper={\restoreglue},
}{%
\vphantom{六}#1%
}
\NewTotalTCBox{\MissingVerb}{ v }{%
fontupper=\ttfamily,
nobeforeafter,
tcbox raise base,
arc=0pt,
outer arc=0pt,
top=0pt,
bottom=0pt,
left=0mm,
right=0mm,
leftrule=0pt,
rightrule=0pt,
toprule=0.3mm,
bottomrule=0.3mm,
boxsep=0.5mm,
colback=MissingSkyBlue,
colframe=missing,
before upper={\clearglue},
after upper={\restoreglue},
}{%
\vphantom{六}#1%
}
\NewTCBListing{MissingVerbatim}{s O{text} O{0pt}}{%
breakable,
IfBooleanTF = {#1}
{enforce breakable}
{},
break at = #3,
enhanced,
arc=0pt,
left=3mm,
right=3mm,
leftrule=0pt,
rightrule=0pt,
toprule=0.3mm,
bottomrule=0.3mm,
colback=MissingSkyBlue,
colframe=missing,
listing only,
minted language = #2,
before upper={\clearglue},
after upper={\restoreglue},
}