forked from XiangyunHuang/ElegantBookdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
62 lines (52 loc) · 1.49 KB
/
preamble.tex
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
\definecolor{customcolor}{RGB}{32,178,170}
\colorlet{coverlinecolor}{customcolor}
% 下面如果不注释就准备好 Logo 和封面图片
% \logo{logo-blue.png} % 图片尺寸 1:1
% \cover{cover.jpg} % 图片尺寸 1280 × 1024
% Cancel common factors in Math
\usepackage[makeroom]{cancel}
\usepackage[export]{adjustbox} %Needed for max width
%\patchcmd{<command>}{<code to replace>}{<code>}{<success>}{<failure>}
%The following codes add max dimension option to includegraphics
%Gin@ii is from graphicx package and looks for a second optional argument
\expandafter\patchcmd\csname Gin@ii\endcsname
{\setkeys{Gin}{#1}}
{\setkeys{Gin}{max width=\textwidth, max height=.5\textwidth,keepaspectratio,#1}}
{}
{}
\definecolor{colortip}{RGB}{81,183,73}
\definecolor{colornote}{RGB}{251,188,5}
\definecolor{colorwarn}{RGB}{255,83,59}
\definecolor{colorinfo}{RGB}{204,204,204}
\tcbset{
colbacktitle=white,
enhanced,
attach boxed title to top center={yshift=-2mm},
colback=white, % 背景色
coltext=black, % 文本色
leftrule=1mm,
rightrule=.25mm,
bottomrule=.25mm,
toprule=.25mm,
boxsep=1pt, % 文字和边框的空隙
arc=1pt % 圆角
}
\newtcolorbox{rmdtip}[1]{
title=#1,
coltitle=colortip,
colframe=colortip, % 边框色
}
\newtcolorbox{rmdnote}[1]{
title=#1,
coltitle=colornote,
colframe=colornote % 边框色
}
\newtcolorbox{rmdwarn}[1]{
title=#1,
coltitle=colorwarn,
colframe=colorwarn % 边框色
}
\newtcolorbox{rmdinfo}{
colframe=colorinfo % 边框色
}
\frontmatter