-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcommon-header.input
140 lines (129 loc) · 4.43 KB
/
common-header.input
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
% Cornell CS 2043: Unix Tools and Scripting
% Spring 2016
%
% http://cs2043-sp16.github.io/
%
% This file is to be included for various packages and commands to be declared, without having to copy-paste
% all of them. This may eventually turn into a .sty, it may not. Example usage:
%
% In file lecture01/lecture01.tex:
% \include{../common.tex}
%
% This file is neither a style file, nor is a document class. It's just me being lazy and not wanting to have
% to write all of these every time, but still being able to modify them when I find a new package I want
% to use. Though arguably terrible form, this is TeX after all...it was never pretty.
%
% Initial theme setup
%
\documentclass[11pt]{beamer}
\usetheme{metropolis}
\metroset{background=dark} % easier on the eyes, in my opinion
\setbeamertemplate{bibliography item}{\insertbiblabel}
%
% The Fira Sans mono font is a little too fancy...the ampersands and various other mono-spaced fonts of \ttfamily
% inputs are borderline insulting.
%
% The desire here is to have absolutely no fancy anything with \ttfamily environments such as \texttt{} and
% \begin{minted} ... \end{minted} so that the text will copy-paste directly from the pdf to the terminal.
%
% Getting DejaVu Mono: http://tex.stackexchange.com/a/84818
% No modifications at all: http://tex.stackexchange.com/a/103242
%
\usepackage{fontspec}
\setmonofont[
Extension = .ttf ,
Ligatures = {NoCommon, NoRequired, NoContextual, NoHistoric, NoDiscretionary},
UprightFont = * ,
ItalicFont = *-Oblique ,
BoldFont = *-Bold ,
BoldItalicFont = *-BoldOblique
]{DejaVuSansMono}
%
% Linking
%
\usepackage{hyperref}
%
% Nicer tables
%
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
% Finer control over enumerations
% example:
% \begin{enumerate}[(1)]
% \item first
% \item second
% \item ...
% \end{enumerate}
%
% and also
%
% \begin{enumerate}[a)]
% \begin{enumerate}[i.]
% \begin{enumerate}[$\mathbb{R}$\textsuperscript{\arabic{enumi}}]
%
% and so on
\usepackage{enumerate}
% Many people online prefer the enumitem package, but it causes a lot of issues with
% beamer. I do not want to change where bullets show up (margin-wise) for the *entire*
% document, but I do want the ability to "de-indent" bullets on a slide selectively.
%
% Grab the appropriate length: http://tex.stackexchange.com/a/103257
\newlength\origLeftMarginI
\setlength\origLeftMarginI\leftmargini
\def\gobbledItems{\setlength{\leftmargini}{0em}}
\def\restoreItems{\setlength{\leftmargini}{\origLeftMarginI}}
%
% Define a new itemize. I called it leftemize because I am lazy and want to be able to
% keep my item+tab sublime glory, and changing itemize to leftemize is just a short
% ctrl+d and arrow away. The 1 as input allows for [<+- | alert@+>] on a leftemize.
\newenvironment{leftemize}[1][]{
\gobbledItems
\begin{itemize}[#1]
}{
\end{itemize}
\restoreItems
}
%
% Sultry code listings
%
\usepackage{minted}
\BeforeBeginEnvironment{minted}{\begin{block}{}} % These surround minted code with beamer blocks
\AfterEndEnvironment{minted}{\end{block}} % to accentuate them
\usemintedstyle{monokai}
%
% Colors thanks to various themes from Monokai: http://www.colourlovers.com/lover/Monokai
%
\definecolor{make-it-concrete}{rgb}{0.670588, 0.666667, 0.596078} % (171, 170, 152) / 255
\definecolor{cheap-carpet}{rgb}{0.145098, 0.196078, 0.200000}% (37,50,51) / 255
\definecolor{hairball}{rgb}{0.403922, 0.411765, 0.380392}% (103,105,97) / 255
%
% General slide coloring
%
\setbeamercolor{frametitle}{% adjusts too-white colors from beamer-metropolis
bg=hairball!66,
fg=cheap-carpet
}
\setbeamercolor{normal text}{
bg=mDarkTeal, % note: defined by beamer-metropolis
fg=hairball!44
}
%
% Beamer-block shaping and colors
%
\setbeamertemplate{blocks}[rounded]
\setbeamercolor{block title}{
bg=make-it-concrete!66,
fg=cheap-carpet
}
\setbeamercolor{block body}{
bg=cheap-carpet,
fg=make-it-concrete!66
}
%
% Custom commands
%
\newcommand{\colbf}[1]{\textcolor{mLightBrown!77!black}{#1}}% bold with color; mLightBrown defined by beamer-metropolis
\newcommand{\tsub}{\textsubscript} % more compact
\newcommand{\tsup}{\textsuperscript} % " " " " " "
\def\wl{\par \vspace{\baselineskip}} % force newline; MANY thanks:
% https://groups.google.com/d/msg/comp.text.tex/abxw5nTALzg/puXHnyx6pM8J