-
Notifications
You must be signed in to change notification settings - Fork 0
/
qu-handout.cls
137 lines (115 loc) · 3.93 KB
/
qu-handout.cls
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
% QU-HANDOUT: Handout/note class for the Queen's courses
% Copyright (c) 2013-2022 Joshua A. Marshall
% Originally created by Joshua A. Marshall on 11 July 2013
\LoadClass[11pt,letterpaper,fleqn,oneside]{article}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{qu-handout}[2021/10/02 QU-HANDOUT class by Joshua A. Marshall]
% Set up page geometry
\RequirePackage[letterpaper,top=1in,left=0.75in,right=0.75in,bottom=1.25in]{geometry}
% Set up page numbers and headers
\RequirePackage{fancyhdr,lastpage}
\setlength{\headheight}{24.75447pt}
% Set up fonts as you like them
% \RequirePackage{cmbright}
% \RequirePackage[OT1]{fontenc}
% For Queen's standard font use this one
\RequirePackage{arev}
\RequirePackage[T1]{fontenc}
\RequirePackage[default,scale=1.05]{opensans}
% \RequirePackage[italic]{mathastext}
\RequirePackage[varqu,varl,scale=1.18]{zi4}
\linespread{1.1}
% Some math packages that give you more symbols
\RequirePackage{amssymb,amsfonts,amsmath,amscd}
% Set some course information variables
\newcommand{\institution}[1]{}
\newcommand{\coursetitle}[1]{}
\newcommand{\term}[1]{}
% Set up the section fonts
\RequirePackage{sectsty}
% Set the caption labeling font
\RequirePackage{caption}
\renewcommand{\captionlabelfont}{\bfseries}
% Load the graphics package for images
\RequirePackage{graphicx}
% For getting the current time
\RequirePackage[useregional]{datetime2}
% Queen's official colors
\RequirePackage[pdftex]{xcolor}
\definecolor{qblue}{RGB}{0,36,82}
\definecolor{qred}{RGB}{185,14,49}
\definecolor{qgold}{RGB}{250,189,15}
\definecolor{qgrey}{RGB}{230,231,232}
\definecolor{qgreen}{RGB}{119,146,33}
\definecolor{qbrown}{RGB}{135,97,64}
\definecolor{qpurple}{RGB}{97,79,135}
% For the framebox
\RequirePackage{framed}
% Gray
\definecolor{shadecolor}{gray}{0.95}
% Blue
\newenvironment{bshaded}
{\colorlet{shadecolor}{qblue!10}\begin{shaded}}
{\end{shaded}}
% Red
\newenvironment{rshaded}
{\colorlet{shadecolor}{qred!10}\begin{shaded}}
{\end{shaded}}
% Yellow
\newenvironment{yshaded}
{\colorlet{shadecolor}{qgold!10}\begin{shaded}}
{\end{shaded}}
% Orange
\newenvironment{gshaded}
{\colorlet{shadecolor}{qgreen!10}\begin{shaded}}
{\end{shaded}}
% Purple
\newenvironment{pshaded}
{\colorlet{shadecolor}{qpurple!10}\begin{shaded}}
{\end{shaded}}
% Define the basic page style for multipage documents
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[C]{}%
\fancyhead[R]{\bf\footnotesize Page~\thepage~of~\pageref{LastPage}}%
\fancyhead[L]{\bf\footnotesize \@title}%
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
% Define the basic page style for single page documents
\fancypagestyle{title}{%
\fancyhf{}%
\fancyfoot[C]{}%
\fancyhead[R]{\bf\footnotesize \term \\ \bf\small Page~\thepage~of~\pageref{LastPage}}%
\fancyhead[L]{\bf\footnotesize \coursetitle \\ \institution} %
\fancyfoot[L]{\bf\footnotesize Copyright \textcopyright\ \the\year\ by \@author \\ Version timestamp \DTMnow}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
% Set the PDF document settings
\RequirePackage{titling}
\RequirePackage[colorlinks]{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=red,
citecolor=green,
filecolor=magenta,
urlcolor=cyan
}
% For nice URL hyperlinks
\RequirePackage{url}
% For underlining stuff in a nice way
\RequirePackage[normalem]{ulem}
% For better looking tables
\RequirePackage{booktabs}
% Customize the abstract
\newenvironment{qabstract}
{\subsubsection*{Abstract}\begin{small}}
{\end{small}}
% For code (usually Python or C/C++)
\RequirePackage[]{minted}
\setminted[python]{linenos=true}
\setminted[c]{linenos=true}
\renewcommand\theFancyVerbLine{\sffamily\footnotesize\arabic{FancyVerbLine}}
\BeforeBeginEnvironment{minted}{\begin{snugshade}}
\AfterEndEnvironment{minted}{\end{snugshade}}
\newcommand*{\mintpy}[1]{\mintinline[bgcolor=shadecolor]{python}{#1}}
\newcommand*{\mintc}[1]{\mintinline[bgcolor=shadecolor]{c}{#1}}