This repository was archived by the owner on Aug 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheatsheet-example.tex
More file actions
106 lines (83 loc) · 2.35 KB
/
Copy pathcheatsheet-example.tex
File metadata and controls
106 lines (83 loc) · 2.35 KB
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
\documentclass[%
a4paper, % paper size
landscape, % landscape format
english, % language of the document
7pt, % font size
fleqn % left-align display math formulas
]{scrartcl}
% encoding
\usepackage[utf8]{inputenc}
% prettier fonts
\usepackage[T1]{fontenc}
% use palatino font family
\usepackage{mathpazo}
% language stuff
\usepackage{babel}
%%
% customize lists
%%
\usepackage{enumitem}
% make all lists more compact
\setlist{leftmargin=*,nosep}
% set label of all levels of itemize lists to bullet point
\setlist[itemize]{label=\textbullet}
%%
% customize page margins
%%
\usepackage[left=5mm,right=5mm,top=5mm,bottom=5mm]{geometry}
% no indendation of new paragraphs
\setlength{\parindent}{0pt}
% tables
\usepackage{tabularx}
% useful ams packages for math stuff
\usepackage{amsmath,amsthm,amsfonts,amssymb}
% overwrite fonts of headings and description lists
\setkomafont{disposition}{\normalfont\bfseries}
\setkomafont{descriptionlabel}{\normalfont\bfseries}
% multi-column layout
\usepackage{multicol}
% width of seperation rule between columns
\setlength{\columnseprule}{.5pt}
\begin{document}
\begin{multicols*}{%
4 % number of columns to use
}
\section*{Usage}
This is a template for compact cheat sheets. Read the code for customization options.
\subsection*{Headings}
Use the familiar \texttt{section}, \texttt{subsection}, \texttt{subsubsection} or their asterisk variants to outline your sheet.
\subsection*{Math mode}
Both inline formulas, like $\frac{1}{n-1} \sum_{i=1}^n (x_i - \mu)^2$, and display formulas, like
\[
\frac{1}{n-1}\sum_{i=1}^n (x_i - \mu)^2
\]
work. We included the \texttt{amsmath} package, so e.\,g. \texttt{align} also works
\begin{align*}
\mathbb E(X) &= \frac{1}{n} \sum_{i=1}^n x_i\\
\operatorname{Var}(X) &= \frac{1}{n} \sum_{i=1}^n x_i^2
\end{align*}
\subsection*{Lists}
We use the \texttt{enumitem} package to make \texttt{itemize} lists more compact.
\begin{itemize}
\item Item 1
\item Item 2
\begin{itemize}
\item Item 2.1
\item Item 2.2
\begin{itemize}
\item Item 2.2.1
\item Item 2.2.2
\end{itemize}
\end{itemize}
\item Item 3
\end{itemize}
\subsection*{Tables}
Use \texttt{tabularx} to make tables of full column width.
\begin{tabularx}{\columnwidth}{|c|X|}
\hline
1 & Entry 1\\
2 & Entry 2\\
\hline
\end{tabularx}
\end{multicols*}
\end{document}