-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsummary-preamble.sty
61 lines (56 loc) · 1.76 KB
/
summary-preamble.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
\usepackage{xstring}
\tcbuselibrary{breakable}
% Colors
\definecolor{KeywordColor}{HTML}{308741}
\definecolor{SubKeywordColor}{HTML}{144f20}
\definecolor{TopicColor}{HTML}{4c4c4c}
\definecolor{IntuitionColor}{HTML}{0f424c}
\definecolor{TopicBorderColor}{HTML}{1e8499}
\newcommand{\keyword}[1]{\textcolor{KeywordColor}{#1}}
\newcommand{\subkeyword}[1]{\textcolor{SubKeywordColor}{#1}}
\newcommand{\intuition}[1]{\textcolor{IntuitionColor}{#1}}
% Arrow
\DeclareFontFamily{U}{mathb}{}
\DeclareFontShape{U}{mathb}{m}{n}{
<-5.5> mathb5
<5.5-6.5> mathb6
<6.5-7.5> mathb7
<7.5-8.5> mathb8
<8.5-9.5> mathb9
<9.5-11> mathb10
<11-> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareMathSymbol{\relatedtopicarrow}{3}{mathb}{"EB}
% Topics
\NewDocumentCommand{\topic}{m +g +g}{
% Args:
% Topic name
% Keyword name (If #3 exists, else Content)
% Content
\textcolor{TopicColor}{\uline{#1}}:
\IfNoValueTF{#3}{\relax}{(\color{SubKeywordColor}\textbf{#2}\color{black})}
\begin{tcolorbox}[
breakable,
boxrule=0pt,
colback=black!2,
left=1mm,
frame hidden,
sharp corners,
enhanced,
borderline west={2pt}{0pt}{TopicBorderColor}]
\IfNoValueTF{#3}{#2}{#3}
\end{tcolorbox}
}
\NewDocumentCommand{\topiccomment}{s m +m}{
% Args:
% *: Make it colored as intuition and omit linebreak
% Comment name
% Content
\begin{itemize}[leftmargin=*]
\item[$\relatedtopicarrow$] \color{\IfBooleanTF{#1}{IntuitionColor}{TopicColor}}\uline{#2}:
\IfBooleanTF{#1}{\relax}{\color{black}\\}#3
\IfBooleanTF{#1}{\color{black}}{\relax}
\end{itemize}
}
\newcommand{\proof}[1]{\topiccomment{Proof}{#1}}