forked from steventhornton/Matlab-Cheatsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmcs_style.sty
144 lines (118 loc) · 3.89 KB
/
mcs_style.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
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\usetikzlibrary{shadings,shadows}
\usepackage[hidelinks]{hyperref}
% --------------------------------------
% Set the margins
% --------------------------------------
\usepackage[top=0.5in,left=0.25in,right=0.25in,bottom=0.5in]{geometry}
% --------------------------------------
% Set up the fonts
% --------------------------------------
\usepackage[T1]{fontenc}
\usepackage[no-math]{fontspec}
\setmonofont[Path=Fonts/]{FiraMono-Regular}
\setsansfont[BoldFont={FiraSans-Regular},
Path=Fonts/]{FiraSans-Light}%
\renewcommand{\familydefault}{\sfdefault}
% --------------------------------------
% Load the ams packages
% --------------------------------------
\usepackage{amsmath, amsfonts, amssymb}
% --------------------------------------
% Set the header/footer
% --------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{\textbf{Steven E. Thornton}}
\cfoot{\textbf{\href{http://steventhornton.ca}{steventhornton.ca}}}
\rfoot{\textbf{Updated:} \today}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrulewidth}{0pt}
% --------------------------------------
\usepackage{multicol}
\usepackage{parskip}
\usepackage{tabularx}
% --------------------------------------
% Define the colors
% --------------------------------------
\definecolor{BlockBackground}{HTML}{F4F4F4}
\definecolor{Header}{HTML}{3583B9}
\definecolor{row1}{HTML}{BFDAEF}
\rowcolors{2}{row1!75}{white}
\newenvironment{exampleBlock}[1]{%
\tcolorbox[%
/tcb/sharp corners=all,
arc=0mm,%
noparskip,
breakable,
colback=BlockBackground,%
colframe=Header,%
title=\large\textbf{#1}]}%
{\endtcolorbox}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}
\usepackage[super]{nth}
% --------------------------------------
% Minted
% --------------------------------------
\usepackage{minted}
\usemintedstyle{autumn}
\definecolor{mintedbackground}{rgb}{0.97, 0.97, 0.97}
\newminted[mcode]{matlab}{tabsize=4, fontsize=\small, framesep=7\fboxrule,bgcolor=white}
\newmintedfile[matlabcode]{matlab}{
fontfamily=tt,
fontsize=\small,
numbersep=12pt,
numbersep=5pt,
gobble=0,
framesep=2mm,
funcnamehighlighting=true,
tabsize=4,
obeytabs=false,
mathescape=false
samepage=false,
showspaces=false,
showtabs =false,
texcl=false,
}
% -------------------------------------------------
% Environment for the tables on the first page
% -------------------------------------------------
\newcommand{\chline}[1]{\arrayrulecolor{#1}\hline}
\usepackage{makecell} % Needed for the Gape command
\usepackage{array}
\usepackage{tabularx}
\usepackage{colortbl}
\setlength{\tabcolsep}{10pt} % Separation between columns in the tables
\setlength{\arrayrulewidth}{2pt} % Width of the rules for the tables
\newenvironment{fancytable}[1]
{\def\arraystretch{1.3}
\tabularx{0.46\textwidth}{lX}
\rowcolor{Header}
\multicolumn{2}{l}{\textcolor{white}{\large\bfseries \Gape[1mm][1mm]{#1}}}\\}
{\endtabularx}
% -------------------------------------------------
% Page header
% -------------------------------------------------
\def\fullwidthheader#1{
\begin{tikzpicture}[overlay, remember picture]
\draw let \p1 = (current page.west),%
\p2 = (current page.east) in
node[minimum width=\x2-\x1,
minimum height=2cm,
draw,
rectangle,
fill=Header,
draw=Header,
anchor=north west,
align=left,
text width=\x2-\x1]
at ($(current page.north west)$)
{\fontsize{20}{22}\selectfont\bfseries\color{white}\quad #1};
\end{tikzpicture}
}
\usepackage{microtype}
% Remove page numbers
\pagenumbering{gobble}