blob: 7db70cbaf66c5286c01dbd29432e44265d90e99f (
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
|
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{awesomebox}[2018/11/26 v0.4]
% Awesome Box has been written by Étienne Deparis and is released under
% the WTFPL (http://www.wtfpl.net/txt/copying/).
% A copy of this license is distributed in this package.
%
% Contributors:
% v0.2: Vincent Goulet https://github.com/vigou3
% v0.3: Gilbert Fuerer https://github.com/foreachthing
% * Remove xelatex/luatex requirement and add pdflatex compatibility
% v0.4: Marcel Krüger https://github.com/zauguin
% * Fontawesome5 compatibility
% Gilbert Fuerer
% * Custom rule color
% Try to just depend on fontawesome5 package
% https://ctan.org/pkg/fontawesome5
\RequirePackage{fontawesome5}
% Compatibility with old version of this package
\def\abIconCheck{\faCheck}
\def\abIconInfoCircle{\faInfoCircle}
\def\abIconFire{\faFire}
\def\abIconExclamationCircle{\faExclamationCircle}
\def\abIconExclamationTriangle{\faExclamationTriangle}
\def\abIconCogs{\faCogs}
\def\abIconThumbsUp{\faThumbsUp}
\def\abIconThumbsDown{\faThumbsDown}
\def\abIconCertificate{\faCertificate}
\def\abIconLightBulb{\faLightbulb[regular]}
\def\abIconTwitter{\faTwitter}
\def\abIconGithub{\faGithub}
% https://ctan.org/pkg/xcolor
\RequirePackage{xcolor}
% Some basic colors
\definecolor{abnote}{RGB}{25,64,122}
\definecolor{abcaution}{RGB}{188,50,0}
\definecolor{abwarning}{RGB}{188,103,0}
\definecolor{abimportant}{RGB}{188,0,0}
\definecolor{abvrulecolor}{RGB}{221,221,216}
\newlength{\aweboxleftmargin}
\setlength{\aweboxleftmargin}{9mm}
\newlength{\aweboxvskip}
\setlength{\aweboxvskip}{5mm}
\newlength{\aweboxsignraise}
\setlength{\aweboxsignraise}{-5mm}
\newlength{\aweboxrulewidth}
\setlength{\aweboxrulewidth}{2pt}
% https://ctan.org/pkg/tabu
\RequirePackage{tabu}
% Commands API
% \awesomebox[rulecolor]{rulewidth}{icon}{iconcolor}{content}
\newcommand{\awesomebox}[5][abvrulecolor]{%
\vspace{\aweboxvskip}
\noindent
\begin{tabu} to \linewidth
{m{\aweboxleftmargin}!{\color{#1}\vrule width #2}X}
\raisebox{\aweboxsignraise}{\textcolor{#4}{\Huge#3}} & #5 \\
\end{tabu}
\vspace{\aweboxvskip}}
\newcommand{\notebox}[1]{%
\awesomebox[abnote]{\aweboxrulewidth}{\abIconInfoCircle}{abnote}{#1}}
\newcommand{\tipbox}[1]{%
\awesomebox{\aweboxrulewidth}{\abIconLightBulb}{black}{#1}}
\newcommand{\warningbox}[1]{%
\awesomebox[abwarning]{\aweboxrulewidth}{\abIconExclamationTriangle}{abwarning}{#1}}
\newcommand{\cautionbox}[1]{%
\awesomebox[abcaution]{\aweboxrulewidth}{\abIconFire}{abcaution}{#1}}
\newcommand{\importantbox}[1]{%
\awesomebox[abimportant]{\aweboxrulewidth}{\abIconExclamationCircle}{abimportant}{#1}}
% Environments API
% \begin{awesomeblock}[rulecolor]{rulewidth}{icon}{iconcolor}
% content
% \end{awesomeblock}
\newenvironment{awesomeblock}[4][abvrulecolor]%
{\vspace{\aweboxvskip}\noindent
\begin{tabu} to \linewidth %
{m{\aweboxleftmargin}!{\color{#1}\vrule width #2}X}%
\raisebox{\aweboxsignraise}{\textcolor{#4}{\Huge#3}} & }
{\\\end{tabu}\vspace{\aweboxvskip}}
\newenvironment{noteblock}%
{\begin{awesomeblock}[abnote]{\aweboxrulewidth}{\abIconInfoCircle}{abnote}}
{\end{awesomeblock}}
\newenvironment{tipblock}%
{\begin{awesomeblock}{\aweboxrulewidth}{\abIconLightBulb}{black}}
{\end{awesomeblock}}
\newenvironment{warningblock}%
{\begin{awesomeblock}[abwarning]{\aweboxrulewidth}{\abIconExclamationTriangle}{abwarning}}
{\end{awesomeblock}}
\newenvironment{cautionblock}%
{\begin{awesomeblock}[abcaution]{\aweboxrulewidth}{\abIconFire}{abcaution}}
{\end{awesomeblock}}
\newenvironment{importantblock}%
{\begin{awesomeblock}[abimportant]{\aweboxrulewidth}{\abIconExclamationCircle}{abimportant}}
{\end{awesomeblock}}
\endinput
|